Garry's Mod Wiki

ProjectedTexture:SetSkipShadowUpdates

  ProjectedTexture:SetSkipShadowUpdates( boolean enable )

Recently Added

This was recently added in version (2026.04.10). It might only be available on the Dev Branch right now.

Description

Sets whether shadow updates are disabled for this ProjectedTexture. This can be useful to save up on performance, but it will inevitably cause graphical glitches if left not updating for long.

Arguments

1 boolean enable
Whether future shadow updates should be skipped.

Example

Creates a projected texture on the entity, holding reload key will freeze the projected shadow.

function ENT:OnRemove() if ( IsValid( self.lamp ) ) then self.lamp:Remove() end end function ENT:Think() -- Keep updating the light so it's attached to our entity -- you might want to call other functions here, you can do animations here as well local pos = self:GetPos() local angles = self:GetAngles() if ( IsValid( self.lamp ) ) then self.lamp:SetPos( pos ) self.lamp:SetAngles( angles ) if ( Entity(1):KeyDown( IN_RELOAD ) ) then self.lamp:SetColor( Color( 255, 255, 255 ) ) self.lamp:SetSkipShadowUpdates( true ) self.lamp:Update() else self.lamp:SetColor( Color( 255, 255, 255 ) ) self.lamp:SetSkipShadowUpdates( false ) self.lamp:Update() end self.FrameFlipFlop = !self.FrameFlipFlop else local lamp = ProjectedTexture() -- Create a projected texture self.lamp = lamp -- Assign it to the entity table so it may be accessed later -- Set it all up lamp:SetTexture( "effects/flashlight001" ) lamp:SetFarZ( 500 ) -- How far the light should shine lamp:SetPos( pos ) -- Initial position and angles lamp:SetAngles( angles ) lamp:Update() end end