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

Cloudy fog effect #17

Open
KuriMC606 opened this issue May 2, 2024 · 6 comments
Open

Cloudy fog effect #17

KuriMC606 opened this issue May 2, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@KuriMC606
Copy link

New fog type with nlRenderVolFog function, uses ray matching on this fog to appear randomly and move on the map, similar to Rain Mist and this photo
Volumetric-ground-fog

@KuriMC606
Copy link
Author

Is this possible?

@devendrn
Copy link
Owner

devendrn commented May 2, 2024

Would be quite hard to make something similar to that

@devendrn devendrn added the enhancement New feature or request label May 2, 2024
@devendrn
Copy link
Owner

devendrn commented May 2, 2024

This is a good suggestion, but I'm not sure how the result will turn out to be. Two ways I think this could be implemented are:

Approach 1 (Realistic):

  1. Use worldPos and cPos to somehow get tiledWorldPos.
  2. Create a 3D tiled noise pattern (add linear waves to get motion)
  3. Add fog fade to 3d noise
  4. Raymarch volumetrics
  5. Mix with actual fog

Approach 2 (Just fake it):

  1. Make some good looking noise pattern
  2. Add it to fog

Approach 1 isn't really suited for this shader, but it's possible.

@devendrn devendrn changed the title New Fog Type Cloudy fog effect May 2, 2024
@KuriMC606
Copy link
Author

I think you add it and add a config line to toggle between the two approach and turn it on and off

@1Sekon
Copy link
Contributor

1Sekon commented May 9, 2024

does Approach 1 is possible to do in vertex shader?
i know noise is possible but how about for() function?

@devendrn
Copy link
Owner

devendrn commented May 9, 2024

Approach 1 is possible to do in vertex shader?

Yes, its possible. But it will look a little weird when you move because of interpolation. As example, look at the cloud/aurora reflection on water in this shader.

how about for() function?

Yes you can use any control statement in vertex shader. See GLES 2.0 Reference card to understand GLSL more.

devendrn added a commit that referenced this issue Oct 3, 2024
- Add simple cloudy fog effect (#17)
- Mirror sky gradient
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants