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: nenad*

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Thread: glDrawElements

    by nenad*
    Replies
    5
    Views
    850

    If indices are in the video ram buffer the...

    If indices are in the video ram buffer the pointer parameter is interpreted as a byte offset from the index array start
  2. Replies
    10
    Views
    1,752

    Well w should be 0.0 when you're multiplying a...

    Well w should be 0.0 when you're multiplying a vector. The difference that actually made it work is, I think, the minus sign. Which makes sense since you're calculating the light direction vector as...
  3. Replies
    10
    Views
    1,752

    Yes. Yes Regular. The important...

    Yes.


    Yes

    Regular.


    The important thing is to be consistent with your coordinate spaces when doing calculations. If your camera view direction and light direction are given in world space,...
  4. GL_MINOR_VERSION and GL_MAJOR_VERSION are not...

    GL_MINOR_VERSION and GL_MAJOR_VERSION are not valid in Opengl 1.1 and for some reason your program might be calling 1.1 version of glGet*. Quick workaround would be to use glGetString(GL_VERSION)...
  5. Replies
    10
    Views
    1,752

    Multiplying halfvector and light direction with...

    Multiplying halfvector and light direction with normal matrix might be the problem. To bring these vectors to eye space you should multiply them with inverse transpose of the view matrix, not the...
  6. What do you get on screen when you run posted...

    What do you get on screen when you run posted code?
  7. Replies
    10
    Views
    1,752

    This looks like it should work fine if everything...

    This looks like it should work fine if everything is in camera space. Let's see how you calculate the normal matrix and the half vector.

    Note that if you want fixed light direction in world space,...
  8. Replies
    10
    Views
    1,752

    Make sure all the relevant vectors (i.e. light...

    Make sure all the relevant vectors (i.e. light direction, half vector and normal) are in the same coordinate space, preferably eye/camera space, and that they are normalized prior to any calculation....
  9. It depends where the data is stored and what...

    It depends where the data is stored and what gpu/driver you run on. As a rule of thumb if the data is in video ram (VBO) - it will be faster. If it's in system ram - it will be slower. And again, if...
  10. Using an array and modifying every third...

    Using an array and modifying every third coordinate is ok approach. If you need more speed you could use a vertex shader and keep the constant x/y array in a fast static read only VBO and send...
  11. Replies
    2
    Views
    631

    Your drawing code looks like it should do...

    Your drawing code looks like it should do precisely what you're expecting. The only thing i can think of is that your framebuffer pixel format doesn't have the alpha channel. Try to query the pixel...
  12. How come if the original, from your description,...

    How come if the original, from your description, is a closed 2-manifold mesh shell? Should work fine if you displace along averaged vertex normals.



    OpenGL is rendering API. Your problem is...
  13. How about this: - Duplicate the vertices and...

    How about this:

    - Duplicate the vertices and offset them along their normals. Offset distance being equal to desired shell thickness.
    - Build the new inner (or outer) shell faces by replicating...
  14. Replies
    7
    Views
    1,113

    Also, make sure that the light direction vector...

    Also, make sure that the light direction vector is normalized and that its w component is set to zero prior to multiplying it with matrices.
  15. Replies
    7
    Views
    1,113

    Using a debugger might be a good idea....

    Using a debugger might be a good idea.
    Otherwise, hard to tell at a glance without seeing the output.
  16. Replies
    7
    Views
    1,113

    Are your normals normalized?

    Are your normals normalized?
  17. Replies
    7
    Views
    1,113

    What output did you expect and what you've got...

    What output did you expect and what you've got instead?
  18. There is no position in directional light. Think...

    There is no position in directional light. Think of position and target vectors you pass to LookAt as representing the light direction vector:

    direction = target - positiont

    Shadows won't be...
  19. Replies
    5
    Views
    817

    You'd of course need to de-normalize it back to...

    You'd of course need to de-normalize it back to original range in the next shader, or even better keep all your calculations across the shaders in the normalized range.
  20. Think of light's orthographic frustum as a...

    Think of light's orthographic frustum as a bounding box that encloses all objects visible by the camera, plus objects not visible but potentially casting shadows. For the simplicity let's disregard...
  21. Replies
    11
    Views
    1,475

    BMP won't work properly either due to file header...

    BMP won't work properly either due to file header bytes being interpreted as pixel data. Depending on the header size, your channels might get shifted and colors not interpreted properly, and you'll...
  22. Since you're going the extension route shouldn't...

    Since you're going the extension route shouldn't that be:



    glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB)


    You'll of course need to check if ARB_vertex_shader extension is supported and...
  23. Replies
    5
    Views
    817

    Normalize your output data to 0-1 range.

    Normalize your output data to 0-1 range.
  24. Replies
    11
    Views
    1,475

    Well then that's your problem. You seem to be...

    Well then that's your problem. You seem to be ignoring the file header and you're assuming the pixel format is just raw interleaved RGB pixels. I'm not too familiar with the format but by skimming...
  25. Replies
    11
    Views
    1,475

    Ok. What's your texture file format?

    Ok.
    What's your texture file format?
Results 1 to 25 of 40
Page 1 of 2 1 2