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 Fog goes dark on the edges when a Fog shader is used #64634

Closed
Tracked by #69579
Hannyson opened this issue Aug 19, 2022 · 2 comments · Fixed by godotengine/godot-docs#6809
Closed
Tracked by #69579

Comments

@Hannyson
Copy link

Hannyson commented Aug 19, 2022

Godot version

4.0.alpha12

System information

Archlinux

Issue description

I use a FogVolume type World, to decrease the fog density with the altitude. When it goes near 0.0, the color switches to a much darker color on the last appearing line.

Steps to reproduce

Create a FogVolume type World, with a new ShaderMaterial and a fog shader :

shader_type fog;

void fog() {
	ALBEDO = vec3(1.0);
	DENSITY = mix(0.005, 0.0, WORLD_POSITION.y * 0.01);
}

Minimal reproduction project

TestVolumetricFogBug.zip

@Calinou
Copy link
Member

Calinou commented Aug 19, 2022

PS: Code blocks should use triple backticks like this (with an optional language name for syntax highlighting):

```glsl
code here
```

I edited your post accordingly, but remember to do this in the future 🙂

@clayjohn
Copy link
Member

This isn't a bug, what you are seeing is the end of the Volumetric Fog. In the MRP it extends to 1024 metres because the Volumetric Fog length is 1024 metres. If you use a smaller value it won't extend as far. Volumetric Fog cannot extend forever so it needs to be mixed with fixed fog if you want to keep fog in the far distance consistent

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

Successfully merging a pull request may close this issue.

4 participants