render.SetBlend
Description
Sets the alpha blending for every upcoming render operation.
Arguments
Example
Creating custom client side blending for ghosts that do not support color alpha channel.
local function BlendGhost(self)
local num = render.GetBlend()
render.SetBlend(0.8)
self:DrawModel()
render.SetBlend(num)
end
local function MakeGhost(model, pos, ang)
local ghost = ents.CreateClientProp(model)
if (not IsValid(ghost)) then return end
ghost.RenderOverride = BlendGhost
ghost:SetPos(pos)
ghost:SetAngles(ang)
ghost:PhysicsDestroy()
ghost:SetNoDraw(true)
ghost:SetNotSolid(true)
ghost:DrawShadow(false)
ghost:SetSolid(SOLID_NONE)
ghost:SetMoveType(MOVETYPE_NONE)
ghost:SetCollisionGroup(COLLISION_GROUP_NONE)
ghost:SetRenderMode(RENDERMODE_TRANSALPHA)
ghost:SetColor(color_white)
ghost:Spawn()
return ghost
end