You just made my day
Fog shader?
Re: Fog shader?
Huh, how about that! That’s great news.
Re: Fog shader?
OK, I'm running into problems.
For testing purposes I've set in terrain_fragment.glsl.
The far terrain looks as expected, but the near terrain is off.
It appears as if for the near terrain, the output of the fragment shader gets added to the framebuffer.
Does anybody know what's going on here?
For testing purposes I've set
Code: Select all
gl_FragData[0].xyz = vec3(0.5);
It appears as if for the near terrain, the output of the fragment shader gets added to the framebuffer.
Does anybody know what's going on here?
Re: Fog shader?
Terrain texture blending adds terrain textures (multiplied by their blend alpha) onto a pitch black base layer now, instead of alpha blending them over a base dirt texture. Aside from that, I have no idea. The black layer may be rendering through the terrain fragment shader.
Re: Fog shader?
Hmm, I guess that means I need to multiply the fog color by the blend alpha.
I will try that.
I will try that.
Re: Fog shader?
I think that happens automatically, since you only set x y and z. The issue is probably the underlying black layer.
Re: Fog shader?
Alright - problem solved!
If I multiply the fog amount with 1-gl_Fog.scale everything looks as intended.
Edit: I'm not sure though if that's the proper way to do it.
It would be best if some precprocessor define was set to indicate that no fog should be added, as in the case of the black base layer.
If I multiply the fog amount with 1-gl_Fog.scale everything looks as intended.
Edit: I'm not sure though if that's the proper way to do it.
It would be best if some precprocessor define was set to indicate that no fog should be added, as in the case of the black base layer.
Re: Fog shader?
Newest version: https://gitlab.com/vrresto/openmw/tree/my-fog-shader
Note: shadows don't work yet.
Note: shadows don't work yet.
Re: Fog shader?
Hi, could someone direct me to how to use shaders like this?
- AnyOldName3
- Posts: 2686
- Joined: 26 Nov 2015, 03:25
Re: Fog shader?
Basically, you'll need to build OpenMW yourself (by following this guide http://wiki.openmw.org/index.php?title= ... ment_Setup) having checked out the branch linked above. The guide should be more-or-less idiot-proof, but it's still potentially too daunting for most people to bother with.