Implement Source Engine material proxy system #51
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Source Engine materials use a
Proxies {}block in VMT files to drive dynamic material parameters at runtime. We currently hardcode individual proxy behaviors (TextureScroll UV offsets, AnimatedTexture frame cycling) as special cases in the material resolver, which doesn't scale and doesn't correctly handle how proxies interact with shader-specific transform variables.What's needed
A general-purpose proxy evaluation system that:
Proxies {}block from VMTs, supporting multiple proxies per material and preserving proxy type + parameters$bumptransform→ UV transform matrix,$basetexturetransform→ base texture UV transformCommon proxy types to implement
$bumptransform,$basetexturetransform)$basetexture,$normalmap,$refracttinttexture, etc.)Current state
$animatedtextureframerateis parsed from VMTs and used for VTF frame cycling onbaseTextureandnormalMapuniformstexturescrollvar/texturescrollrate/texturescrollangleare parsed and applied as UV offsetsMaterialResolver, not as a proxy evaluation system$bumptransformscroll to base texture — this should be handled by the shader's transform variable mapping insteadArchitecture
The proxy system should be a separate module that:
update(time)method called each frameRelated