render.SuppressEngineLighting

From GMod Wiki

Jump to: navigation, search
Function
Syntax render.SuppressEngineLighting( Boolean suppress )
Where is this used?
Description:
Sets whether the engine's lighting should be used.
Returns: nil
Part of Library: render
Realm: NewerClient.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Render.SuppressEngineLighting]Render.SuppressEngineLighting [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionMakes all models green and transparent.
Used onNewerClient.png
Code
 
function MakeMyPlayersGreenAndTransparent()
	cam.Start3D( EyePos(), EyeAngles() )
		for k, v in pairs( ents.GetAll() ) do
			if ValidEntity( v ) && util.IsValidModel( v:GetModel() or "" ) then
				render.SuppressEngineLighting( true )
				render.SetColorModulation( 0, 1, 0 )
				render.SetBlend( 0.5 )
				SetMaterialOverride( "debug/white" )
 
				v:DrawModel()
 
				render.SuppressEngineLighting( false )
				render.SetColorModulation( 1, 1, 1 )
				render.SetBlend( 1 )
				SetMaterialOverride( 0 )
			end
		end
	cam.End3D()
end
hook.Add( "RenderScreenspaceEffects", "GreenAndTrans", MakeMyPlayersGreenAndTransparent )
 
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox