Initial commit

This commit is contained in:
2026-03-15 14:54:49 +03:00
commit 64f8029c06
4027 changed files with 254888 additions and 0 deletions

View File

@@ -0,0 +1,39 @@
--[[---------------------------------------------------------
PlayerColor Material Proxy
Sets the clothing colour of custom made models to
ent.GetPlayerColor, a normalized vector colour.
-----------------------------------------------------------]]
local clrFallback = Vector( 62 / 255, 88 / 255, 106 / 255 )
matproxy.Add( {
name = "PlayerColor",
init = function( self, mat, values )
-- Store the name of the variable we want to set
self.ResultTo = values.resultvar
end,
bind = function( self, mat, ent )
if ( !IsValid( ent ) ) then return end
-- If entity is a ragdoll try to convert it into the player
-- ( this applies to their corpses )
if ( ent:IsRagdoll() ) then
local owner = ent:GetRagdollOwner()
if ( IsValid( owner ) ) then ent = owner end
end
-- If the target ent has a function called GetPlayerColor then use that
-- The function SHOULD return a Vector with the chosen player's colour.
if ( ent.GetPlayerColor ) then
local col = ent:GetPlayerColor()
if ( isvector( col ) ) then
mat:SetVector( self.ResultTo, col )
end
else
mat:SetVector( self.ResultTo, clrFallback )
end
end
} )

View File

@@ -0,0 +1,34 @@
local megaGravClr = Vector( 0.4, 1, 1 )
matproxy.Add( {
name = "PlayerWeaponColor",
init = function( self, mat, values )
self.ResultTo = values.resultvar
end,
bind = function( self, mat, ent )
if ( !IsValid( ent ) ) then return end
local owner = ent:GetOwner()
if ( !IsValid( owner ) or !owner:IsPlayer() ) then return end
local col = owner:GetWeaponColor()
if ( !isvector( col ) ) then return end
-- A hack for the mega gravity gun
local wep = owner:GetActiveWeapon()
if ( IsValid( wep ) && wep:GetClass() == "weapon_physcannon" && !wep:IsScripted() ) then
col = megaGravClr
end
local mul = ( 1 + math.sin( CurTime() * 5 ) ) * 0.5
mat:SetVector( self.ResultTo, col + col * mul )
end
} )

View File

@@ -0,0 +1,39 @@
matproxy.Add( {
name = "SkyPaint",
init = function( self, mat, values )
end,
bind = function( self, mat, ent )
local skyPaint = g_SkyPaint
if ( not IsValid( skyPaint ) ) then return end
mat:SetVector( "$TOPCOLOR", skyPaint:GetDTVector( 0 ) )
mat:SetVector( "$BOTTOMCOLOR", skyPaint:GetDTVector( 1 ) )
mat:SetVector( "$DUSKCOLOR", skyPaint:GetDTVector( 4 ) )
mat:SetFloat( "$DUSKSCALE", skyPaint:GetDTFloat( 2 ) )
mat:SetFloat( "$DUSKINTENSITY", skyPaint:GetDTFloat( 3 ) )
mat:SetFloat( "$FADEBIAS", skyPaint:GetDTFloat( 0 ) )
mat:SetFloat( "$HDRSCALE", skyPaint:GetDTFloat( 1 ) )
mat:SetVector( "$SUNNORMAL", skyPaint:GetDTVector( 2 ) )
mat:SetVector( "$SUNCOLOR", skyPaint:GetDTVector( 3 ) )
mat:SetFloat( "$SUNSIZE", skyPaint:GetDTFloat( 4 ) )
if ( not skyPaint:GetDTBool( 0 ) ) then
return mat:SetInt( "$STARLAYERS", 0 )
end
mat:SetInt( "$STARLAYERS", skyPaint:GetDTInt( 0 ) )
local star = skyPaint:GetDTAngle( 0 )
mat:SetFloat( "$STARSCALE", star.p )
mat:SetFloat( "$STARFADE", star.y )
mat:SetFloat( "$STARPOS", star.r * RealTime() )
mat:SetTexture( "$STARTEXTURE", skyPaint:GetDTString( 0 ) )
end
} )