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. Replies
    4
    Views
    28

    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?
  2. Replies
    4
    Views
    28

    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)?
    ...
  3. 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,...
  4. 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...
  5. 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...
  6. 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.
  7. Use glWindowPos...

    Use glWindowPos to set the origin of the destination rectangle.
  8. 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...
  9. Replies
    16
    Views
    327

    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).
  10. 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...
  11. 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...
  12. Replies
    2
    Views
    135

    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...
  13. Replies
    1
    Views
    114

    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.
  14. 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...
  15. 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....
  16. 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...
  17. 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...
  18. 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...
  19. Thread: Includes

    by GClements
    Replies
    9
    Views
    601

    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)...
  20. Thread: Includes

    by GClements
    Replies
    9
    Views
    601

    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...
  21. Replies
    1
    Views
    203

    You're declaring the variable index inside of a...

    You're declaring the variable index inside of a block, so it doesn't exist outside of that block.

    If you check the shader's compile status with glGetShaderiv() and retrieve the info log with...
  22. Replies
    3
    Views
    214

    You need to ensure that any translation doesn't...

    You need to ensure that any translation doesn't affect the normal.

    You can either extract the upper-left 3x3 submatrix and transform the normals by that, or convert the normal from vec3 to vec4...
  23. Replies
    5
    Views
    269

    Have you tried adding a layout(r32f) qualifier to...

    Have you tried adding a layout(r32f) qualifier to the image variable? It's not required for a write-only image, but it may help (if it does, that's an implementation bug).

    Also, I've had issues...
  24. Note that GLSL's vector member access uses...

    Note that GLSL's vector member access uses s,t,p,q for the "texture" version (although you're free to use x,y,z,w or even r,g,b,a if you desire, so long as all members are drawn from the same group)....
  25. Replies
    9
    Views
    507

    Personally, I'd be inclined to do it via...

    Personally, I'd be inclined to do it via rasterisation rather than geometrically.

    Essentially the same thing as glTexGen() in GL_OBJECT_LINEAR mode, but using a shader to avoid thickening of the...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4