lesliejaneth / opencollada

Automatically exported from code.google.com/p/opencollada
0 stars 0 forks source link

CgFX RenderStates other than generic tests come through as UNKNOWN INPUT ERROR #138

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a CgFX file that uses a renderstate eg blendfunc
2. Make a mesh that uses this CgFX file
3. export the mesh

What is the expected output? What do you see instead?

This is what I see:

          <pass sid="p0">
            <UNKNOWN INPUT ERROR value="true"/>
            <blend_equation_separate value="UNKNOWN INPUT ERROR" value="UNKNOWN INPUT ERROR"/>
            <blend_func_separate value="UNKNOWN INPUT ERROR" value="UNKNOWN INPUT ERROR" value="UNKNOWN INPUT ERROR" value="UNKNOWN INPUT ERROR"/>
            <cull_face_enable value="false"/>
            <depth_mask value="true"/>
            <depth_test_enable value="true"/>
            <depth_func value="LEQUAL"/>
          </pass>

This is the CgFX input:

    AlphaBlendEnable = true;
    BlendEquationSeparate = int2(ADD,ADD);
    BlendFuncSeparate = int4(SRCALPHA,INVSRCALPHA,ONE,ZERO);
    CullFaceEnable = false;
    DepthMask = true;
    DepthTestEnable = true;
    DepthFunc = LESSEQUAL;

What version of the product are you using? On what operating system?

openColladaMaya 64 bit, head revision, Maya 2011, Win7 64.

Please provide any additional information below.

The missing state is AlphaBlendEnable.
Looking at the code it seems like you only compare the renderstate value 
against the strings for the simple tests (used in, say, DepthFunc) and not the 
other states (used in, say, BlendFunc).

I have to ask why this information is even output since it lives in the CgFX 
file? Is there a rationale for duplicating it in the output?

Original issue reported on code.google.com by martin.b...@gmail.com on 23 Nov 2010 at 2:21

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by opencollada2@googlemail.com on 25 Jan 2011 at 1:48

GoogleCodeExporter commented 8 years ago
I'm experiencing this issue too when using BlendFunc. I've resolved just 
inserting a break when case checking for INT1,2,3,4 etc., so that the tag is 
not even opened, but this is quite serious in my opinion, since it prevents 
also basic shaders to work properly when exported. Also, the cause of the error 
isn't so clear when inspecting the file.

Original comment by daniele....@gmail.com on 21 Feb 2011 at 1:23