Khronos Public Bugzilla
Bug 40 - stencil_func_separate state in GLSL profile doesn't match OpenGL functionality
stencil_func_separate state in GLSL profile doesn't match OpenGL functionality
Status: NEW
Product: COLLADA
Classification: Unclassified
Component: Schema
1.4.1
All Windows
: P3 normal
: ---
Assigned To: Fabrice Robinet
COLLADA Work Group email alias
: collada-fx
Depends on:
Blocks: 259
  Show dependency treegraph
 
Reported: 2007-04-22 21:21 PDT by Markus Henschel
Modified: 2014-01-07 10:23 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Henschel 2007-04-22 21:21:16 PDT
The state "stencil_func_separate" in the schema doesn't match the parameters of the corresponding glStencilFuncSeperate function. This prevents ColladaFX from specifying different ref or mask for different faces.

void glStencilFuncSeperate(GLenum face, GLenum func, GLint ref, GLuint mask);

The state "stencil_func_separate" is:
<xs:element name="stencil_func_separate">
<xs:complexType>
<xs:sequence>
<xs:element name="front">
<xs:complexType>
<xs:attribute name="value" type="gl_func_type" use="optional" default="ALWAYS"/>
<xs:attribute name="param" type="xs:NCName" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="back">
<xs:complexType>
<xs:attribute name="value" type="gl_func_type" use="optional" default="ALWAYS"/>
<xs:attribute name="param" type="xs:NCName" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="ref">
<xs:complexType>
<xs:attribute name="value" type="xs:unsignedByte" use="optional" default="0"/>
<xs:attribute name="param" type="xs:NCName" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="mask">
<xs:complexType>
<xs:attribute name="value" type="xs:unsignedByte" use="optional" default="255"/>
<xs:attribute name="param" type="xs:NCName" use="optional"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Comment 1 Mark Barnes 2007-04-23 14:10:06 PDT
Assigned.
Comment 2 Mark Barnes 2008-05-10 19:00:14 PDT
Daniel can you comment on this one?
Comment 3 Markus Henschel 2010-02-13 18:01:40 PST
Seems like nothing has been done about this for over 2 years?!? May be the explaination wasn't clear enough? 

There is a element "stencil_func_separate" in the schema under "gl_pipeline_settings". This shoule clearly match the OpenGL function here:
http://www.opengl.org/sdk/docs/man/xhtml/glStencilFuncSeparate.xml

glStencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);

Using this function it is possible to specify "func", "ref" and "mask" for front and back facing polygons individually by calling it two times. (One time with face==GL_FRONT, second time with face==GL_BACK.)

What the schema element "stencil_func_separate" allows is setting different stencil functions for front and back facing polygons. What is not possible is setting different values for "ref" or "mask" from the opengl function. To fix this "ref" and "mask" in the schema should be moved inside the "back" and "front" elements. For example this is what the xml should look like for the "stencil_func_seperate" element.

<stencil_func_separate>
  <front>
    <func value="GREATER" />
    <ref value="100" />
    <mask value="128" />
  </front>
  <back>
    <func value="ALWAYS" />
    <ref value="150" />
    <mask value="255" />
  </back>
</stencil_func_separate>

Currently this is what the schema dictates:
<stencil_func_separate>
  <front value="GREATER" />
  <back value="ALWAYS" />
  <ref value="100" />
  <mask value="128" />
</stencil_func_separate>
Comment 4 Mark Barnes 2010-02-22 05:22:30 PST
For this fix to be backward compatible, optional child sequences need to be added to schema. Recommend patching 1.4 (and 1.5) schema and release notes as such.
Comment 5 Markus Henschel 2010-03-01 16:33:05 PST
When looking at the other states that can be set separately by face it might actually be more consistent to fix the schema to require something like this:

<stencil_func_separate>
  <face value="FRONT" />
  <func value="GREATER" />
  <ref value="100" />
  <mask value="128" />
</stencil_func_separate>
Comment 6 Jon Leech 2010-03-05 01:12:55 PST
Someone was messing with Bugzilla. Fixing fields.
Comment 7 Mark Barnes 2010-05-17 04:45:45 PDT
The work group is in the process of deciding on a schedule for schema patches for 1.4 and 1.5, as conformance work is nearly complete.