Questions tagged [deferred-shading]

38 questions
1
vote
1 answer

Deferred shading, store position or construct it from depth

im in the middle of implementing deferred shading in an engine im working on, and now i have to make a decision on whether to use a full RGB32F texture to store positions, or reconstruct it from the depth buffer, so it s basically a RGB32F texel…
Mehdi
  • 562
  • 3
  • 14
1
vote
1 answer

Stencil buffer and deferred rendering using OpenGL and GLSL

I'm wondering one thing concerning the usage of stencil buffer in a deferred rendering context: do all the fragment shaders on screen space is used within the 'occluded' area ? Here's an example for the website…
user1364743
  • 4,293
  • 4
  • 42
  • 82
1
vote
2 answers

Using deferred rendering, getting blank output

So I'm working with Java/LibGDX and I'm trying to set up the very basics of deferred rendering, namely rendering the actual game art to one color buffer of an FBO and the corresponding normals to another color buffer of the FBO. (So essentially, I'm…
FTLRalph
  • 894
  • 8
  • 27
1
vote
0 answers

Reconstructed position from depth - How to handle precision issues?

In my deferred renderer, I've managed to successfully reconstruct my fragment position from the depth buffer.... mostly. By comparing my results to the position stored in an extra buffer, I've noticed that I'm getting a lot of popping far away…
Haydn V. Harach
  • 1,185
  • 14
  • 30
1
vote
1 answer

Bind pre rendered depth texture to fbo or to fragment shader?

In a deferred shading framework, I am using different framebufer objects to perform various render passes. In the first pass I write the DEPTH_STENCIL_ATTACHMENT for the whole scene to a texture, let's call it DepthStencilTexture. To access the…
darius
  • 817
  • 9
  • 22
1
vote
1 answer

How to use texture as depth attachment?

I have a framebuffer with multiple render targets. All of them are textures and not renderbuffers. How can I use the A component of a RGBA texture as depth attachment? I want to use the default depth test.
danijar
  • 27,743
  • 34
  • 143
  • 257
0
votes
1 answer

Opengl 3/4 : Can I bind the same buffer object to different targets

In my specific case, I'm trying to bind a vertex buffer object into a uniform buffer object. For more details, in my opaque object rendering pipeline in deferred shading, I create a G buffer then render light volumes one point light at a time using…
0
votes
2 answers

How to add countless lights in framebuffer

Following the learnopengl tutorial (https://learnopengl.com/Advanced-Lighting/Deferred-Shading) the author leaves fixed the amount of light (32 lights) as shown by the GLSL: #version 330 core out vec4 FragColor; in vec2 TexCoords; uniform…
0
votes
1 answer

Shadow mapping: project world-space pixel to light-space

I'm writing shadow mapping in deferred shading. Here is my depth map for directional light (orthogonal projection): Below is my full-screen quad shader to render pixel's depth in light view space: #version 330 in vec2 texCoord; out vec3…
0
votes
1 answer

Using gl_FragData[] from multiple shader files

I have a webgl shader set up with some shaders. I'm using multiple render targets (gl_FragData[]) In the first shader, I can output to gl_FragData[0] = vec4(..); gl_FragData[1] = vec4(..); gl_FragData[2] = vec4(..); Now with my second shader, I…
0
votes
1 answer

stencil buffer for deferred shading with open scene graph

I am trying to implement Deferred Shading according to the tutorials 35-37 on http://ogldev.atspace.co.uk/www/tutorial35/tutorial35.html with Open Scene Graph 3.4.0 Right now, I'm struggling to get the stencil pass correctly, so I simplified my code…
Tare
  • 392
  • 6
  • 20
0
votes
1 answer

OpenGL shading pipeline efficiency with FBOs

I've been working on implementing deferred shading as I want to have at least 20 lights in my scene. I was having problems making it fast enough (and still am), but then I made a change that I would have thought would make it slower, but in fact…
0
votes
2 answers

Trouble reading from one frame buffer to another

I've been attempting to implement deferred shading/rendering into my engine for a while now, however I haven't been able to actually see the final product of it. To test where the issue may lie, I've devised an experiment to see if my target FBO was…
0
votes
2 answers

Deferred Shading - Multiple Lights (OpenGL/GLSL)

I'm working on a deferred shading program and now I have to set up 50 different lights in the scene. To do so, I'm randomly generating its attributes (position, diffuse color, specular color) with this piece of code: void FBORender::BuildLights() { …
pceccon
  • 7,621
  • 21
  • 63
  • 135
0
votes
1 answer

OpenGL OGLDev SSAO Tutorial Implementation Fragment Shader yields Noise

TASK BACKGROUND I am trying to implement SSAO after OGLDev Tutorial 45, which is based on a Tutorial by John Chapman. The OGLDev Tutorial uses a highly simplified method which samples random points in a radius around the fragment position and steps…
Nikole
  • 302
  • 2
  • 17