Fragment shading malfunction during transformation

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm experimenting with a simple C++ plugin which draws a shaded cube using a locator node with a geometry override. The shading is done by loading a fragment XML from file.
If "Consolidate World" is enabled, and I start transforming the locator node (e.g. by translating it), the shader stops working.
After loading it looks like this (see the fragment XML below):
After starting to translate the node:
The strange thing is that if I replace the mayaChecker in the fragment XML to mayaBulge, this doesn't happen.
Some more details:
On the plugin side there is a locator node with a geometry override which builds a cube in populateGeometry, and in updateRenderItems it loads a fragment XML from file, gets an MShaderInstance from Maya and assigns it to the cube render item.
The code for the latter:
const char* frag_name = fragment_manager->addFragmentGraphFromFile("my_fragment.xml").asChar(); my_shader = shader_manager->getFragmentShader(frag_name, "outSurfaceFinal", true));
my_render_item->setShader(my_shader)
The fragment:
<fragment_graph name="TestFragment" ref="TestFragment" class="FragmentGraph" version="1.0"> <fragments> <fragment_ref name="blinn_1" ref="mayaBlinnSurface" /> <fragment_ref name="checker_1mayaTextureOutputTooutColor1" ref="mayaTextureOutputTooutColor" /> <fragment_ref name="checker_1" ref="mayaChecker" /> </fragments> <connections> <connect from="checker_1mayaTextureOutputTooutColor1.outColor" to="blinn_1.color" name="color" /> <connect from="checker_1.mayaTextureOutput" to="checker_1mayaTextureOutputTooutColor1.input" name="input" /> </connections> <properties> <float4x4 name="ViewProj" ref="blinn_1.ViewProj" semantic="viewprojection" /> <float3 name="Pw" ref="blinn_1.Pw" semantic="Pw" flags="varyingInputParam" /> <float3 name="Nw" ref="blinn_1.Nw" semantic="Nw" flags="varyingInputParam" /> <float3 name="Vw" ref="blinn_1.Vw" semantic="Vw" flags="varyingInputParam" /> <float3 name="Lw" ref="blinn_1.Lw" /> <float3 name="HLw" ref="blinn_1.HLw" /> <float3 name="diffuseI" ref="blinn_1.diffuseI" /> <float3 name="specularI" ref="blinn_1.specularI" /> <float3 name="ambientIn" ref="blinn_1.ambientIn" /> </properties> <values/> <outputs> <struct name="mayaSurfaceShaderOutput" ref="blinn_1.mayaSurfaceShaderOutput" /> </outputs> </fragment_graph>
Please advise why is this happening and what can I do about it?