Jump to content
  • Advertisement

mod42

Member
  • Content Count

    30
  • Joined

  • Last visited

Community Reputation

134 Neutral

About mod42

  • Rank
    Member
  1. mod42

    Terrain LOD in OpenGL

    maybe you could make some sort of circular mesh (a couple of concentric triangle strips) and stretch it dependen on the xz-distance to the viewer outwords. So you have a highly detailed mesh around the viewer and a lower detailed mesh in the distance. I never tried that and it will need a vertex program but maybe its worth a try. mod42
  2. mod42

    Terrain LOD in OpenGL

    Hi if I understand your question right you should take a look into glDrawElements(); You create a couple of indiece arrays into the same vertex array and select the LOD with the selection of the indiece array. mod42
  3. Hi What is the return value of a shadow2D function? The GLSL specification says (and the nVidia compiler agrees with that) it is a vec4 and it does a depth comparisson. But this didnt fit together. If shadow2D does a shadow comparison it should return a boolean value or a single float but not a vec4. My shadow mapping test application works when fetching the x-component of the result of the shadow function and comparing it to the depth of the current fragment but I want to know whats behind this special shadow access function. regards, mod42
  4. mod42

    texture map points?

    Hi Yes, thats possible. Take a look at GL_POINT_SPRITE. They are core since GL 2.0. If your OpenGL implementation is 1.5 or even lower you have to use ARB_point_sprite for this purpose. mod42
  5. mod42

    fbo crashing

    Hi I cant second this. FBO works fine here on GF6600GT even when switching the draw buffer and color attachments multiple times a frame. mod42
  6. Hi I dont know any direct way to do this (besides on some self written shader container object which handles that for you) in any other way then using a GL state for that purpose. mod42
  7. Hi I think you have to supply some more information. The only problem I can think of is that you are trying to attach/create a buffer with a pixel format that is not available as a render target with nVidia cards. What is the result of glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)? mod42
  8. Hi you can use the Z-Buffer for this purpose. Simply assign a Z-value to every of your images (I think you draw them as a texture on a quad) and use this Z-value when drawing the quad. Would be very simple with OpenGL and a orthographic projection. The only problem you will see are half-transparent object which you have to draw from back to front with T-Test disabled. mod42
  9. mod42

    orange book shader hell

    Hi I think the Orange book is quite clear and very well written. But anyway, here we go. 1) You have programm objects. Every program object can have a vertex shader and/or a fragement shader attached to it. If you want to use such a program object (and therefor the attached shader(s)) you have to call glUseProgram() with the handle to your program object. 2) I write my shaders in a text editor (UltraEdit to get some syntax highlighting), store them in *.vert and *.frag files and load them at program startup into a C++ object. My shader abstraction class then uses this object to hand over the source to OpenGLs glShaderSource() 3) As I wrote under 2 I load them from a file and store the single lines in char *ers and all of them in a char** 4) After loading them from file I hand it over to OpenGL, compile and link them. I have also added some basic functions to reload the shader from the source file to change them at runtime of the application (simplifies the development a bit) 5) Enable your shaders, render the objects, disable shaders and go on with the fixed function pipeline. 6) As above. Enable you metallic shader, draw all airplanes, enable your house shader, draw all houses and so on. You should set up your modelview-matrix to get the right rotations and translations (that is what your glRotate, glTranslate actually does) and in your shader you only write gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; or better gl_Position = ftransform(); which does the same as the above statement but keeps position invariant when rendering with fixed function and shader pipeline in the same frame. Hope this helps. mod42
  10. mod42

    what language for shaders?

    But Cg could only be used on nVidia Hardware. Or is it possible to use Cg programs on ATI chips too? mod42
  11. Hi what is reported by glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)?
  12. Hi you could store the map as a index list into your vertex array (precomputed when designing the level) and draw it as a line strip or multiple line strips with a appropriate orthographic matrix and disabled z-buffer.
  13. Hi you have to take care about the return value of glutCreateWindow() and use glutSetWindow() to identify on which window you are doing operations. This http://www.opengl.org/resources/libraries/glut/spec3/spec3.html is very useful when using glut. mod42
  14. mod42

    Shaders + fog

    Do you pass fog coordiantes from your OpenGL application? If not and you want to have the standard distance fog you should not write gl_FogCoord to gl_FogFragCoord but the distance from the eye to the current vertex. mod42
  15. mod42

    BitmapToTexture function

    Hi I implemented a simple BMP loader (only grayscale or RGB and no compression) by my self only using fopen(), fread() and fclose(). If you are intrested I can send it to you but it depends on a little bit of declarations within my environment so you cant use it out of the box. But why not using some other file format? I am always using PNG now. To load it I use the excellent libpng which is cross platform and virtually everywhere available. mod42
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!