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: Brokenmind

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. All this fuss about world space, view space and...

    All this fuss about world space, view space and object space and model matrix and view matrix and projection matrix and modelview matrix and modelviewprojection matrix .... for beginners, it's all...
  2. I think I solved your problem, but it's a...

    I think I solved your problem, but it's a combination of quite a few different small problems. I changed the display a little bit to remove the textures and to get a better view of the light angle,...
  3. Replies
    1
    Views
    456

    Hey, some thoughts, from my understanding...

    Hey,

    some thoughts, from my understanding (might be wrong):

    I think I know how you feel (ok let's face it, people who frequent here are likely to outright LOVE openGL ;) ). I'd have tried the...
  4. Problem solved!

    Assumptions can be so wrong... looks like I didn't see the error before. The pixel retrieval worked all along :doh:
    Converting RGB data to a proper Bitmap (without SetPixel!) is a bit tricky, but if...
  5. Why not just define a member variable that saves...

    Why not just define a member variable that saves the angle, and increment/decrement the angle on left/right press? Then either in the OnKeyDown (you might need a thread for continuous update) or in...
  6. I'm quite sure because the top screenshot was...

    I'm quite sure because the top screenshot was taken directly from the openGL window.. so I reckon it has to be right, right? Vertex shader looks like this


    #version 330

    layout(location = 0) in...
  7. glGetTexImage yields slanted image with wrong content (no GL_(UN)PACK_ALIGNMENT!)

    Hey guys,

    render to texture, awesome. Beautiful stuff can be made with some Perlin Noise. Imagine a metal cube with a procedural texture:
    ...
  8. Replies
    30
    Views
    17,215

    Save your height vertices in a height map Save...

    Save your height vertices in a height map
    Save a terrain block (chunk) as a VBO (preferrably much smaller than yours, 32x32 has proven to be good)
    Write a drawing function: Define what to draw...
  9. There's one specific function you need to modify....

    There's one specific function you need to modify. Here is a similar problem with an answer that points in the right direction.
    Anyway, this function is the key:
    ...
  10. The solution is: instancing. Assuming your...

    The solution is: instancing. Assuming your triangle count is very large, there's no wonder your drawing routine is slow.

    This might help your understand:


    void glDrawElementsInstanced(GLenum...
  11. The certainly fastest way would be drawing your...

    The certainly fastest way would be drawing your texture via openGL onto another texture of a different size (renderToTexture) which you can then read from the graphics memory. Only disadvantage would...
  12. 1) Do you need to save the image in every frame,...

    1) Do you need to save the image in every frame, or do you simply need to display it?
    2) How would you like to resize it, pixelated or interpolated?
  13. Replies
    3
    Views
    1,638

    This sounds like you draw over the old pixel...

    This sounds like you draw over the old pixel after you move them, which is the same coordinate as the new pixel. The flickering you see might have the same origin, so you should test whether you...
  14. Replies
    2
    Views
    1,291

    The fragment shader would look like the following...

    The fragment shader would look like the following (though untested):



    #version 330

    uniform sampler1D heightGradient; // gradient texture with colour transition

    uniform float heightMin; //...
  15. What in god's name is that matrix? I won't...

    What in god's name is that matrix?

    I won't give you the exact commands, but rather tell you what you need to do to solve your problem:

    Define the circle's center as two floats
    Move these...
  16. Replies
    5
    Views
    2,388

    Do you simply want to draw your horse no matter...

    Do you simply want to draw your horse no matter what (as a picture), or do you explicitly want to convert it into lines and draw them afterwards? I'm afraid the latter is no easy task and I have no...
  17. Replies
    5
    Views
    2,388

    The general syntax is: glBegin(GL_LINES) or...

    The general syntax is:

    glBegin(GL_LINES) or (GL_LINE_STRIP) or (GL_LINE_LOOP);
    glVertex2f(x, y) or glVertex3f(x, y,z);
    ...
    glEnd();
    You can look for what best suits your needs here (look at...
  18. Replies
    5
    Views
    5,076

    You're right, I forgot to mention that each of...

    You're right, I forgot to mention that each of the tests that was done with the triangle edges and the quad must also be done with the quad edges and the triangle.

    The intersection would be a...
  19. Replies
    5
    Views
    5,076

    First, you need to better define what you need....

    First, you need to better define what you need. The intersection of a triangle and a bounding box rarely has only one point; most of the times, its an edge.

    In case you do this without predefined...
  20. Replies
    1
    Views
    2,020

    The modelviewprojected vector needs to have its w...

    The modelviewprojected vector needs to have its w set to 1. After a projection, this w is usually something different, as well as the xyz part, and dividing this by w sort of normalises the vector.
    ...
  21. As for the last question, it has an easy answer:...

    As for the last question, it has an easy answer:
    You assign the function's return value to an unsigned int, which doesn't have a sign (duh). It isn't returning (int)-1 but (uint)4294967295, which is...
  22. You might get a much faster solution to your...

    You might get a much faster solution to your problem if you could post the relevant code snippets here, searching through over 1000 LOC is a little tedious :) and you might have as well made a typo...
  23. Replies
    2
    Views
    1,506

    I assume that most elements in your game are...

    I assume that most elements in your game are static, so they don't (or hardly) change at all. The general procedure would be this:
    Assign data to them space-efficiently, so if you have 10000...
  24. Replies
    5
    Views
    1,988

    A bit of search resulted in this...

    A bit of search resulted in this and this posting. Although they're both for iphone, the functions they use also exist in the normal openGL, namely glBlendEquation and glBlendEquationSeparate. You...
  25. Replies
    2
    Views
    1,476

    You have one mistake there: The matrix does not...

    You have one mistake there: The matrix does not take the target point, but the target direction. So your target vector need actually be (0, -500, 0)^T.
    If you try to look with the front direction of...
Results 1 to 25 of 78
Page 1 of 4 1 2 3 4