Last active
August 29, 2015 14:25
-
-
Save gyakoo/4c0f83001efbdbc0c517 to your computer and use it in GitHub Desktop.
Set Surface shader parameter (all constant buffers) in Havok Anarchy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set a parameter value for a specific surface. | |
// It will set all parameters in all passes for all shader stages (vs, ps ...) of the surface technique | |
void SetSurfaceParameter(VisSurface_cl& surf, const char* param, const char* value) | |
{ | |
VCompiledTechnique* technique = surf.GetTechnique(); | |
if ( !technique ) | |
return; | |
int count = technique->GetShaderCount(); | |
for ( int s = 0; s < count; ++ s ) | |
{ | |
VCompiledShaderPass* pass = technique->GetShader(s); | |
if ( ! pass ) continue; | |
pass->UpdateShaderParam(param, value); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment