Fog Controller Z Clip problem with the Skybox

  • New users! Unable to confirm your account via email? Contact nesman on discord, there's an issue with the email server. *unrelated to the recent issue that we DM'd everyone about.

The_Gl!tch.exe

L3: Member
Apr 3, 2018
123
4
Hello there,
I'm using underwater skybox textures including their settings for the lighting, fog, etc.
By default the parameter "Far Z Clip Plane" is set to 3800.
This means, anything beyond this distance does not render at all, which is quite practical for underwater effects.

However, there is a problem.
I can synchronize the fog settings with the sky_camera entity but the "Far Z Clip Plane" parameter does not exist.
This means, if I swim far away the map doesn't render anything beyond the distance of 3800 except the skybox.
I've tried adding the "farz" parameter to the sky_camera entity manually without SmartEdit but it didn't work.

20250410173706_1.jpg


Is there a solution for this, perhaps with VScript?
 

Pocket

Half a Lambert is better than one.
aa
Nov 14, 2009
4,711
2,587
You really don't want to be using the far Z clipping plane at all except as a last resort, because it abruptly makes things disappear into thin air. There's no nice gradual fade like with fog. Anything past the max fog distance is going to be super well optimized anyway because it's cutting the whole texture/shader system out of the equation, I think.
 

Tiftid

the Embodiment of Scarlet Devil
aa
Sep 10, 2016
628
478
Hi,
Although Pocket is very right about the Far Z clipping plane being bad, I have a solution for you.

It's true what you've found out that the Far Z clipping plane doesn't work for the 3D skybox. It's simply not implemented in the engine C++ code, there is no workaround.
But prop_static's fade distances are available and functional even in the 3D skybox.
By setting each prop in the 3D skybox to have a Start Fade Distance of -1 and an End Fade Distance of 3800, you can mimic the effect of a farz distance of 3800, and even potentially have a prettier fadeout effect by setting the Start Fade Distance to be lower than 3800.

There's an entity that mimics this behaviour for brushes known as func_lod, but it doesn't work for displacements, so it would be much more sensible to turn your 3D skybox brush and displacement geometry into static props with Propper++ and then set fade distances for these generated props.
 

The_Gl!tch.exe

L3: Member
Apr 3, 2018
123
4
But prop_static's fade distances are available and functional even in the 3D skybox.
By setting each prop in the 3D skybox to have a Start Fade Distance of -1 and an End Fade Distance of 3800, you can mimic the effect of a farz distance of 3800, and even potentially have a prettier fadeout effect by setting the Start Fade Distance to be lower than 3800.
Is there a detail I'm missing?
Screenshot 2025-04-11 164131.png

It doesn't seem to work that way.

On the other hand removing the farz parameter would synchronize the map and skybox rendering stuff but with far away stuff staying foggy forever (which is sth the skybox creator prob didn't intend)
 

Tiftid

the Embodiment of Scarlet Devil
aa
Sep 10, 2016
628
478
Is there a detail I'm missing?
Screenshot 2025-04-11 164131.png

It doesn't seem to work that way.

On the other hand removing the farz parameter would synchronize the map and skybox rendering stuff but with far away stuff staying foggy forever (which is sth the skybox creator prob didn't intend)
Hi,
I accidentally misled you; you need to use a fade distance of 237 instead of 3800 for the 3D skybox props.
I made my last post under the assumption that the game knows to divide 3D skybox prop fades by the 3D skybox scale as it does for fog distances, but this is not true.
 

The_Gl!tch.exe

L3: Member
Apr 3, 2018
123
4
It works now but the result makes it look worse than before.
20250411225458_1.jpg

I guess I'll continue without far Z and fade distance at this point.
It's a trade map so this detail won't matter that much.
Thanks for the help anyway.