@@ -8,35 +8,32 @@ matproxy.Add( {
8
8
bind = function ( self , mat , ent )
9
9
10
10
local skyPaint = g_SkyPaint
11
- if ( !IsValid ( skyPaint ) ) then return end
12
-
13
- local values = skyPaint :GetNetworkVars ()
14
-
15
- mat :SetVector ( " $TOPCOLOR" , values .TopColor )
16
- mat :SetVector ( " $BOTTOMCOLOR" , values .BottomColor )
17
- mat :SetVector ( " $DUSKCOLOR" , values .DuskColor )
18
- mat :SetFloat ( " $DUSKSCALE" , values .DuskScale )
19
- mat :SetFloat ( " $DUSKINTENSITY" , values .DuskIntensity )
20
- mat :SetFloat ( " $FADEBIAS" , values .FadeBias )
21
- mat :SetFloat ( " $HDRSCALE" , values .HDRScale )
22
-
23
- mat :SetVector ( " $SUNNORMAL" , values .SunNormal )
24
- mat :SetVector ( " $SUNCOLOR" , values .SunColor )
25
- mat :SetFloat ( " $SUNSIZE" , values .SunSize )
26
-
27
- if ( values .DrawStars ) then
28
-
29
- mat :SetInt ( " $STARLAYERS" , values .StarLayers )
30
- mat :SetFloat ( " $STARSCALE" , values .StarScale )
31
- mat :SetFloat ( " $STARFADE" , values .StarFade )
32
- mat :SetFloat ( " $STARPOS" , values .StarSpeed * RealTime () )
33
- mat :SetTexture ( " $STARTEXTURE" , values .StarTexture )
11
+ if ( not IsValid ( skyPaint ) ) then return end
12
+
13
+ mat :SetVector ( " $TOPCOLOR" , skyPaint :GetDTVector ( 0 ) )
14
+ mat :SetVector ( " $BOTTOMCOLOR" , skyPaint :GetDTVector ( 1 ) )
15
+ mat :SetVector ( " $DUSKCOLOR" , skyPaint :GetDTVector ( 4 ) )
16
+ mat :SetFloat ( " $DUSKSCALE" , skyPaint :GetDTFloat ( 2 ) )
17
+ mat :SetFloat ( " $DUSKINTENSITY" , skyPaint :GetDTFloat ( 3 ) )
18
+ mat :SetFloat ( " $FADEBIAS" , skyPaint :GetDTFloat ( 0 ) )
19
+ mat :SetFloat ( " $HDRSCALE" , skyPaint :GetDTFloat ( 1 ) )
20
+
21
+ mat :SetVector ( " $SUNNORMAL" , skyPaint :GetDTVector ( 2 ) )
22
+ mat :SetVector ( " $SUNCOLOR" , skyPaint :GetDTVector ( 3 ) )
23
+ mat :SetFloat ( " $SUNSIZE" , skyPaint :GetDTFloat ( 4 ) )
24
+
25
+ if ( not skyPaint :GetDTBool ( 0 ) ) then
26
+ return mat :SetInt ( " $STARLAYERS" , 0 )
27
+ end
34
28
35
- else
29
+ mat : SetInt ( " $STARLAYERS " , skyPaint : GetDTInt ( 0 ) )
36
30
37
- mat :SetInt ( " $STARLAYERS" , 0 )
31
+ local star = skyPaint :GetDTAngle ( 0 )
32
+ mat :SetFloat ( " $STARSCALE" , star .p )
33
+ mat :SetFloat ( " $STARFADE" , star .y )
34
+ mat :SetFloat ( " $STARPOS" , star .r * RealTime () )
38
35
39
- end
36
+ mat : SetTexture ( " $STARTEXTURE " , skyPaint : GetDTString ( 0 ) )
40
37
41
38
end
42
39
} )
0 commit comments