Quake II RTX

Quake II RTX

MASTAN Jun 18, 2019 @ 5:50pm
Feature request - underwater "god rays"
In reality "god rays" is effect of light scattering. Water itself should scatter more(especially if it's sewer water). Screenshots over/underwater for comparison:

https://steamcommunity.com/sharedfiles/filedetails/?id=1774275243
https://steamcommunity.com/sharedfiles/filedetails/?id=1774275273

Real video for reference with underwater "god rays"
https://www.youtube.com/watch?v=e6VZLJlHCUM @0:30 and further
< >
Showing 1-3 of 3 comments
v00d00m4n Jun 19, 2019 @ 4:48am 
True, i vote for this!
WarnerCK Jun 23, 2019 @ 6:42pm 
This would be great, but not easily doable in Quake 2.

The water isn't an object at all, it's just a wall you can walk through. You couldn't even see through it in the original game. As I understand it, the lighting stuff is done on the surface texture, and the client darkens the display, plays sounds and eventually kills you based on whether you're completely one side of the texture or not.

The normal light reflects and refracts at the surface but the god rays don't, so they were specifically turned off underwater because they looked weird:
qboolean vkpt_god_rays_enabled(const sun_light_t* sun_light, int medium) { return god_rays.enable->integer && god_rays.intensity->value > 0.f && sun_light->visible && !physical_sky_space->integer // god rays look weird in space because they also appear outside of the station && medium == MEDIUM_NONE; // god rays don't look right under water because they do not reflect or refract }

What happens now, I think, is that god rays are just turned off if you're underwater. If you're not, they just go in a straight line till they hit an opaque surface.

Instead of straight-till-opaque, they'd need to change it when it hit a transparent surface and refract it (at least) to a different angle. Maybe do reflections of the god rays, too, for the rippled light on the ceiling effect.

I have no idea how computationally expensive the god rays are.

Edit: according to the profiler, they aren't terribly expensive. That place in the sewer on the first level, as shown in your screenshot, has it at 0.48 ms, about the same as the BVH update. There does seem to be the budget to make them nicer.
Last edited by WarnerCK; Jun 23, 2019 @ 6:57pm
MASTAN Nov 26, 2019 @ 8:44am 
Yay, they've added it!
< >
Showing 1-3 of 3 comments
Per page: 1530 50

Date Posted: Jun 18, 2019 @ 5:50pm
Posts: 3