Strange shadow effects with transparent quads #1681
Replies: 5 comments 1 reply
-
|
My best guess is the trees are made up from textured quads and use alpha blending to pick out just the leaves and branches when rending to the colour buffer, but when being rendered to the shadow map no alpha discard is happening for the transparent texels so the whole quad is making it through to the shadow map. Have a look at the material settings to see if alpha cutoff/discard is on/off. |
Beta Was this translation helpful? Give feedback.
-
|
If I zoom in on the edges of leaves, I can see the edge of the terrain through them, so that basically confirms they're using blending. As a bit more context, alpha blending still does a depth write for the entire triangle, even the fully transparent parts, and just makes it so the colour written is a mixture of the previous colour and the fragment colour, a bit like an octopus changing its colour to match what's behind it. Shadow mapping doesn't care about the colour, just the depth, so blending the colours doesn't stop things casting shadows. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for looking in depth. The tree objects we use are an export from a Blender model. When I look into the mtl-file, there is also a reference to an opacity map ('map_d'). Does VSG support opacity maps (maybe with a different name)? Commenting out the map_d references the appearance changes a lot. So I see, sometimes it is better not to relie blindly to external software. I am going write a handmade piece of software for this purpose. |
Beta Was this translation helpful? Give feedback.
-
|
To be mentioned, we mostly use our own reader for wavefront files. The vehicle is read with the vsg reader. Its windows are opaque, where they should be transparent. That's a bug in assimp https://stackoverflow.com/questions/72875876/how-to-load-transparent-materials-using-assimp. |
Beta Was this translation helpful? Give feedback.
-
|
Here is an example for a correctly working wavefront reader: |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
-
In project::chrono we encountered a strange effect, when (hard) shadows are used. The simple tree objects (textured quad with transparent backgound) throw strange shadows. That doesn't seem to be logical. How can this be avoided?
Scene without shadows:
Scene with shadows:
Beta Was this translation helpful? Give feedback.
All reactions