Disable fog on gmod

Hi, i have create a script, but it is’nt functionnaly :


render.FogMode( 0 )

Please how to disable fog with a script ?

Bye !

I quickly got the file i use to change the players fog based on a statistica. I modified it to fit your problem. That being said you can use it and something like that will come out:
HOWEVER if the Fog is MAP dependent it COULD not work! I am not sure!
A try is a try though.
EDIT: Put in clientsided autorun. Or include it somehow. Your choice.
[lua]
function SetupWorldFog()
render.FogMode( MATERIAL_FOG_LINEAR )
render.FogStart( 0 )
render.FogEnd( 0 )
render.FogMaxDensity( 0 )
render.FogColor( 200, 200, 200 )
end
hook.Add( “SetupWorldFog”, “SpecialSetupWorldFog”, SetupWorldFog )
[/lua]

EDIT2: There is also something called a SkyBoxFog. Might include that as well.

[lua]
function SetupSkyboxFog()
render.FogMode( MATERIAL_FOG_LINEAR )
render.FogStart( 0 )
render.FogEnd( 0 )
render.FogMaxDensity( 0 )
render.FogColor( 200, 200, 200 )
end
hook.Add( “SetupSkyboxFog”, “SpecialSetupSkyboxFog”, SetupSkyboxFog )
[/lua]

Thanks but this is not functionally because the fog is on the map

Then i guess you can’t remove it without editing the map itself ;/

You can find the fog controller entity using

ents.FindByClass
Then set its fog value using

Entity:SetKeyValue

Edit:

Or you could just remove the controller



for k,v in pairs(ents.FindByClass("env_fog_controller")) do
    v:Remove()
end


Thans it is functionally !