There's a snippet from the wiki page on [b][url=http://wiki.garrysmod.com/?title=Render.SetBlend]Render.SetBlend [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]:
[lua]function MakeMyPlayersGreenAndTransparent()
cam.Start3D( EyePos(), EyeAngles() )
for k, v in pairs( player.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 )
[/lua]
And I set the material to models/props_combine/stasisshield_sheet, it makes players green, but not transparent. Is this a bug or am I doing it wrong?
[editline]02:56AM[/editline]
render.SetBlend doesn't seem to work at all for me, even when everything else in a hook is working fine.
that example is spread around the wiki, some of them is wrong i think but some is fixed
Apparently, transparency seems to fail on players, or at least on yourself. You will never see yourself transparent, but other players should see it fine.
Sorry, you need to Log In to post a reply to this thread.