材质标志
材质$flags和$flags2参数控制材质的渲染方式。
材质 $flags
和 $flags2
参数控制材质的渲染方式。 $flag
允许在渲染中实时进行更改,但是 $flags2
是只读的,可以帮助引擎或其他代码正确使用材质。 在下面的链接中可以中找到枚举https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/public/materialsystem/imaterial.h
也可以通过下面的.vmt样例设置标志:
$flags
$flags 可以包含以下标志:
Flag | Value | Comment |
MATERIAL_VAR_DEBUG | 1 | |
MATERIAL_VAR_NO_DEBUG_OVERRIDE | 2 | |
MATERIAL_VAR_NO_DRAW | 4 | |
MATERIAL_VAR_USE_IN_FILLRATE_MODE | 8 | |
MATERIAL_VAR_VERTEXCOLOR | 16 | |
MATERIAL_VAR_VERTEXALPHA | 32 | |
MATERIAL_VAR_SELFILLUM | 64 | |
MATERIAL_VAR_ADDITIVE | 128 | |
MATERIAL_VAR_ALPHATEST | 256 | |
MATERIAL_VAR_MULTIPASS | 512 | |
MATERIAL_VAR_ZNEARER | 1024 | |
MATERIAL_VAR_MODEL | 2048 | |
MATERIAL_VAR_FLAT | 4096 | |
MATERIAL_VAR_NOCULL | 8192 | |
MATERIAL_VAR_NOFOG | 16384 | |
MATERIAL_VAR_IGNOREZ | 32768 | |
MATERIAL_VAR_DECAL | 65536 | |
MATERIAL_VAR_ENVMAPSPHERE | 131072 | |
MATERIAL_VAR_NOALPHAMOD | 262144 | |
MATERIAL_VAR_ENVMAPCAMERASPACE | 524288 | |
MATERIAL_VAR_BASEALPHAENVMAPMASK | 1048576 | |
MATERIAL_VAR_TRANSLUCENT | 2097152 | |
MATERIAL_VAR_NORMALMAPALPHAENVMAPMASK | 4194304 | |
MATERIAL_VAR_NEEDS_SOFTWARE_SKINNING | 8388608 | |
MATERIAL_VAR_OPAQUETEXTURE | 16777216 | |
MATERIAL_VAR_ENVMAPMODE | 33554432 | |
MATERIAL_VAR_SUPPRESS_DECALS | 67108864 | |
MATERIAL_VAR_HALFLAMBERT | 134217728 | |
MATERIAL_VAR_WIREFRAME | 268435456 | |
MATERIAL_VAR_ALLOWALPHATOCOVERAGE | 536870912 | |
MATERIAL_VAR_IGNORE_ALPHA_MODULATION | 1073741824 |
$flags2
$flags2 可以包含以下标志:
Flag | Value | Comment |
MATERIAL_VAR2_LIGHTING_UNLIT | 0 | |
MATERIAL_VAR2_LIGHTING_VERTEX_LIT | 1 | |
MATERIAL_VAR2_LIGHTING_LIGHTMAP0 | 2 | |
MATERIAL_VAR2_LIGHTING_BUMPED_LIGHTMAP | 4 | |
MATERIAL_VAR2_LIGHTING_MASK | 7 | Sum of 3 above |
MATERIAL_VAR2_DIFFUSE_BUMPMAPPED_MODEL | 8 | |
MATERIAL_VAR2_USES_ENV_CUBEMAP | 16 | |
MATERIAL_VAR2_NEEDS_TANGENT_SPACES | 32 | |
MATERIAL_VAR2_NEEDS_SOFTWARE_LIGHTING | 64 | |
MATERIAL_VAR2_BLEND_WITH_LIGHTMAP_ALPHA | 128 | |
MATERIAL_VAR2_NEEDS_BAKED_LIGHTING_SNAPSHOTS | 256 | |
MATERIAL_VAR2_USE_FLASHLIGHT | 512 | |
MATERIAL_VAR2_USE_FIXED_FUNCTION_BAKED_LIGHTING | 1024 | |
MATERIAL_VAR2_NEEDS_FIXED_FUNCTION_FLASHLIGHT | 2048 | |
MATERIAL_VAR2_USE_EDITOR | 4096 | |
MATERIAL_VAR2_NEEDS_POWER_OF_TWO_FRAME_BUFFER_TEXTURE | 8192 | |
MATERIAL_VAR2_NEEDS_FULL_FRAME_BUFFER_TEXTURE | 16384 | |
MATERIAL_VAR2_IS_SPRITECARD | 32768 | |
MATERIAL_VAR2_USES_VERTEXID | 65536 | |
MATERIAL_VAR2_SUPPORTS_HW_SKINNING | 131072 | |
MATERIAL_VAR2_SUPPORTS_FLASHLIGHT | 262144 |
Last updated