Template:TimeProxy: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created Time Proxy template)
 
mNo edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This shader or material parameter requires the below [[Material proxies|material proxy]] as specified to work properly.
=== 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.
{{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
"$timeMult" "0.5"    // declare a custom VMT Parameter to use at "Multiply" Proxie
"Proxies"
"Proxies"
{
{
"CurrentTime"
"CurrentTime"
{
{
"resultVar" "$time" //Needs the CurrentTime material proxy to work properly.
// 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"
}
}
}
}
</source>
</source>

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" 
		}
	}