Shadow Exponential filter / Transparent Mesh Problem
-
- Gnoblar
- Posts: 9
- Joined: Wed Jul 26, 2017 2:50 am
Shadow Exponential filter / Transparent Mesh Problem
Hello. I have this problem. I need to use I transparent floor, but in the shadow I want Exponential Filter for soft shadow.
I was doing some test in the Sample_ShadowMapDebugging project.
I realized, that if the shadow filter is PCF #x# shadow look the same no matter if the floor is or not transparent.
However, when I set the filter in ESM if the floor is transparent look like the filter is not working, is very sharp the shadow.
Looking the debug image below, I suppose that probably is something about that the plane transparent is not present in the shadow map.
But this is a bug?, is a limitation of the exponential filter?, is there any trick to get the soft shadow in the transparent object?.
Regards.
Eduardo
I was doing some test in the Sample_ShadowMapDebugging project.
I realized, that if the shadow filter is PCF #x# shadow look the same no matter if the floor is or not transparent.
However, when I set the filter in ESM if the floor is transparent look like the filter is not working, is very sharp the shadow.
Looking the debug image below, I suppose that probably is something about that the plane transparent is not present in the shadow map.
But this is a bug?, is a limitation of the exponential filter?, is there any trick to get the soft shadow in the transparent object?.
Regards.
Eduardo
- dark_sylinc
- OGRE Team Member
- Posts: 5296
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1278
- Contact:
Re: Shadow Exponential filter / Transparent Mesh Problem
What you're seeing is a limitation of exponential shadow maps, but there is a possible solution.
Here's what happening:
Here's what happening:
- ESM doesn't look good if there is a lot of distance between casters. In this case, because the plane isn't rendering, the distance is almost infinite.
- The solution would be to put some other caster (e.g. another floor) behind the current floor that's failing. How far behind? You experiment.
- Transparency disables casting shadows, which is why the floor stopped casting shadows, and thus the shadow map had only the shadows of the cubes (and because the gigantic distance between the clear colour aka the max possible depth, and the cube's depth, the issue appeared)
-
- Gnoblar
- Posts: 9
- Joined: Wed Jul 26, 2017 2:50 am
Re: Shadow Exponential filter / Transparent Mesh Problem
Hi dark_sylinc.
Thanks for the answer . I did what you mention, I placed a plane under the transparency one, but the issue keep.
Even I realize that in the plane below (has no transparency) the shadow has the same problem.
Image.
Really thanks.
Eduardo
Thanks for the answer . I did what you mention, I placed a plane under the transparency one, but the issue keep.
Even I realize that in the plane below (has no transparency) the shadow has the same problem.
Image.
Really thanks.
Eduardo
-
- Gnoblar
- Posts: 9
- Joined: Wed Jul 26, 2017 2:50 am
Re: Shadow Exponential filter / Transparent Mesh Problem
Testing some values in the shadow project, created an concern about something.
Why ESM pay attention to the transparency?, I ask that because normal Depth Map Shadow don't pay attention if the object is transparent or not. If the object is transparent Depth Map shadow create a normal shadow like it's was opaque.
I ask that because for example if a I use transparent object the ESM don't project the shadow correctly . PCF filter work as I expected. I reviewed the code that use ESM filter and I don't see anything in the code that considerer the alpha.
Thanks and regards.
Eduardo
Why ESM pay attention to the transparency?, I ask that because normal Depth Map Shadow don't pay attention if the object is transparent or not. If the object is transparent Depth Map shadow create a normal shadow like it's was opaque.
I ask that because for example if a I use transparent object the ESM don't project the shadow correctly . PCF filter work as I expected. I reviewed the code that use ESM filter and I don't see anything in the code that considerer the alpha.
Thanks and regards.
Eduardo
- dark_sylinc
- OGRE Team Member
- Posts: 5296
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1278
- Contact:
Re: Shadow Exponential filter / Transparent Mesh Problem
Could you post the modified code of ShadowMapDebugging? I want to check it myself to see if it's a bug or wrong param, etc
-
- Gnoblar
- Posts: 9
- Joined: Wed Jul 26, 2017 2:50 am
Re: Shadow Exponential filter / Transparent Mesh Problem
Hi Dark, here I send you the file in the upload.
I don't know if this file "ShadowMapDebuggingGameState.cpp" is what are you ask me for, but was the only that I changed.
Regards.
I don't know if this file "ShadowMapDebuggingGameState.cpp" is what are you ask me for, but was the only that I changed.
Regards.
- Attachments
-
- ShadowMapDebuggingGameState.cpp
- (22.46 KiB) Downloaded 51 times
-
- Gnoblar
- Posts: 9
- Joined: Wed Jul 26, 2017 2:50 am
Re: Shadow Exponential filter / Transparent Mesh Problem
Hi. Any idea about this problem?.
Thx for any help.
Thx for any help.