MaterialX icon indicating copy to clipboard operation
MaterialX copied to clipboard

HwTimeNode hardcodes frame rate in generated code instead of using the fps uniform

Open JGamache-autodesk opened this issue 1 year ago • 0 comments

To test: connect a ND_time_float node to the base color of a standard_surface.

Looking at generated code, I see:

    float time_out = u_frame / 24.000000;

where I should instead see:

    float time_out = u_frame / time_fps;

This means changing the fps value is a topological change that requires recompiling the shader.

Is this per specification (which means there is a missing uniform="true" metadata in the fps input of the time NodeDef), or is it something that should be fixed in HwTimeNode.cpp to use shadergen.emitInput(fpsInput, context, stage); instead of shadergen.emitString(fps, stage);?

JGamache-autodesk avatar Jun 07 '24 16:06 JGamache-autodesk