Skip to content

Instantly share code, notes, and snippets.

@Neill3d
Last active August 29, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Neill3d/10719513 to your computer and use it in GitHub Desktop.
Save Neill3d/10719513 to your computer and use it in GitHub Desktop.
nvFX: how to get glsl program object id
int program = 0;
nvFX::IProgram *glslProgram = nullptr;
nvFX::IProgramPipeline *glslProgramPipeline = fx_pass->getExInterface()->getProgramPipeline(0);
// program pipeline means that we are using separate shader objects
if(glslProgramPipeline)
{
glslProgram = glslProgramPipeline->getShaderProgram(1); // Fragment glsl program in program pipeline !
} else {
glslProgram = fx_pass->getExInterface()->getProgram(-1); // active layer program
}
program = (glslProgram != nullptr) ? glslProgram->getProgram() : 0;
if (program > 0)
{
// here we can directly assign some values to uniforms
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment