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. The workarounds are to identify triangles which...

    The workarounds are to identify triangles which will be incorrect and discard or fix them.

    For a triangle which spans the anti-meridian, you might have e.g. one vertex at -179.9 and two at...
  2. Then either you're doing something wrong (e.g....

    Then either you're doing something wrong (e.g. enabling primitive anti-aliasing or MSAA etc) or your implementation is broken. The above invariant is required by the specification, and isn't...
  3. Replies
    5
    Views
    108

    The standard solution for that specific problem...

    The standard solution for that specific problem is instancing. The material index attribute would be per-instance, all other attributes would be per-vertex. Except that you'd probably just do away...
  4. Replies
    6
    Views
    137

    The most important thing is to get a thorough...

    The most important thing is to get a thorough understanding of the basic principles of linear algebra. You don't need the advanced stuff (eigenvectors, decomposition, etc), but you need to really...
  5. Yes. Apart from over-using the preprocessor (in...

    Yes. Apart from over-using the preprocessor (in modern C++ code, almost anything beyond #include qualifies as over-use), the stride parameter is the offset in bytes between the start of one item and...
  6. A GLSL ES 1.0 program cannot write to multiple...

    A GLSL ES 1.0 program cannot write to multiple colour buffers.

    This isn't a limitation of GLSL ES 1.0 itself, but of the various OpenGL ES versions which might use such a program.

    While the...
  7. Short answer: no. In particular, consider how you...

    Short answer: no. In particular, consider how you would need to deal with triangles which intersect the axis or the anti-meridian (i.e. those which would intersect the edges of the viewport once...
  8. The sign of 0 is zero but the sign of 0.000001 is...

    The sign of 0 is zero but the sign of 0.000001 is 1. So any rounding errors will be magnified enormously. Given that a valid shininess shouldn't be less than one, I'd suggest just using clamp() or...
  9. Replies
    6
    Views
    208

    A texture is essentially a function defined by...

    A texture is essentially a function defined by interpolation and extrapolation of gridded data.

    Given a set of texture coordinates, you get a value corresponding to those coordinates. Typically,...
  10. Replies
    5
    Views
    242

    Yes. This can happen if the bounding box or...

    Yes.

    This can happen if the bounding box or sphere are much larger than the object itself, i.e. the object is long and thin and the bounding box or sphere isn't suitably aligned (or a bounding...
  11. You can't get around the fact that the result of...

    You can't get around the fact that the result of applying a spherical projection to a triangle isn't a triangle.

    If your triangles are really small and not close to the poles, the difference may...
  12. Also, most of these changes are orthogonal. You...

    Also, most of these changes are orthogonal. You don't need to make all of them unless you need the code to work with the core profile. With the compatibility profile, you can use client-side arrays...
  13. Replies
    5
    Views
    242

    You shouldn't change the field-of-view angle, but...

    You shouldn't change the field-of-view angle, but the distance of the viewpoint from the object. The angle should be chosen according to the desired perspective. A value between 60 and 90 degrees...
  14. Correct. You'll notice that they aren't listed in...

    Correct. You'll notice that they aren't listed in the OpenGL 4 reference pages, so they don't exist in the OpenGL 3+ core profile.


    There are separate matrix stacks for the model-view and...
  15. This construct allows you to use a break or...

    This construct allows you to use a break or continue statement to jump to the end of the block. Other than that, it's the same as a bare block.

    Aside: it's also fairly common to see do-while(0)...
  16. Replies
    1
    Views
    101

    You need to figure out why the pixel colour isn't...

    You need to figure out why the pixel colour isn't being set exactly to the current colour.

    Possible reasons include lighting, blending and multi-sampling. The last one should only affect pixels...
  17. A circular buffer requires two draw calls: One...

    A circular buffer requires two draw calls: One for the range from the chronological start of the data to the end of the buffer, one from the start of the buffer to the chronological end of the data....
  18. Replies
    2
    Views
    173

    If you're only updating a single depth slice, the...

    If you're only updating a single depth slice, the depth parameter should be one.
  19. Geometry is clipped to the NDC unit cube before...

    Geometry is clipped to the NDC unit cube before rasterisation, and the bounds of the NDC unit cube are mapped to the viewport. Thus, if you take the vertices which form the clipped geometry and...
  20. Replies
    4
    Views
    285

    First, the tangent and bitangent both need to be...

    First, the tangent and bitangent both need to be perpendicular to the normal. Second, they define the interpretation of the values in the normal map, so their rotations about the normal need to be...
  21. Thread: OpenGL OOP

    by GClements
    Replies
    7
    Views
    581

    I'm thinking foremost of modelling every world...

    I'm thinking foremost of modelling every world entity as a C++ object encapsulating its own data, then as an afterthought thinking about how to map that to attribute arrays and draw calls.

    A...
  22. Replies
    5
    Views
    262

    You should ideally let OpenGL perform the...

    You should ideally let OpenGL perform the conversion.

    For reading sRGB-encoded textures (or any gamma-corrected texture, which will be much closer to sRGB than to linear), telling OpenGL that the...
  23. 1. cubeVertices contains 4 vec4's (including W)...

    1. cubeVertices contains 4 vec4's (including W) per quad. But the glVertexAttribPointer() states that it's 3 components, packed (i.e. no padding, stride=0).
    2. You have an index array, but you're...
  24. You could bind the texture as a layered...

    You could bind the texture as a layered framebuffer, and use the geometry shader to emit each primitive to the correct layer(s). But each primitive may have to be emitted for multiple layers: for...
  25. Well, you should probably change that. The...

    Well, you should probably change that.

    The transformation chain typically looks like:
    projection * view * model
    where the view transformation is the inverse of the camera transformation (i.e....
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4