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

Search: Search took 0.00 seconds.

  1. Replies
    30
    Views
    6,647

    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...
  2. 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:
    ...
  3. 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...
  4. 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...
  5. 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?
  6. Replies
    3
    Views
    778

    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...
  7. 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; //...
  8. 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...
  9. Replies
    5
    Views
    1,070

    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...
  10. Replies
    5
    Views
    1,070

    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...
  11. Replies
    5
    Views
    1,467

    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...
  12. Replies
    5
    Views
    1,467

    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...
  13. Replies
    1
    Views
    509

    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.
    ...
  14. 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...
  15. 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...
  16. Replies
    2
    Views
    714

    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...
  17. Replies
    5
    Views
    1,007

    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...
  18. Replies
    2
    Views
    600

    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...
  19. Unfortunately, I'm not familiar with uniform...

    Unfortunately, I'm not familiar with uniform buffer objects, but I have a different approach that could work for you:

    With what I coded so far, I found out that shaders seem to have a problem with...
  20. Usually, these two lines should do the trick: ...

    Usually, these two lines should do the trick:



    glEnable(GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

    And yes, this is blending because otherwise, the white background...
  21. Two possibilities: Use negative texture...

    Two possibilities:
    Use negative texture coordinates, so 00, 01, -11, -10. For this, you have to activate the GL_REPEAT parameter, otherwise the image will be plain black as valid coordinates have...
  22. Replies
    6
    Views
    1,088

    You don't mean this, do you?...

    You don't mean this, do you?
    http://www.mariowiki.com/images/2/29/SpecialZone_SMW.png
    But seriously, you should specify your problem more clearly. And even if you cannot post URLs here, remove the...
  23. Replies
    5
    Views
    1,114

    You should be able to figure out the basic theory...

    You should be able to figure out the basic theory behind it yourself!

    I hope I interpreted your task right because otherwise, the stuff below was for nothing.

    Code untested (I only made sure it...
  24. This assignment covers way too many features to...

    This assignment covers way too many features to be addressed in a single post, and I'm sure the person who gave you the assignment provided you with a basic openGL program. I'll just give you hints...
  25. Replies
    14
    Views
    2,353

    A test image like the above one? I'm afraid it's...

    A test image like the above one? I'm afraid it's from Google ;) But there's an image for everything: Here, for example. I do have selfwritten code for such a sphere, but no project to display it atm....
Results 1 to 25 of 71
Page 1 of 3 1 2 3