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. The attribute arrays must be large enough to hold...

    The attribute arrays must be large enough to hold the data, but they can also be larger. The number of primitives drawn is determined by the "count" parameter to the draw call (glDrawArrays etc), not...
  2. Replies
    3
    Views
    265

    A cube has 8 vertices (in the mathematical sense;...

    A cube has 8 vertices (in the mathematical sense; see Alfonse' reply for the situation regarding OpenGL) and 6 faces.



    Yes.

    First, if flat-shading is enabled with glShadeModel(GL_FLAT) (for...
  3. There's nothing fundamentally wrong with...

    There's nothing fundamentally wrong with Ball:draw(), although whether it's actually correct depends upon the interpretation of the variables.

    One thing which is clearly wrong is that...
  4. The variable names are misleading, but there's...

    The variable names are misleading, but there's nothing actually wrong with it, assuming that uvs are normalised texture coordinates and c is the value from a depth texture (with range 0..1).

    If...
  5. Not quite. You're confusing memory layout...

    Not quite.

    You're confusing memory layout (row-major versus column-major) with transposition. While they may have the same effect in practice, they aren't actually the same thing. In particular,...
  6. Replies
    9
    Views
    664

    Well, it would effectively mandate floating-point...

    Well, it would effectively mandate floating-point depth buffers (the whole scheme falls apart with fixed-point). Or logarithmic depth (which is basically floating point without the mantissa).
    ...
  7. Are you trying to compile the shaders in a...

    Are you trying to compile the shaders in a different thread? If so, does that thread have a context bound to it? Does the context share data with the context used by the rendering thread?
  8. Yes. Although ideally you'd want to avoid...

    Yes. Although ideally you'd want to avoid performing the transformation for each vertex. Also, if you change the model-view matrix for each object, the light will move accordingly (i.e. the light...
  9. OpenGL doesn't have world coordinates. It has...

    OpenGL doesn't have world coordinates. It has object coordinates (the values passed via glVertexPointer etc), which are transformed by the model-view matrix to produce eye coordinates, which are...
  10. Any values you specify as uniforms or attributes...

    Any values you specify as uniforms or attributes are passed directly to the shaders without any transformation. The matrices (modelview, projection) are whatever you set them to.

    For...
  11. Replies
    26
    Views
    860

    There's all kinds of things you could do, far too...

    There's all kinds of things you could do, far too many to list really.

    The simplest is to apply some slightly non-linear transformation to either the input (i,j) or the output (r,alpha)....
  12. Replies
    3
    Views
    181

    Context management is outside the scope of...

    Context management is outside the scope of OpenGL. You need to use the platform's APIs (e.g. wgl* functions for Windows).
  13. OpenGL 2 only requires...

    OpenGL 2 only requires GL_MAX_FRAGMENT_UNIFORM_COMPONENTS to be at least 64. OpenGL 3 increases the minimum to 1024.

    So you should be safe for OpenGL 3 or later, but not for OpenGL 2.

    If you...
  14. Replies
    1
    Views
    104

    It's possible, but it's not normally how you go...

    It's possible, but it's not normally how you go about it. You don't normally start by creating each mipmap level as a separate texture. Instead, you create a single texture then upload (or render)...
  15. Replies
    26
    Views
    860

    Your texture only contains one quadrant; the...

    Your texture only contains one quadrant; the centre of the rings is at the corner of the texture.

    That isn't exactly wrong (if you buy a length of wood from a hardware store, the chances are that...
  16. 35657 = 0x8B49, which is the value of the...

    35657 = 0x8B49, which is the value of the enumeration constant GL_MAX_FRAGMENT_UNIFORM_COMPONENTS.

    That's the "key" used to query the limit, not the value of the limit. To obtain the value, you...
  17. Replies
    26
    Views
    860

    Try changing the last element of each from -1.0f...

    Try changing the last element of each from -1.0f to 0.5f or -0.5f.

    For an accurate 1:1 mapping, the scale factor and offset should be calculated from the bounding box.

    The scale factor should...
  18. I'm not sure. But you might be exceeding the...

    I'm not sure.

    But you might be exceeding the maximum number of uniform components in the default uniform block. Uniforms are optimised away if they're not used, so simply adding the declaration...
  19. Replies
    26
    Views
    860

    There's no difference between the two, other than...

    There's no difference between the two, other than the explicit array size (which doesn't affect anything). Both scale by 0.5 and translate by 0.5.

    Also: ensure that you're passing the correct...
  20. Replies
    26
    Views
    860

    The texture generation algorithm is fine (the...

    The texture generation algorithm is fine (the fact that the atan(i/j) calculation will use integer division means that alpha isn't quite what you want, but that isn't the issue here).

    The problem...
  21. Was your previous code using glClipPlane() and...

    Was your previous code using glClipPlane() and glEnable(GL_CLIP_PLANE0) etc?

    If it wasn't, then the problem has nothing to do with clipping.

    If it was, then you're correct that you need to...
  22. Replies
    2
    Views
    136

    I can't be certain, but that may be caused by...

    I can't be certain, but that may be caused by insufficient depth-buffer resolution. Try increasing the near plane distance when creating the projection matrix.
  23. If you're getting repeated copies of the texture,...

    If you're getting repeated copies of the texture, it means that a) your texture coordinates aren't limited to the range 0..1, and b) the wrapping mode is GL_REPEAT (which is the default).

    If you...
  24. Replies
    6
    Views
    202

    Such figures invariably reflect the number of...

    Such figures invariably reflect the number of primitives which the application is asking OpenGL (or DirectX) to render, which will vary based upon the applications visibility calculations and...
  25. It should be 0 rather than GL_TEXTURE0. Did...

    It should be 0 rather than GL_TEXTURE0.

    Did you bind the texture to the unit with glBindTexture()? You normally need to do this before uploading data, although it's common to unbind it afterwards.
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4