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

Volumetric lighting #3601

Closed
wants to merge 19 commits into from
Closed

Volumetric lighting #3601

wants to merge 19 commits into from

Conversation

vlj
Copy link
Contributor

@vlj vlj commented Jan 14, 2024

This PR adds volumetric lighting for sunlight and point lights.

  • The volumetric effect is raymarch based and is based on physical transmittance equation
  • The fog is "thicker" around z = 0, and thickness follow an exponential curve
  • sunlight has shadow support (but it seems quite costly)

This is a draft PR.

TODO:

  • Currently only Vulkan is supported
  • Add options to disable or limit the number of raymarch steps

Screenshots

image
image

@MaNGusT-
Copy link
Contributor

seems that it's time to change fog color :). awesome work btw

@MaNGusT-
Copy link
Contributor

MaNGusT- commented Jan 21, 2024

got huge fps drop when returned from 1st beta away mission. Log was about 1.5gb with these errors
info |10:11:47: [operator():56] Assert in Warzone: D:/a/warzone2100/warzone2100/src/lib/ivis_opengl/pielighting.cpp:56 (y < mapHeight + 1), last script event: ''

info |10:11:47: [operator():55] mapTile: x value is too big (120,67) in 64x64

info |10:11:47: [operator():55] Assert in Warzone: D:/a/warzone2100/warzone2100/src/lib/ivis_opengl/pielighting.cpp:55 (x < mapWidth + 1), last script event: ''

info |10:11:47: [operator():56] mapTile: y value is too big (120,67) in 64x64

@past-due past-due mentioned this pull request Jan 27, 2024
@MaNGusT-
Copy link
Contributor

It's better to use gaussian specular term in tcmask shader because it does sharper light reflection and looks better on metallic surfaces
https://paroj.github.io/gltut/Illumination/Tut11%20Gaussian.html

@vlj vlj closed this Mar 3, 2024
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 this pull request may close these issues.

2 participants