Is there a way to change the fog values for certain players.
Ex:
- Player 1 and Player 2 are in a field, there's no fog.
- Player 1 enters a cave, he sees a dense blue fog
- Player 2 is still outside and still has no fog.
I've been trying to do this also, it would be very possible with the ReplicateData function of cvar2, but it has been removed and haza55 hasn't gotten around to adding it back in.
[url]http://www.facepunch.com/showthread.php?t=729841[/url]
If you can work out how to use the extended render libraries fog functions, that can be used clientside to achieve what you want. However I can't get them to work :(
i think this is best done by the map.
fog is clientside, right?
[QUOTE=comet1337;24515043]i think this is best done by the map.
fog is clientside, right?[/QUOTE]
As far as I'm aware, you can't have multiple env_fog_controllers on a map, except for in the L4D2 engine.
Your best bet is to get haza to re-implement that function into his module, or to make your own fog by drawing rectangles over the players view at increasing distances away from the camera.
What about the fog in renderx?
I'd like to know about the fogs in renderx, is it possible to have them clientside?
Here's all of render(x) fog related functions and as you can see they're all clientside:
[url]http://luasearch.overvprojects.nl/index.php?keywords=fog[/url]
That's pretty awesome, except for the fact that I know nothing of renderx. Where would I call those function? When I do a simple autorun .lua gmod tells me
"Warning: You're trying to render in the wrong place. This doesn't play nice with multi-core rendering, so we're not going to let you draw here."
[QUOTE=iRzilla;24518043]Can you show us some code?[/QUOTE]
Simple line of code in an .lua autorun.
[lua]
render.FogMode(MATERIAL_FOG_LINEAR);
[/lua]
I have absolutely no knowledge of renderx, where the hell do I call it?
Oh well, can't seem to get it to work, here's in a clientside file
[lua]
function GM:PrewDrawOpaqueRenderables()
render.FogMode(MATERIAL_FOG_LINEAR);
render.FogStart(200);
render.FogEnd(1000);
render.FogColor(255,255,255);
a,b,z = render.GetFogDistances();
print(a)
print(b)
print(z)
end
[/lua]
Values print fine, but there's no fog to be seen anywhere.
There doesnt seem to be a proper render hook for applying fog to the world anyways, with the code you provided (fixed the typo of course) it only applies to objects, not the map
it does NOT work in RenderScene
Seems like I'll have to use a workaround to make a look-a-like fog.
Thanks for the additional testing Tobba.
Sorry, you need to Log In to post a reply to this thread.