Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 8 of 8

Thread: Anyone seen this error before?

  1. #1
    Junior Member Regular Contributor
    Join Date
    Apr 2005
    Location
    Toronto
    Posts
    126

    Anyone seen this error before?

    I am trying to complie and link an OpenGL shader on a Nvidia Quadro 3000 (81.67 driver) and getting the following error...

    Code :
    <stdlib><9487> : error C5100: unknown semantics "FACE" specified for "gl_FrontFacing"
    The shader has the following line in it...
    Code :
    if (!gl_FrontFacing) normal = -normal;
    Now I assume the error is from this line but what does it mean "semantics "FACE""??

  2. #2
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,453

    Re: Anyone seen this error before?

    That's in a fragment shader, right?
    Sounds like the chip on that board doesn't support gl_FrontFacing.
    In that case here's a trick for a workaround by "abusing" a normally unused color varying.

    In the vertex shader add
    Code :
    gl_FrontSecondaryColor = vec4(1.0);
    gl_BackSecondaryColor  = vec4(0.0);
    In the fragment shader replace the if (!gl_FrontFacing) with
    Code :
    if (gl_SecondaryColor.r < 0.5)
    {
      normal = -normal;
    }

  3. #3
    Junior Member Regular Contributor
    Join Date
    Apr 2005
    Location
    Toronto
    Posts
    126

    Re: Anyone seen this error before?

    Sounds like the chip on that board doesn't support gl_FrontFacing
    That is the first thing that crossed my mind but its a pretty new Nvidia card and its a pretty odd error for a call thats not supported... so I thought I would ask.

    Thanks for the tip, I will give it a try.

  4. #4
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,453

    Re: Anyone seen this error before?

    >>but its a pretty new Nvidia card<<
    Not really. According to this document it's still based on the previous chip generation. http://developer.nvidia.com/object/nv_ogl2_support.html
    The workaround is mentioned in there as well.

  5. #5
    Junior Member Regular Contributor
    Join Date
    Apr 2005
    Location
    Toronto
    Posts
    126

    Re: Anyone seen this error before?

    You are correct sir... straight out of the PDF:

    The built-in fragment shader varying parameter gl_FrontFacing is supported by
    GeForce 6 Series and NV4xGL-based Quadro FX GPUs but not GeForce FX and
    NV3xGL-based Quadro FX GPUs.
    and the 3000 is indeed a NV3xGL-based Quadro card. Thanks.

  6. #6
    Junior Member Regular Contributor
    Join Date
    Apr 2005
    Location
    Toronto
    Posts
    126

    Re: Anyone seen this error before?

    Relic one more quick question, in order to get that work around to work you need to call:
    Code :
    glEnable(GL_VERTEX_PROGRAM_TWO_SIDE);
    Which from the docs I can find allows you to use gl_BackColor and gl_BackSecondaryColor in your vertex programs.

    Does it do anything else? In other words, are there any side effects I need to be watching here or special cases I need to be handling?

  7. #7
    Senior Member OpenGL Guru knackered's Avatar
    Join Date
    Aug 2001
    Location
    UK
    Posts
    2,833

    Re: Anyone seen this error before?

    Why doesn't it just pick up the two sided lighting model parameter as specified by:-
    glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 1);
    ???
    Why a new state token?
    Knackered

  8. #8
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,453

    Re: Anyone seen this error before?

    That's not "new", it's six years old. I don't know why the vertex_program specs haven't reused the light model state either.
    I think it really only enables the back color routing from vertex to fragment shader.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •