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 19 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    104

    One option is to create a 21x11 grid of blocks...

    One option is to create a 21x11 grid of blocks (i.e. large enough to fill the screen regardless of the alignment of the block grid relative to the screen) consisting of constant data, and draw it...
  2. No, the coordinates go from 0 to 800, 800 being...

    No, the coordinates go from 0 to 800, 800 being the right-hand edge of the right-most pixel. 799 would be the left-hand edge of the right-most pixel, which is one pixel in from the right-hand edge of...
  3. To minimise the number of draw calls, you want to...

    To minimise the number of draw calls, you want to be able to use multiple materials within a single mesh. Make the material ID a "flat" vertex attribute, with material properties stored in an array...
  4. Replies
    7
    Views
    846

    Another option is to create a grid which which...

    Another option is to create a grid which which just covers the screen regardless of alignment (so e.g. if you were using 16x16 tiles with a 640x400 screen, the grid would be 41x26 tiles) and set all...
  5. Replies
    12
    Views
    1,384

    How many matrices are you going to multiply in...

    How many matrices are you going to multiply in order to get the final result which is passed to the shader? As a rough guide, assume that each matrix multiply will cost you two bits of precision.
    ...
  6. Replies
    3
    Views
    1,688

    Do you want to render the intersection or...

    Do you want to render the intersection or difference between two volumes, or calculate it? If it's the former, you can use the stencil buffer (that's what it's for). If it's the latter, then you're...
  7. In both cases, the last parameter should be...

    In both cases, the last parameter should be FRAME_HEIGHT/2. The parameters are x,y,width,height, not left,bottom,right,top.
  8. One possibility: Pass the viewport parameters...

    One possibility:

    Pass the viewport parameters as a uniform. Have the vertex shader calculate the window-space coordinates of the vertex as an output (with the "noperspective" qualifier). For a...
  9. For lines, interpolation is one-dimensional, i.e....

    For lines, interpolation is one-dimensional, i.e. the attribute values are interpolated based upon the distance "along" the line segment. The distance perpendicular to the line segment has no effect...
  10. Replies
    1
    Views
    239

    Wrong. In C, you can't determine the size of...

    Wrong.

    In C, you can't determine the size of an array from a pointer. If you weren't aware of this, you should probably spend more time learning C before trying to use it.
  11. If you generated the projection matrix with...

    If you generated the projection matrix with gluPerspective, then the top and bottom edges of the screen have y/z=ħtan(fovy/2), and the left and right edges have x/z=ħaspect*tan(fovy/2).

    If you...
  12. Oops; that should have said "... won't apply any...

    Oops; that should have said "... won't apply any translation component."
  13. Replies
    4
    Views
    857

    Maybe it is for your specific use case. But in...

    Maybe it is for your specific use case. But in general, a single glBindFramebuffer() call is simpler than multiple glFramebufferTexture*D() and/or glFramebufferRenderbuffer() calls.

    In terms of...
  14. I've had similar experiences. However, you can...

    I've had similar experiences. However, you can reduce the size of the array by using glVertexAttribDivisor() so that you only need one element per instance rather than per vertex.

    My suspicion is...
  15. The main issue with GL_QUADS is that it's...

    The main issue with GL_QUADS is that it's deprecated, i.e. it doesn't exist in 3.x core profile or OpenGL ES. In practice, each quad will be split into two triangles, but it's undefined as to how...
  16. It's the position of a point on the ray relative...

    It's the position of a point on the ray relative to another point on the ray. But I disagree with its characterisation as a "position vector".

    The main issue is that it isn't a normal, and...
  17. Where is the matrix coming from? Your code is...

    Where is the matrix coming from? Your code is correct for a matrix in row-major order, but OpenGL uses column-major order.


    Why do you want to use Euler angles? If you're just trying to...
  18. No. If the order doesn't matter, then...

    No.


    If the order doesn't matter, then filling gaps with values from the end of the array is likely to be quicker than shifting everything after that point. This assumes that you're using...
  19. How so? You need 24 components (6*vec4) per...

    How so? You need 24 components (6*vec4) per light, so that's 48*vec4 for 8 lights. That's a fair chunk of the total number of uniforms, but not prohibitive. Another 8*4=32 vec4 are required for...
  20. I believe that it's possible that the fragment...

    I believe that it's possible that the fragment shader will be run even for a zero-area triangle. In fact, I think it's guaranteed to happen if GL_POLYGON_SMOOTH is enabled.

    If you want to...
  21. Replies
    5
    Views
    723

    In OpenGL 4, you can use glGetProgramBinary...

    In OpenGL 4, you can use glGetProgramBinary to retrieve the object code for a program, and glProgramBinary to create a program from object code.
  22. For an orthographic projection, it's more common...

    For an orthographic projection, it's more common to set the projection matrix based solely upon the window dimensions, and implement pan, rotate and scale(*) by modifying the model-view matrix.
    ...
  23. Thread: SSBO access

    by GClements
    Replies
    3
    Views
    567

    You can't count on an SSBO being large enough,...

    You can't count on an SSBO being large enough, even if AVGDEPTHCOMPLEXITY is only one. The minimum required value of GL_MAX_SHADER_STORAGE_BLOCK_SIZE is 224 = 16 MiB, while you require 1280*720*8*4 =...
  24. Not "will be", but "have been". Those functions...

    Not "will be", but "have been". Those functions don't exist in OpenGL 3+ core profile.


    In legacy OpenGL, the only one of those functions which is strictly necessary is glLoadMatrix(); everything...
  25. Note that GL_TEXTURE_CUBE_MAP isn't a valid...

    Note that GL_TEXTURE_CUBE_MAP isn't a valid target for glGetTexLevelParameteriv(). You have to specify an individual face (cube map arrays are valid, as are proxies). This shouldn't cause the problem...
Results 1 to 25 of 474
Page 1 of 19 1 2 3 4