Why are there lines between block models? (SOLVED)

Hi everyone, I am working on a project with the recently shared 1.13.1 directional shadows example. I have a simple cube model and a texture applied to it. There is no space between the block models but I can see black space/liens between them Even if I move a block into another so they overlap, the line is still visible where they start overlapping. How do I fix this?


They overlap here:

Hmm, I was suspecting problems with float precision and that maybe shadow from sides somehow ‘poke’ to the top or something (might be a wrong guess, I’m beginner when it comes to lights, shadows and rendering)?

But I cannot replicate it, I tried to put 8 cubes in the 3D shadow example and it works correctly.


Could you share the minimal project that have this issue?

1 Like

Maybe augment texture extrusion?

Here is the minimal test project.
render_directional_light_shadows.zip (278.6 KB)
Even on the models, I can see the shadow line


But corner block has it only at one side

I checked the textures in case there are parts painted and invisible on editor but that does not seem to be the case

@Pawel did a fix for the lit.material where precision was increased on the world matrix to avoid seams

Perhaps related?

Tried using mediump instead of highp but the lines still persist. I am using the shadow receiver material and Defold version is the latest 1.13.1 release.
So, I think they are not related

I can’t check out the example because I’m not using 1.13.1 yet, but I can see that you have pixelated textures even though the material is set to linear filter. Try nearest

(post deleted by author)

It is actually set to nearest already. It works on the sprite but for model textures, they look blurry:

The grass texture is actually 64x64, but the PNG file is 256x256 with a lot of transparent space around it. This might be causing the issue.
If I crop it to 64x64, it looks like it fixes it(size is not correct probably because of the UV).

You might also just use a single cube with proper UVs with a single texture.

I opened your test project and see:


After change sampler filter to nearest in directional_shadow_receiver material


4 Likes

Thanks a lot! It solved the problem and now model textures look sharp :grin:

2 Likes