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 5 of 5

Thread: glsl and pn_triangles

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2005
    Posts
    3

    glsl and pn_triangles

    How do I export normals from glsl vertex shader in order to make ATI_pn_triangles work? Everything looks fine using fixed pipeline but using glsl vertex shader results in some polygons missing (R9600, Catalyst 05.1). Is it a bug or It's not possible to make these two extensions to work together?

  2. #2
    Junior Member Regular Contributor
    Join Date
    Nov 2002
    Location
    Kiev, Ukraine
    Posts
    130

    Re: glsl and pn_triangles

    - pn_triangles supported in hardwsare only in ATI R2x0(which not suppor GLSL).
    - R3x0(including R9600)/R4x0 - doesn't support it(may be in software).
    Andrey Yaromenok

  3. #3
    Junior Member Newbie
    Join Date
    Jan 2005
    Posts
    3

    Re: glsl and pn_triangles

    - R3x0(including R9600)/R4x0 - doesn't support it(may be in software).

    You have to enable it via Control Panel. After that you can see ATI_pn_triangles in extensions list.

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,576

    Re: glsl and pn_triangles

    Are you asking how to tell it which attribute is a position and which ones are normals? I think the only way to do that is to actually use the position and normal attributes (and therefore glVertexPointer and glNormalPointer).

  5. #5
    Junior Member Newbie
    Join Date
    Jan 2005
    Posts
    3

    Re: glsl and pn_triangles

    I'm doing all of that. I'm passing data to OpenGL as arrays (both vertex a normals). Vertex shader (glsl) looks like that:

    varying vec3 n;
    ...
    gl_Position = ftransform();
    //gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
    n = normalize(gl_NormalMatrix * gl_Normal);
    ...

    The only problem is that some polygons inside scene are missing. Without vertex shading everything is allright.

    I've read pn_triagles and there's written:
    "
    (3) How does this extension interact with the EXT_vertex_shader and ARB_vertex_program programmable vertex shader extensions?

    RESOLVED: The PN Triangle tessellation algorithm requires the presence of both vertex position and normal. Therefore, if an application enables PN Triangle tessellation and has a programmable vertex shader enabled, that shader should export the fixed-function equivalent of position and normal. "

    I simply don't know how to export normals from vertex shader. There's no gl_OutputNormal. The spec si written agains ARB_vertex_program but there's no "result.normal" either.

    Stange thing is that I have got the same shader and same geometry rendered via DirectX + HLSL and
    it's working...

Posting Permissions

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