Shadow issue with an unshaded array shader


I got some shading issue currently, i’m using a unshaded array texture on a plane to generate a hexmap, each texture contain an alpha part who hide unneeded part of the plane. So far without the shadow on it, it work as expected. When the shadow is activated, an issue appear with this alpha part where it is calculated when i wont it to be calculated, i’ve tryed a lot of settings on the shader to make it work as expected but i still got the issue of the alpha part of the mesh being calculated by the shadow.
I’m using the unshadedArray.j3md with the AlphaTest activated. (other additional render state seam to make no difference)

As you can see on this picture there is another artefact with the shadow on the character, but i guess it come from how the mesh is done, not an issue for the time being, on some way ^^.

Thx for the help in advance.

I don’t really get your issue but, I’ll try a blind shot, try to set the AlphaDiscardThreshold to something like 0.1 on your transparent material

polys seems to be inside out?

the issue can be seen at the start and the end of the shadow, at the start of the shadow on hexagon there is an offset who should’t be there, then at the end the shadow we can see a square shape where it should be an hexagon shape.

The shader i got didn’t have AlphaDiscardThreshold option, how can i do ?

The offset and the square are 2 different issues.
The offset is due to the shadow implementation to avoid Z fighting. usually it’s alleviated by using a shaded material.

Look at how the AlphaDiscardThreshold is declared and used in the unshaded.j3md and unshaded.frag. You’ll have to do the same.

I’ve followed you instruction and now i got this as a shader :
unshaded array j3md
unshaded array frag

I got no change on my issue, but i got now, on the material, the AlphaDiscardThreshold option, i’ve setted it to 0.1 to 0.5, no change.
As additional render state on the material i got :
DepthWrite == true;
ColorWrite == true;
DepthTest == true;
That’s all.

I’m using a DirectionalLightShadowFilter since it give me less artefact than the DirectionalLightShadowRenderer.
And i got a white ambient light in the scene.