Results 1 to 2 of 2

Thread: Assigning a face value

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2011
    Location
    Girona, Catalonia
    Posts
    17

    Assigning a face value

    Hi guys,

    I would like to have an identifier in every face to know wich one is into the fragment shader. I've tried to use gl_PrimitiveID but I get values like 10602496 or 11106432 and I only have 3968 faces.
    I only use vertex and fragment shader. Should I use geometry shader to use gl_PrimitiveID? Which is the best way to assign a face value withou duplication of vertices?

    Thx

  2. #2
    Junior Member Newbie
    Join Date
    Feb 2011
    Location
    Girona, Catalonia
    Posts
    17

    Re: Assigning a face value

    I've solved the problem. It was in other part.
    It's not necessary to use a geometry shader to use gl_PrimitiveID. You only have to initialize the gl_PrimitiveID if you use a non-default geometry shader.

Similar Threads

  1. changing back face to front face in vertex shader
    By hoschie211 in forum OpenGL: GLSL
    Replies: 1
    Last Post: 11-03-2009, 12:36 AM
  2. opengl gml per face normal and per face vertex question
    By GaMEFRo in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 11-06-2006, 10:49 AM
  3. Assigning Sampler*s
    By Twixn in forum OpenGL: GLSL
    Replies: 3
    Last Post: 11-26-2004, 04:40 PM
  4. assigning an int to a float
    By geohoffman49431 in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 07-21-2004, 04:28 AM
  5. Assigning pointers
    By David in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 03-06-2000, 06:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean