Garry's Mod Wiki

ProjectedTexture

A client side projected texture, created by ProjectedTexture.

Methods

Angle ProjectedTexture:GetAngles()
Returns the angle of the ProjectedTexture, which were previously set by ProjectedTexture:SetAngles
number ProjectedTexture:GetBrightness()
Returns the brightness of the ProjectedTexture, which was previously set by ProjectedTexture:SetBrightness
table ProjectedTexture:GetColor()
Returns the color of the ProjectedTexture, which was previously set by ProjectedTexture:SetColor. The returned color will not have the color metatable. Issue Tracker: 2407
number ProjectedTexture:GetConstantAttenuation()
Returns the constant attenuation of the projected texture, which can also be set by ProjectedTexture:SetConstantAttenuation.
boolean ProjectedTexture:GetEnableShadows()
Returns whether shadows are enabled for this ProjectedTexture, which was previously set by ProjectedTexture:SetEnableShadows
number ProjectedTexture:GetFarZ()
Returns the projection distance of the ProjectedTexture, which was previously set by ProjectedTexture:SetFarZ
number ProjectedTexture:GetHorizontalFOV()
Returns the horizontal FOV of the ProjectedTexture, which was previously set by ProjectedTexture:SetHorizontalFOV or ProjectedTexture:SetFOV
boolean ProjectedTexture:GetLightWorld()
Returns whenever or not the Texture should light up world geometry.
number ProjectedTexture:GetLinearAttenuation()
Returns the linear attenuation of the projected texture, which can also be set by ProjectedTexture:SetLinearAttenuation.
number ProjectedTexture:GetNearZ()
Returns the NearZ value of the ProjectedTexture, which was previously set by ProjectedTexture:SetNearZ
boolean ProjectedTexture:GetNoCull()
Returns the state of projected texture view-frustum culling. See ProjectedTexture:SetNoCull.
Returns the current orthographic settings of the Projected Texture. To set these values, use ProjectedTexture:SetOrthographic.
Vector ProjectedTexture:GetPos()
Returns the position of the ProjectedTexture, which was previously set by ProjectedTexture:SetPos
number ProjectedTexture:GetQuadraticAttenuation()
Returns the quadratic attenuation of the projected texture, which can also be set by ProjectedTexture:SetQuadraticAttenuation.
number ProjectedTexture:GetShadowDepthBias()
Returns the shadow depth bias of the projected texture. Set by ProjectedTexture:SetShadowDepthBias.
number ProjectedTexture:GetShadowFilter()
Returns the shadow "filter size" of the projected texture. 0 is fully pixelated, higher values will blur the shadow more. Set by ProjectedTexture:SetShadowFilter.
Returns the shadow depth slope scale bias of the projected texture. Set by ProjectedTexture:SetShadowSlopeScaleDepthBias.
Entity ProjectedTexture:GetTargetEntity()
Returns the target entity of this projected texture.
ITexture ProjectedTexture:GetTexture()
Returns the texture of the ProjectedTexture, which was previously set by ProjectedTexture:SetTexture
number ProjectedTexture:GetTextureFrame()
Returns the texture frame of the ProjectedTexture, which was previously set by ProjectedTexture:SetTextureFrame
number ProjectedTexture:GetVerticalFOV()
Returns the vertical FOV of the ProjectedTexture, which was previously set by ProjectedTexture:SetVerticalFOV or ProjectedTexture:SetFOV
boolean ProjectedTexture:IsValid()
Returns true if the projected texture is valid (i. e. has not been removed), false otherwise. Instead of calling this directly it's a good idea to call IsValid in case the variable is nil. IsValid( ptexture ) This not only checks whether the projected texture is valid - but also checks whether it's nil.
ProjectedTexture:Remove()
Removes the projected texture. After calling this, ProjectedTexture:IsValid will return false, and any hooks with the projected texture as the identifier will be automatically deleted.
ProjectedTexture:SetAngles( Angle angle )
Sets the angles (direction) of the projected texture. You must call ProjectedTexture:Update after using this function for it to take effect.
ProjectedTexture:SetBrightness( number brightness )
Sets the brightness of the projected texture. You must call ProjectedTexture:Update after using this function for it to take effect.
ProjectedTexture:SetColor( table color )
Sets the color of the projected texture. You must call ProjectedTexture:Update after using this function for it to take effect.
ProjectedTexture:SetConstantAttenuation( number constAtten )
Sets the constant attenuation of the projected texture. See also ProjectedTexture:SetLinearAttenuation and ProjectedTexture:SetQuadraticAttenuation. You must call ProjectedTexture:Update after using this function for it to take effect.
ProjectedTexture:SetEnableShadows( boolean newState )
Enable or disable shadows cast from the projected texture. As with all types of projected textures (including the player's flashlight and env_projectedtexture), there can only be 8 projected textures with shadows enabled in total. This limit can be increased with the launch parameter -numshadowtextures LIMIT where LIMIT is the new limit. Naturally, many projected lights with shadows enabled will drastically decrease framerate. You must call ProjectedTexture:Update after using this function for it to take effect.
ProjectedTexture:SetFarZ( number farZ )
Sets the distance at which the projected texture ends. You must call ProjectedTexture:Update after using this function for it to take effect.
ProjectedTexture:SetFOV( number fov )
Sets the angle of projection. You must call ProjectedTexture:Update after using this function for it to take effect.
ProjectedTexture:SetHorizontalFOV( number hFOV )
Sets the horizontal angle of projection without affecting the vertical angle. You must call ProjectedTexture:Update after using this function for it to take effect.
ProjectedTexture:SetLightWorld( boolean lightworld )
Set whenever or not the Texture should light up world geometry.
ProjectedTexture:SetLinearAttenuation( number linearAtten )
Sets the linear attenuation of the projected texture. See also ProjectedTexture:SetConstantAttenuation and ProjectedTexture:SetQuadraticAttenuation. The default value of linear attenuation when the projected texture is created is 100. (others are 0, as you are not supposed to mix them) You must call ProjectedTexture:Update after using this function for it to take effect.
ProjectedTexture:SetNearZ( number nearZ )
Sets the distance at which the projected texture begins its projection. You must call ProjectedTexture:Update after using this function for it to take effect. Setting this to 0 will disable the projected texture completely! This may be useful if you want to disable a projected texture without actually removing itThis seems to affect the rendering of shadows - a higher Near Z value will have shadows begin to render closer to their casting object. Comparing a low Near Z value (like 1) with a normal one (12) or high one (1000) is the easiest way to understand this artifact
ProjectedTexture:SetNoCull( boolean enable )
Allows disabling of projected texture view-frustum culling for cases where said culling creates unwanted side effects. Disabling culling will have a negative effect on performance.
ProjectedTexture:SetOrthographic( boolean orthographic, number left, number top, number right, number bottom )
Changes the current projected texture between orthographic and perspective projection. You must call ProjectedTexture:Update after using this function for it to take effect. Shadows dont work. (For non static props and for most map brushes)
ProjectedTexture:SetPos( Vector position )
Move the Projected Texture to the specified position. You must call ProjectedTexture:Update after using this function for it to take effect.
ProjectedTexture:SetQuadraticAttenuation( number quadAtten )
Sets the quadratic attenuation of the projected texture. See also ProjectedTexture:SetLinearAttenuation and ProjectedTexture:SetConstantAttenuation. You must call ProjectedTexture:Update after using this function for it to take effect.
ProjectedTexture:SetShadowDepthBias( number bias )
Sets the shadow depth bias of the projected texture. The initial value is 0. 0001. Normal projected textures obey the value of the mat_depthbias_shadowmap ConVar. You must call ProjectedTexture:Update after using this function for it to take effect.
ProjectedTexture:SetShadowFilter( number filter )
Sets the shadow "filter size" of the projected texture. 0 is fully pixelated, higher values will blur the shadow more. The initial value is the value of r_projectedtexture_filter ConVar. You must call ProjectedTexture:Update after using this function for it to take effect.
ProjectedTexture:SetShadowSlopeScaleDepthBias( number bias )
Sets the shadow depth slope scale bias of the projected texture. The initial value is 2. Normal projected textures obey the value of the mat_slopescaledepthbias_shadowmap ConVar. You must call ProjectedTexture:Update after using this function for it to take effect.
ProjectedTexture:SetTargetEntity( Entity target = NULL )
Sets the target entity for this projected texture, meaning it will only be lighting the given entity and the world. You must call ProjectedTexture:Update after using this function for it to take effect.
ProjectedTexture:SetTexture( string texture )
Sets the texture to be projected. You must call ProjectedTexture:Update after using this function for it to take effect.
ProjectedTexture:SetTextureFrame( number frame )
For animated textures, this will choose which frame in the animation will be projected. You must call ProjectedTexture:Update after using this function for it to take effect.
ProjectedTexture:SetVerticalFOV( number vFOV )
Sets the vertical angle of projection without affecting the horizontal angle. You must call ProjectedTexture:Update after using this function for it to take effect.
ProjectedTexture:Update()
Updates the Projected Light and applies all previously set parameters. The best place to call this function is in GM:PreDrawOpaqueRenderables.