Template:TimeProxy: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Better application for CurrentTime proxie)
mNo edit summary
 
Line 1: Line 1:
=== Time Proxy ===
=== Time Proxy ===
For any reason, you may want to modulate time by scale it. The below [[Material proxies|material proxy]] is a simple sample to work properly.
For any reason, you may want to modulate time by scale it. The below [[Material proxies|material proxy]] is a simple sample to work properly.
{{note| you don't need to declare "CurrentTime" Proxie in cases you don't need to modify
{{note| you don't need to declare "CurrentTime" Proxie in cases where you don't need to relative modify time scale.}}
<source lang=php>
<source lang=php>
"$time" "0.0"
"$time" "0.0"
"$CurrentTime" "0.0" // declare a custom VMT Parameter to "CurrentTime" Proxie output
"$CurrentTime" "0.0" // declare a custom VMT Parameter to "CurrentTime" Proxie output
"$timeMult" "0.0"    // declare a custom VMT Parameter to use at "Multiply" Proxie
"$timeMult" "0.5"    // declare a custom VMT Parameter to use at "Multiply" Proxie


"Proxies"
"Proxies"

Latest revision as of 19:26, 28 March 2023

Time Proxy

For any reason, you may want to modulate time by scale it. The below material proxy is a simple sample to work properly.

Note.pngNote: you don't need to declare "CurrentTime" Proxie in cases where you don't need to relative modify time scale.
	"$time" "0.0"
	"$CurrentTime" "0.0" // declare a custom VMT Parameter to "CurrentTime" Proxie output
	"$timeMult" "0.5"    // declare a custom VMT Parameter to use at "Multiply" Proxie

	"Proxies"
	{
		"CurrentTime"
		{
			// It pass CurrentTime Proxie to "$CurrentTime" variable to scale materials effects such $emissiveblendscrollvector.
			"resultVar" "$CurrentTime" 
		}
		"Multiply"
		{
			"srcVar1" "$CurrentTime" // get $CurrentTime VMT parameter to multiply with srcVar2
			"srcVar2" "$timeMult"    // get $timeMult VMT parameter to multiply with srcVar1
			"resultVar" "$time"      // writes multiplication product into $time, scaling "CurrentTime" 
		}
	}