Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mod_Q1BSP_AssignNoShadowSkySurfaces allows rtlights to go through sky brushes #220

Open
hemebond opened this issue Nov 15, 2024 · 7 comments · May be fixed by #221
Open

Mod_Q1BSP_AssignNoShadowSkySurfaces allows rtlights to go through sky brushes #220

hemebond opened this issue Nov 15, 2024 · 7 comments · May be fixed by #221

Comments

@hemebond
Copy link
Contributor

hemebond commented Nov 15, 2024

When this function is allowed to run, any sky surface with a void behind it will be ignored when an rtlight is casting shadows, which can cause the light to shine into parts of the map through the back of other nearby surfaces.

In this screenshot the light is hitting the top of the stone walls through the back of the stone ceiling

image

Disabling the Mod_Q1BSP_AssignNoShadowSkySurfaces function works to fix this, however this then breaks e1m5.

@hemebond
Copy link
Contributor Author

hemebond commented Nov 15, 2024

This seems to resolve the issue:

diff --git a/model_brush.c b/model_brush.c
index 69082e61..39019c0f 100644
--- a/model_brush.c
+++ b/model_brush.c
@@ -3275,7 +3275,7 @@ static void Mod_Q1BSP_AssignNoShadowSkySurfaces(model_t *mod)
                        // check if the point behind the surface polygon is SOLID or SKY contents
                        VectorMAMAM(0.5f, surface->mins, 0.5f, surface->maxs, -0.25f, mod->surfmesh.data_normal3f + 3*surface->num_firstvertex, center);
                        contents = Mod_Q1BSP_PointSuperContents(mod, 0, center);
-                       if (!(contents & SUPERCONTENTS_SOLID))
+                       if (contents & SUPERCONTENTS_SOLID)
                                surface->texture = surface->texture->skynoshadowtexture;
                }
        }

image

@Baker7
Copy link

Baker7 commented Nov 15, 2024

I'd be super, super careful with this one.

There was a "dynamic light fix" at Quakesrc.org in ancient times that stopped light bleeding through walls. And in a few cases the results were great. But there aren't any Quake engines using the fix because it created several other inconsistent problems.

@hemebond
Copy link
Contributor Author

This isn't really about dynamic light bleeding through walls, it's about sky surfaces not blocking realtime light, as if the sky surfaces were not there at all.

@Baker7
Copy link

Baker7 commented Nov 16, 2024

I am interested in trying out what you've done, I think it is cool that you investigate these things.

I'm going to make the cvar and run around some maps and look at stuff.

@Baker7
Copy link

Baker7 commented Nov 16, 2024

image

See above ^^ you have real time light editor on, is not displayed on-screen.

r_editlights

Mentioning this because that was the first thing I addressed when I compiled DarkPlaces Beta for the first time.

@hemebond
Copy link
Contributor Author

hemebond commented Nov 17, 2024

See above ^^

I can't see the image so I'm not sure what you're referring to.

@Baker7
Copy link

Baker7 commented Nov 17, 2024

It was a quote of your 2nd image in this thread.

The pic of the Quad symbol with the shadow. In the upper right corner, the real-time light editor panel is cut-off and you can only see part of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants