Jump to content

  • Log In with Google      Sign In   
  • Create Account

TheChubu

Member Since 13 Sep 2012
Offline Last Active Today, 12:21 AM

Topics I've Started

Some of you (students) might be interested in this...

08 October 2014 - 08:13 PM

https://education.github.com/pack

 

 

Seems interesting.


Deferred omni/point light issues

19 September 2014 - 03:33 AM

Hi! I'm having very annoying issues trying to implement omni lights (ie, point lights).

 

Here is a pic of the issue http://imgur.com/NSbIS77

 

As you can see, there are a bunch of textured meshes, with an omni directional light in the center. For some reason, only the sides facing down get lit, which makes sense for meshes that are above of the light, but not for meshes that are under it (ie, from the camera's view, those meshes should remain dark).

 

This is my vertex shader 

 

This is my fragment shader 

 

Position reconstruction works since its what I use in directional lighting, which works for all directions from what I've tested.

 

For rendering the point lights I use the two step process detailed in this article Killzone 2 Deferred Rendering Extended Notes, ie, geometry only draw with GEQUAL depth test and mark pixels in front of the volume with the stencil mask. Then another pass with the full shader I posted with depth test LEQUAL on the marked pixels.

 

I use bilinear interpolation to get the view ray to reconstruct the position as described in this site derschmale.com - Reconstructing position from depth, then again, I've been using it for directional lighting without issues, albeit without the bilinear interpolation since I just draw a fullscreen quad and use the built in interpolators for the corners. I tried doing the same bilinear interpolation on the directional light to test it if I got it wrong and it works just fine too.

 

For anything else you might need to know, just ask.

 


OpenGL 4.5 spec is out

11 August 2014 - 11:31 AM

You can grab it from http://www.opengl.org/registry/

 

Khronos Next Generation OpenGL Initiative thread http://www.gamedev.net/topic/659754-next-generation-opengl/


Display draw/vsync flickering

04 August 2014 - 05:12 PM

Hi! I'm having some weird display sync/fbo clear issues right now, have a look:

 

Attached File  bug-opengl.jpg   92.66KB   5 downloads

 

As you see there is this weird band in the middle of the screen. This is actually a recreation since I can't take a picture of the bug (it doesn't shows if I make a screenshot), but it looks just like that.

 

It actually flickers when in movement, gets worse if the framerate isn't 60 fps (ie, well above 60fps gets me a blank screen, below 60fps gets flickering incrementally).

 

It seems the band follows the line of the fullscreen quad I do for the (deferred) light pass. For now I just have a geometry pass and then a fullscreen directional light pass. Nothing fancy.

 

Flickering patterns change if I set it to fullscreen or windowed, but it's always present in one way or the other.

 

My current gbuffer setup is:

 

albedo: GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE (texture)

normals: GL_RG16F, GL_RG, GL_HALF_FLOAT (texture)

view-space depth: GL_R32F, GL_RED, GL_FLOAT (texture)

depth-stencil: GL_DEPTH24_STENCIL8 (renderbuffer).

 

I draw stuff to the gbuffer, then blit the depth data to the default framebuffer, then do the light pass writing light + albedo to the default buffer (fullscreen quad in the far plane, GL_GREATER depth test, so not to lit the background) while sampling from the gbuffer.

 

Before drawing to the gbuffer I clear depth, color and stencil. Before drawing to the default buffer (light pass), I clear color only (depth is blit from gbuffer and preserved).

 

I might not be clearing the proper color attachments in the gbuffer, I'm not sure, I have to check.

 

I've tried with swapBufferInterval 1, 0 and -1. With and without LWJGL's "Display.sync" call (it basically sleeps CPU to synchronize). swapBuffers is called only once after rendering. The actual calls made are:

renderer.render(); // Draw all.
displayContext.swapBuffers(); // Swap buffers.
displayContext.sync(); // Do LWJGL's Display.sync() call if configured to do so.

I guess that's all the relevant information, if you need more just ask.


Editor ate half of my journal entry

30 June 2014 - 08:40 PM

There I was, writing, editing, when It happened... I hit "save draft" button, and saw what was left of my entry. It ate half of it, maybe more.

 

I am not pleased. I am the opposite of pleased actually, to put it mildly. Where do I ask for 2 hours of my life back?


PARTNERS