0 votes

I have some optimized level that doesn't contain any faces that player can't see. So if this level is rendered from outside, some walls will be invisible, because back faces are not drawn.

But it is a problem for sun, that is always outside. Back faces are not rendered to the shadow map, so they doesn't cast shadows. I tried to make material Double Sided, but it doesn't affect the shadow map rendering. Is there a way to render both faces to shadow map in godot 2.1.3?

in Engine by (32 points)

If the player can see shadows... then he/she can see these faces. Why hide them? Note that realtime shadow mapping accounts for 75% of the draw calls when activated (redraws the scene for each cascade), so if you use this technique, manually hiding surfaces the player "can't see" won't yield that much performance imo.

Player in level can see only front faces, but for sun they are back faces. So they doesn't render to shadow map and player doesn't see shadow casted by wall that player can see inside the level. In other words, level is not a closed mesh.
I downloaded this level from Internet and loaded it in Godot. It was already optimized, so it is not my idea to hide back faces.

Shadow mapping does inverts backfaces to project shadows, that's how this technique actually works. I don't know what could be going on, then :/
If you have an example project you could try submitting it here so I could have a look, or an issue on Github showing the problem to the devs.

Really? I thought that face inversion is not necessary for shadow map, but sometimes it may be useful option. Both options should work well for closed meshes. But my level is not closed mesh, so both sides must be rendered.

Here is my project where you can see problem:

Have a look at my project, please. Did you see it?

To be honest, I created a simple map recently, and noticed every tunnel was not in shadow, similar to yours. I'll try to find out which backfaces in particular have this issue (or maybe it's all of them?) and I'll open a Github issue

Edit: oh my god... Godot implements shadow mapping the other way around. Backfaces are completely ignored.
I opened a thread https://github.com/godotengine/godot/issues/10404

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.