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.02 seconds.

  1. Shadow samplers perform the comparison as part of...

    Shadow samplers perform the comparison as part of the lookup. For a 2D shadow sampler, you have to pass 3D coordinates; the X and Y coordinates are used to perform a lookup, the result of which is...
  2. Replies
    9
    Views
    255

    If you want performance, you should be using...

    If you want performance, you should be using glDrawArrays/glDrawElements/etc with the data in VBOs.

    Using glBegin/glEnd means half a dozen function calls per triangle. The GPU is spending 1% of...
  3. What code? In all probability, the original...

    What code? In all probability, the original glGetError() simply read, cleared and returned the graphics hardware's status flags. GL_INVALID_OPERATION means that the "invalid operation" flag was set.
  4. With PyOpenGL, you need to use texture1 =...

    With PyOpenGL, you need to use


    texture1 = glGenTextures(1)

    or


    texture1, texture2 = glGenTextures(2)
  5. Replies
    5
    Views
    141

    It just means that you aren't using OpenGL 2.0 or...

    It just means that you aren't using OpenGL 2.0 or later.

    The latest versions of FreeGLUT have two versions of the code for drawing shapes (tetrahedron, cube, etc). If the OpenGL version is prior...
  6. Yes (provided that you're using FreeGLUT or...

    Yes (provided that you're using FreeGLUT or OpenGLUT, not the original GLUT).

    But then, all state is shared between windows. So you need to set everything in the display callback. That includes...
  7. Note that FreeGLUT and OpenGLUT allow you to...

    Note that FreeGLUT and OpenGLUT allow you to control whether to create a new context with


    glutSetOption(GLUT_RENDERING_CONTEXT, GLUT_USE_CURRENT_CONTEXT);
    glutSetOption(GLUT_RENDERING_CONTEXT,...
  8. That suggests that detU is NaN. That would imply...

    That suggests that detU is NaN. That would imply that at least one element of the matrix is NaN.

    Alternatively, something elsewhere in your code may be triggering undefined behaviour, resulting in...
  9. Replies
    1
    Views
    107

    How is light getting its value? Is it a uniform...

    How is light getting its value? Is it a uniform or an attribute? In the default uniform block or a named uniform block? shared, packed or std140 layout?
  10. Replies
    11
    Views
    637

    For sorting on the GPU, either even-odd mergesort...

    For sorting on the GPU, either even-odd mergesort or bitonic sort (both are O(n*log2(n)), but bitonic sort has better locality). But that wouldn't necessarily help much; the hard part is collating...
  11. No. Repeated indices correspond to multiple...

    No. Repeated indices correspond to multiple references to a single vertex, not to multiple vertices. If an index is repeated, it's entirely possible (and very likely) that the vertex shader will only...
  12. Replies
    3
    Views
    193

    If you partition matrices into blocks, so that...

    If you partition matrices into blocks, so that you have matrices whose elements are matrices, the rules for multiplication are the same as for matrices of scalars.

    So:


    [R1 T1] * [R2 T2] =...
  13. No. The stride will be the size of a single...

    No. The stride will be the size of a single component. You will have as many attributes as components (i.e. 4 for the position, 3 for the normal, 4 for the colour, so 11 in total). If all components...
  14. Replies
    11
    Views
    637

    Edge detection in the fragment shader (or a...

    Edge detection in the fragment shader (or a compute shader) is a viable option. But that will give you a set of points in unspecified order; you'll need to organise the points into line strips, and a...
  15. Replies
    5
    Views
    187

    It depends. On the frequency of picking (on-click...

    It depends. On the frequency of picking (on-click versus on-move), the complexity of the scene, and the extent to which the rendered scene is appropriate for picking.

    Neither approach is...
  16. Replies
    1
    Views
    119

    For 1, I'd use this formulation...

    For 1, I'd use this formulation, as it doesn't introduce any unnecessary failure modes (if an edge is degenerate or two edges are parallel, then the problem is ill-defined).

    For the others: it's...
  17. If you want to draw face normals as lines, you're...

    If you want to draw face normals as lines, you're going to need an extra draw call using GL_LINES.

    You could generate the vertices for the normals from the triangle vertices using a geometry...
  18. Replies
    4
    Views
    237

    You can't avoid bleeding between images within an...

    You can't avoid bleeding between images within an atlas if you allow scale factors where the image is smaller than a pixel. You can use glTexParameter() with GL_TEXTURE_MAX_LEVEL or ...
  19. Replies
    3
    Views
    253

    You can perform lighting calculations in any...

    You can perform lighting calculations in any space, so long as


    you are consistent, i.e. all positions and directions are in the same space, and
    that space is affine to world space, i.e....
  20. Any implementation can provide an extension,...

    Any implementation can provide an extension, regardless of the base OpenGL versions it provides. An implementation providing OpenGL 4.2 doesn't need to provide the ARB_texture_storage extension as...
  21. Replies
    1
    Views
    164

    Like most optimisation problems, this revolves...

    Like most optimisation problems, this revolves around trade-offs.

    Having fewer shaders means that you can render the scene with fewer draw calls, which increases speed. But it may also mean that...
  22. There are two main approaches: 1. Fragment...

    There are two main approaches:

    1. Fragment shader with render-to-texture. You need two textures, for even and odd generations. Each step binds one texture (the source) to a texture image unit, and...
  23. Replies
    11
    Views
    637

    Yes. However, implicit derivatives aren't...

    Yes. However, implicit derivatives aren't available outside fragment shaders, so functions which depend upon them will always sample from the base mipmap level.


    The same as for any other shader....
  24. Another option is to render the grid as a...

    Another option is to render the grid as a texture-mapped quad with a mipmapped texture; the main issue is that the texture needs to be large enough to avoid getting thick lines close to the...
  25. Replies
    6
    Views
    406

    Why are you using a mixture of legacy OpenGL...

    Why are you using a mixture of legacy OpenGL matrix operations and your own matrix code?

    The coordinates passed to glRasterPos() are transformed by the model-view and projection matrices in the...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4