20
votes
Accepted
Performance of Compute Shaders vs. Fragment Shaders for Deferred Rendering
After more analysis, the TL;DR here is that, yes, the slowdown is due to memory locality, and yes the pixel order is to blame. More interestingly, by writing the shader differently, we can greatly ...
5
votes
Accepted
Why is this not a proper solution to handling transparency in deferred rendering?
PaulHK is right in what he said: you have to consider that there may be more than 2 transparent objects behind each other.
Also, the idea of deferred shading is to render the geometry only once to be ...
4
votes
Accepted
GBuffer: Framebuffer with different texture format types?
You have a bit of a misunderstanding there. The paragraph you quoted doesn't actually say anything about framebuffer objects yet. It just talks about a single texture. While we usually understand a ...
4
votes
Accepted
Supporting multiple camera types in a deferred renderer without specializing the shaders or in the shaders
Projective transformations (represented by 4×4 projection matrices) are invertible. You can go from NDC coordinates back to view space using the inverse of the projection matrix, in the same way that ...
4
votes
Accepted
How much precision do I need in my G-Buffer?
First of all, you don't need position in the G-buffer at all. The position of a pixel can be reconstructed from the depth buffer, knowing the camera setup and the pixel's screen-space xy position. So ...
4
votes
Accepted
Special directional light type
Alan Wolfe is pretty spot on, but I will sum up any way :)
render the back-faces of your "unit"-sized-box, [-1;1]
sample the zbuffer and transform into light-local coordinates (see our slides for a ...
2
votes
Special directional light type
I would start by looking into deferred decals (you can start here for example, this blogpost has a lot of useful links)
If you understand how the positions are calculated and compared with the volume ...
2
votes
Accepted
How to use shadow mapping and deferred rendering to create a large amount of lights?
Deferred rendering does not have an asymptic complexity of O(lights+fragments). It has a complexity of O(fragments+visibleFragments*lights).
What you are doing in deferred rendering is preventing ...
1
vote
Is fragment shader run on fragments that are outside of rasterized geometry?
Broadly speaking, the way to deal with this is to check the depth value for that position on the screen. If the value is the value you cleared the depth buffer to, then you didn't write anything to ...
1
vote
GLSL Debugging Volumetric light
This question is a bit too broad to answer, but I'll try.
Right now you have a screenshot and you are not really sure whether it's correct or not, and if it turns out it is not, it will be difficult ...
1
vote
Why is this not a proper solution to handling transparency in deferred rendering?
A fundamental assumption of deferred shading is that there will be only one surface, and therefore only one depth, at a given pixel.
An effect that contradicts that assumption will require some sort ...
1
vote
Supporting multiple camera types in a deferred renderer without specializing the shaders or in the shaders
For completeness (and in addition to Nathan Reed's answer), I explicitly add the inverse projection matrices for perspective and orthographic cameras.
Perspective Camera
$$\begin{align}
\mathrm{T}_{...
1
vote
Accepted
Volumetric Obscurance : line integrals
This is based on the formula for a sphere that expresses its surface $z$ as a function of $x, y$:
$$z(x, y) = \pm\sqrt{r^2 - x^2 - y^2}$$
So, if $x, y$ is the vector from the sphere's center to your ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
deferred-rendering × 23rendering × 4
shader × 4
opengl × 3
shading × 3
performance × 3
hlsl × 3
directx11 × 3
glsl × 2
transformations × 2
lighting × 2
rasterizer × 2
fragment-shader × 2
pixel-shader × 2
raytracing × 1
real-time × 1
perspective × 1
compute-shader × 1
shadow × 1
normal-mapping × 1
optimisation × 1
buffers × 1
frame-buffer × 1
transparency × 1
shadow-mapping × 1