Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

100 Neutral

About Limedark

  • Rank
  1. Limedark

    Rendering the depth buffer?

    This looks like exactly what I was thinking. However, I cannot find the proper code for it, and I fear guessing it from scratch will end in utter failure (I am not a veteran). Is there an example or perhaps even a tutorial of this exact method somewhere? However, unless you are restricted to an ancient version of OpenGL, I would recommend using an FBO (Frame Buffer Object), to render the depth buffer directly to a texture in the first place. Or even a shader, to render the z coordinate into the colour buffer, and save having to render multiple passes at all. [/quote] Partly due to my not being veteran, but also because of a long and boring story about what I'm doing (which I'll spare you), I would like to at least try without FBOs or shaders first, if there is a way?
  2. Limedark

    Rendering the depth buffer?

    The buffer copy or swap is something I've looked at, but found no syntax on. If anyone has the slightest thread on this, I'm all ears! The fog is not going to do it, since it is not just to fake the look, it's an actual depiction of distances that I need :-/ However, the basic idea miiiight have something to it, if I can find no other option...
  3. Limedark

    Rendering the depth buffer?

    I'm not using shaders. I thought that since the Z-buffer exists somewhere (I assume, or things would overlap, and my clearing the depth buffer would affect nothing), I should be able to simply(??) swap it for the color buffer. I clear the two things in the same line (glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)), so they should be using similar logic... or am I making wild assumptions?
  4. Well, the question is very simple, so I hope that the answer might also be (I am going for "glass half full" mentality): I want to see my OpenGL graphics rendered not by their color or textures, but by their z-buffer value. I.e. closer pixels are darker, distant are brighter (or vice versa if easier). Like this image from Wikipedia: http://en.wikipedia....le:Z_buffer.svg (the lower one, of course). I already have the code to draw the things I want, but it draws it in color and textures. I want to see the Z-buffer instead. What are my options?
  5. Limedark

    PBuffer Alpha

    (Edit: No worry, I found the answer. And the answer is "I'm dumb" :-P I'll see if I can delete this silly question and save face :-D ) Hello, I came to this place from Neon Helium's excellent lessons/tutorials, and if someone here can help me even a fraction of how much the NeHe page has, I will be forever grateful, and humbled :-) I am dabbling with one of the few non-NeHe sources I have located for a project of mine. It deals with PBuffers: http://www.codesampl...rc/oglsrc_7.htm (I use the version #1 code they have). I have made it work, and it works rather nicely, but a problem remains: When I use my dynamically updated texture (the one that is derived from the pbuffer), the alpha background becomes non-alpha, a flat surface using the color of the window (i.e. not the pbuffer) for background. If I reduce pbuffer glClearColor's alpha, it simply blends the two set background colors together, it does _not_ make the dynamic texture transparent :-( All other texture alphas work without any problems. It's only the dynamic texture, and I do not know why... I will spare you the entirety of my setup, but this is the basic settings for the main window: glEnable(GL_TEXTURE_2D); glShadeModel(GL_SMOOTH); glClearColor(0.5f, 0.75f, 1.0f, 0.0f); glClearDepth(1.0f); glEnable(GL_DEPTH_TEST); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glDepthFunc(GL_LEQUAL); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); ... and this is what the pbuffer works with: glEnable(GL_TEXTURE_2D); glShadeModel(GL_SMOOTH); glClearColor(1.0f, 1.0f, 1.0f, 0.4f); glClearDepth(1.0f); glEnable(GL_DEPTH_TEST); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); glDepthFunc(GL_LEQUAL); glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); I'm not skilled enough to do anything more elegant, but it has taken me pretty far, and I would love it if something or someone could let me go farther, by helping me enable dynamic texture transparency! For anything you may think, thanks in advance :-)
  6. Great, I am sure it will many happy And don't worry about the hovers, they are not a matter of life and death, the site is fantastic both with and without. But they are indeed icing on the yummy cake ;) Thank you for a marvelous site, keep up the excellent work!!!
  7. I'm a big fan, and happy to see the site is still active, considering how long these lessons have been my guiding C++ light! One thing, people who use Dev-C++ get a 404 when clicking lesson download. Seems a pesky "/data/lessons/" got pasted in between 'de' and 'vc' in the whole bunch Also, would you consider having the lesson names appear when mouseovering the list on the main page? That was a really great feature of the old site. Other than that, you guys/gals rock, bigtime ;D Limedark
  • 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!