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

Add a volumetric fog demo #658

Merged
merged 2 commits into from
Mar 26, 2022

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Oct 31, 2021

Marked as draft as I need help to get the mouselook script working again. It's based on https://github.com/godotengine/godot-demo-projects/blob/master/3d/waypoints/camera.gd, but with the 4.0 changes, I couldn't figure out how to make it work as expected.

This is an example of Godot's volumetric fog capabilities with the Vulkan renderer.

Showcased features are:

  • Positive/negative density volumes that affect albedo (incoming light) and emission.
  • Box/ellipsoid shapes, height falloff, and density modulation using a 3D texture.
  • Temporal reprojection for greater stability and avoiding flickering.
    • The difference is demonstrated with a moving fog volume.
  • Global density adjustment. With FogVolume nodes that have a positive density, it's possible to apply volumetric fog only in specific areas.

TODO

Preview

Volumetric Fog

Video

volumetric_fog.mp4

@Calinou Calinou changed the base branch from master to 4.0-dev October 31, 2021 19:11
@Calinou Calinou force-pushed the add-volumetric-fog-demo branch from 7eef4a4 to 0c2b01d Compare October 31, 2021 19:22
This is an example of Godot's volumetric fog capabilities
with the Vulkan renderer.

Showcased features are:

- Positive/negative density volumes that affect albedo (incoming light)
  and emission.
- Box/ellipsoid shapes, height falloff, and density modulation using a
  3D texture.
- Temporal reprojection for greater stability and avoiding flickering.
  - The difference is demonstrated with a moving fog volume.
- Global density adjustment. With FogVolume nodes that have a
  positive density, it's possible to apply volumetric fog only in
  specific areas.
@Calinou Calinou force-pushed the add-volumetric-fog-demo branch from 0c2b01d to 31cc886 Compare October 31, 2021 21:03
@aaronfranke aaronfranke added this to the 4.0 milestone Nov 3, 2021
@ScorpionInc
Copy link
Contributor

ScorpionInc commented Jan 24, 2022

I got the camera script to run on 4.0 alpha 1 with minor tweaks. Also got it to be able to go up and down as well. Available here: https://github.com/ScorpionInc/CameraLook-Test-Godot-4.0-Alpha1 hope it helps looking forward to trying out this demo. Edit: Updated code.

@ScorpionInc
Copy link
Contributor

Just tested the demo the camera script seems fine to me the only change I had to do was from: transform.basis = Basis(rot, 0) to: transform.basis = Basis(Quaternion(rot)) hope this helps o/ I was tying to help with the shader but I'm still learning, I'll let you know if I get anything decent working.

@aaronfranke
Copy link
Member

aaronfranke commented Jan 28, 2022

@ScorpionInc In Godot 4.0, instead of a constructing using Euler angles, you use the new explicit Basis from_euler method. https://github.com/godotengine/godot/blob/master/doc/classes/Basis.xml#L69

@aaronfranke aaronfranke marked this pull request as ready for review March 26, 2022 20:09
@aaronfranke aaronfranke merged commit f47d090 into godotengine:4.0-dev Mar 26, 2022
@aaronfranke
Copy link
Member

Thanks!

@Calinou Calinou deleted the add-volumetric-fog-demo branch March 26, 2022 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants