Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Search:

Type: Posts; User: GClements

Page 1 of 20 1 2 3 4

Search: Search took 0.01 seconds.

  1. My first guess is that the angle is being...

    My first guess is that the angle is being interpreted as radians rather than degrees.

    Earlier versions of GLM used degrees for some functions (typically those which mimic an OpenGL or GLU...
  2. On the other hand, switching between many...

    On the other hand, switching between many different shaders also has overhead.

    The preferred approach for performance-sensitive applications seems to be to use a few generalised shaders (i.e....
  3. Other options include using a framebuffer object...

    Other options include using a framebuffer object with a depth texture and replacing portions with glTexSubImage2D(), and using a fragment shader which writes to gl_FragDepth.
  4. No, you cannot automatically "merge" shaders. ...

    No, you cannot automatically "merge" shaders.

    Often, it's possible to "disable" an operation simply by the choice of parameters. E.g. binding a solid white texture (which need only be 1x1) has the...
  5. Replies
    6
    Views
    103

    That's not fixed. Fixed means: ...

    That's not fixed. Fixed means:


    vec3 vNormel = vec3(0,0,1);
    intensity = pow( c - dot(vNormal, vNormel), p );

    This assumes that normalMatrix is transforming into eye space,...
  6. Replies
    6
    Views
    103

    Yes. I know. Have you actually tried using a...

    Yes. I know.

    Have you actually tried using a fixed vector, or the eye-space vertex position?
  7. Replies
    6
    Views
    103

    I suspect that the problem is that your view...

    I suspect that the problem is that your view vector is in "world" space when your calculation treats it as being in object space.

    Why do you need a view vector? Why not just use vec3(0,0,-1)?
    ...
  8. Assuming that zFar is significantly greater than...

    Assuming that zFar is significantly greater than zNear, roughly half the depth range maps to -Z values between zNear and 2*zNear and the other half to values between 2*zNear and zFar. More generally,...
  9. There is no "best" way. There are enough...

    There is no "best" way. There are enough different algorithms to fill several books, and they all have strengths and weaknesses.

    If I understand your problem correctly, there are two basic...
  10. You can certainly implement that in a shader,...

    You can certainly implement that in a shader, i.e. read a single value from a source texture then use that value to retrieve a colour from a palette texture.

    If the palette is a continuous...
  11. That's what I'd expect if depth testing was...

    That's what I'd expect if depth testing was disabled and you were rendering the moon after the earth.


    I.e. rendering stars, Saturn, rings, in that order, with depth testing disabled.
  12. Use glWindowPos...

    Use glWindowPos to set the origin of the destination rectangle.
  13. If you need to scale the tiles, then you need to...

    If you need to scale the tiles, then you need to use textures. The only other options for drawing images perform a 1:1 copy.


    Ideally, use a video card with enough RAM to store the entire data...
  14. Replies
    16
    Views
    378

    Then draw the exact same polygon again (with...

    Then draw the exact same polygon again (with depth tests disabled), in whatever colour constitutes "clear" (e.g. your background colour).
  15. You don't need to use shaders to use FBOs. If...

    You don't need to use shaders to use FBOs.

    If you're on Windows, opengl32.dll only exports the symbols for the OpenGL 1.1 API. Any functions added in later versions or in extensions have to be...
  16. Do you actually need the angles? If you just need...

    Do you actually need the angles? If you just need to set the appropriate transformation, it's easier to construct the matrix directly from the two vectors and their cross-product, then use...
  17. Replies
    2
    Views
    140

    If you're using glDrawElements(), it uses a...

    If you're using glDrawElements(), it uses a single index to specify the vertex position, normal and texture coordinates. The OBJ format has a separate index for each attribute, so you either need...
  18. Replies
    1
    Views
    116

    Your init() function needs to call...

    Your init() function needs to call glMatrixMode(GL_PROJECTION) before calling gluOrtho2D(). Otherwise, it will be part of the model-view matrix, and will be cleared by the glLoadIdentity() call.
  19. It's a consequence of the projection matrix for a...

    It's a consequence of the projection matrix for a perspective projection (see gluPerspective or glFrustum) and conversion from clip coordinates to normalised device coordinates.

    The perspective...
  20. Values are converted between representations,...

    Values are converted between representations, missing components are defaulted (1 for alpha, 0 for R/G/B), excess components are discarded, out-of-range values are clamped to the representable range....
  21. You shouldn't be trying to calculate the angle....

    You shouldn't be trying to calculate the angle. Just generate the matrix directly from the vectors. Better still, just render the particles in eye-space rather than trying to generate a model matrix...
  22. Sorry, I didn't read your previous post carefully...

    Sorry, I didn't read your previous post carefully enough; you said that you were using glOrtho(), but that's only for the video.

    For a perspective projection, the relationship between Z and depth...
  23. It depends upon the scale you're using for...

    It depends upon the scale you're using for modelling.

    A point at the near plane (Z=-zNear) will have a depth of 0.0. A point at the far plane (Z=-zFar) will have a depth of 1.0. A point half-way...
  24. Thread: Includes

    by GClements
    Replies
    9
    Views
    602

    While I agree with the sentiment of Alfonse'...

    While I agree with the sentiment of Alfonse' response, the most common cause of that specific issue is telling the IDE that you're building a "GUI application" (which expects a WinMain() function)...
  25. Thread: Includes

    by GClements
    Replies
    9
    Views
    602

    1. Those aren't libraries, they're headers. You...

    1. Those aren't libraries, they're headers. You still need to link against the appropriate libraries.

    2. The "aux" library is ancient history. Even if you can find a version which works on modern...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4