The name for a class of rendering technique where geometry and material properties are explicitly separated from the lighting computations. This is done by rendering the material properties of various objects into several buffers, and then using passes over those "g-buffers" to do lighting ...
7
votes
2answers
163 views
Deferred tiled shading, tile frusta calculation in OpenGL
I'm trying to do deferred tiled shading in OpenGL using the compute shader but I have hit a snag when trying to create the frustum for each tile. I'm using AMD's Forward+ demo (written in D3D) as a ...
6
votes
2answers
237 views
How many rendering passes is “normal”?
I've been implementing John Chapman's method for SSAO (an excellent tutorial by the way), and I've completed it all minus the final part: blurring it. I believe this is what the entire process should ...
1
vote
1answer
85 views
Separate shader programs or branch in shader? [duplicate]
I have a bunch of point lights and directional lights. Instead of checking the light type in the fragment shader and then branch for either point light calculation or directional light calculation, is ...
0
votes
1answer
92 views
Material properties and deferred renderering
I'm using assimp to import 3d models, and each model defines a set of material properties as well, such as material diffuseColor, ambientColor, specularColor and emissiveColor. Where would I store ...
2
votes
0answers
43 views
Blank texture in Frame Buffer Object in Deferred Rendering
I'm running the tutorial 35 from olgdev.atspace.co.uk, and it's so strange that the result is a blank screen.
This tutorial is performing the first step of Deferred Shading, which means decoupling of ...
11
votes
2answers
480 views
What are the common rendering optimization techniques for deferred shading renderer? [closed]
I have been developing a game engine using OpenGL 3 and C++ (and glfw for window management). I have advanced so far, got most of the things done except sound entities and optimizations. The engine ...
0
votes
0answers
18 views
Skip the first RenderTarget when writing to MRT with Opaque blending
I am writing to three rendertargets and whant to know how to tell a GPU not to write to the first RT. When you write a shader you can simply output less data than you have RTs (like output a single ...
1
vote
2answers
110 views
OpenGL position from depth is wrong
My engine is currently implemented using a deferred rendering technique, and today I decided to change it up a bit.
First I was storing 5 textures as so:
DEPTH24_STENCIL8 - Depth and stencil
...
4
votes
1answer
96 views
Multiple render targets: Output target format performance questions
This is probably API independent (more dependent on hardware implementation), but just in case, I'm using OpenGL.
The question is restricted to PC hardware.
I have a couple of questions concerning ...
2
votes
1answer
185 views
Shadow mapping with deffered shading for directional lights - shadow map projection problem
I'm trying to implement shadow mapping to my engine. I started with directional lights because they seemed to be the easiest one, but I was wrong :) I have implemented deferred shading and I retrieve ...
2
votes
1answer
105 views
Can Entities Have Their Own Shader In Deferred Rendering?
Since you need to use the general g-buffer shader to fill g-buffer, how can entities have their own shaders, like giving a box normal mapping feature ? As I remember, you can't use two shaders at the ...
2
votes
1answer
146 views
Skybox with deferred shading
I've looked at this technique, but it strongly sounds like he has to do some ugly hacks involving branching in his lighting shaders just to correctly draw a skybox. This seem awfully wasteful.
How ...
1
vote
1answer
77 views
D3D11 Deferred Context CommandList Reset
a rather quick question, I am starting on implementing rendering with deferred context into my game engine, and came across a heavy memory leak when recording command lists on my deferred contexts. ...
4
votes
2answers
106 views
When to apply AA as post?
I'm working with a deferred shading technique. I have diffuse, normal and depth buffers, which I combine for the final scene composition. Where and when exactly do I apply an anti-aliasing pass (such ...
2
votes
0answers
118 views
SSAO Distortion
I'm currently (attempting) to add SSAO to my engine, except it's...not really work, to say the least. I use a deferred renderer to render my scene. I have four render targets: Albedo, Light, Normal, ...
6
votes
1answer
876 views
Game Engine Design – Ubershader - Shader management design
I want to implement a flexible Ubershader system (with deferred shading). My current idea is to create shaders out of modules, which deal with certain features (FlatTexture, BumpTexture, Displacement ...
1
vote
1answer
107 views
Workaround for reading and writing same texture?
To apply post effects, it is often needed to read the preliminary image, perform computations on its pixels and store the result in the same texture again. For example, think of a tone mapping or ...
4
votes
3answers
196 views
How to skip the sky in lighting shaders?
I recently implemented a sky in my deferred rendered game. It is a procedurally calculated sphere with a texture applied to it. Unfortunately all lighting shaders (light sources, ambient occlusion) ...
2
votes
1answer
189 views
Unity3D custom camera matrix breaking shadows/lights in deferred rendering
EDIT 1:
So it seems this is a common issue with Unity, and it comes from a bug in which custom camera matrices break deferred lighting and shadows. This topic right here talks about it a bit, but the ...
2
votes
1answer
479 views
Unity3D How too write to the back buffer AFTER the final pass of deferred rendering
I've been using this script and shader from the wiki, and they work wonders; my only problem is using them in deferred rendering.
Now, the way this shader works is by writing to the depth buffer to ...
2
votes
1answer
160 views
gbuffer - how to store an integer data
In a gbuffer I store a diffuse color in following texture:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
I want to store an integer data which ...
1
vote
1answer
162 views
How to provide a fully programmable pipeline for rendering?
I am writing a game engine and I want people who use it allow to define the rendering pipeline. Just they can define the scene geometry, characters, items, light sources, and so on. So the term ...
4
votes
1answer
390 views
deferred rendering and point light radius
I use a common attenuation equation for point lights:
attenuation = 1 / kc + kl * d + kq * d^2.
I use deferred rendering so I need to know a light radius. An example light has following intensity: ...
2
votes
1answer
206 views
How to transform a shadow map to camera view?
I'm making a rendering engine as a hobby to learn more about 3D. I have a deferred renderer with the G-buffer (color, normal and depth). I also have a lighting controller that uses only spotlights at ...
9
votes
1answer
259 views
Deferred decals normal problem
I've been working on a deferred decal system. So far I have finished the projection part, meaning I can click something in the scene and it will properly project a decal onto the surface of the ...
2
votes
0answers
241 views
deferred rendering and gaussian blur - artifacts
I compute Gaussian blur in two passes (horizontally and vertically). Shaders look like this:
Horizontal blur - fragment shader:
#version 420
layout (location = 0) out vec4 outColor;
in vec2 ...
1
vote
1answer
245 views
Using two FBOs results in the second FBO having nothing drawn to [closed]
I'm writing a deferred renderer, and I use two FBOs: the first one for G-buffer (color, normal, depth) and the second one for lighting (light output), so the first one has three textures bound and the ...
2
votes
1answer
212 views
mixing forward and deferred rendering
Simplified version of my deferred rendering looks like this:
bind fbo1
clear color and depth buffers
gbuffer stage (gbuffer contains only these pixels which pass a depth test)
unbind fbo1
bind fbo2
...
0
votes
1answer
121 views
deferred rendering and a few shading functions
How to use a few shading functions together with deferred rendering (for example some objects are shaded based on a lighting equation,
other get a fixed color) ? I draw a full screen quad when ...
1
vote
0answers
134 views
Deferred Rendering: Orthographic directional light that has position
Basically I need to code a light for deferred rendering that is a cross between a spotlight and a directional (positionless) light. It's to be used for sunlight, but because my terrain has overhangs ...
3
votes
1answer
288 views
how to organize rendering
I use a deferred rendering. During g-buffer stage my rendering loop for a sponza model (obj format) looks like this:
int i = 0;
int sum = 0;
map<string, mtlItem *>::const_iterator itrEnd = ...
1
vote
2answers
223 views
Deferred rendering order?
There are some effects for which I must do multi-pass rendering. I've got the basics set up (FBO rendering etc.), but I'm trying to get my head around the most suitable setup. Here's what I'm ...
4
votes
0answers
688 views
OpenGL problem with FBO integer texture and color attachment
In my simple renderer, I have 2 FBOs one that contains diffuse, normals, instance ID and depth in that order and one that I use store the ssao result. The textures I use for the first FBO are RGB8, ...
0
votes
1answer
329 views
Ray Tracing Shadows in deferred rendering
Recently I have programmed a raytracer for fun and found it beutifully simple how shadows are created compared to a rasterizer. Now, I couldn't help but I think if it would be possible to implement ...
1
vote
1answer
503 views
Speed up lighting in deferred shading
I implemented a simple deferred shading renderer.
I use 3 G-Buffer for storing position (R32F), normal (G16R16F) and albedo (ARGB8).
I use sphere map algorithm to store normals in world space.
...
3
votes
1answer
294 views
XNA Deferred Shading, Replace BasicEffect
I have implemented deferred shading in my XNA 4.0 project, meaning that I need all objects to start out with the same shader "RenderGBuffer.fx". How can I use a custom Content Processor to:
Not load ...
1
vote
0answers
211 views
DX9 Deferred Rendering, GBuffer displays as clear color only
I'm trying to implement Catalin Zima's Deferred Renderer in a very lightweight c++ DirectX 9 app (only renders a skydome and a model), at this moment I'm trying to render the gbuffer, but I'm having a ...
4
votes
1answer
275 views
Deferred contexts and inheriting state from the immediate context
I took my first stab at using deferred contexts in DirectX 11 today. Basically, I created my deferred context using CreateDeferredContext() and then drew a simple triangle strip with it.
Early on in ...
6
votes
1answer
444 views
How do I reconstruct depth in deferred rendering using an orthographic projection?
I've been trying to get my world space position of my pixel but I'm missing something.
I'm using a orthographic view for a 2.5d game. My depth is linear and this is my code.
float3 lightPos = ...
3
votes
1answer
1k views
Deferred Rendering and Normal Mapping
I'm working on a deferred renderer and need a bit of help getting normal maps working.
What I've been doing with them so far is just multiplying the normal texture with the object normals ...
3
votes
1answer
814 views
Deferred rendering with VSM - Scaling light depth loses moments
I'm calculating my shadow term using a VSM method. This works correctly when using forward rendered lights but fails with deferred lights.
// Shadow term (1 = no shadow)
float shadow = 1;
// [Light ...
3
votes
1answer
420 views
How are lights rendered as geometry in deferred shading?
So my problem is that: At the last stage of implementing this I had problem with this sentence, " the lights in the scene are rendered as geometry". What does this mean?
Why do I store depth info for ...
6
votes
1answer
1k views
Not getting desired results with SSAO implementation
After having implemented deferred rendering, I tried my luck with a SSAO implementation using this Tutorial. Unfortunately, I'm not getting anything that looks like SSAO, you can see my result below.
...
0
votes
2answers
808 views
Could someone explain why my world reconstructed from depth position is incorrect?
I am attempting to reconstruct the world position in the fragment shader from a depth texture. I pass in the 8 frustum points in world space and interpolate them across fragments and then interpolate ...
1
vote
0answers
186 views
Batching Homogeneous Render Objects in XNA, 2D Component-Entity Engine?
I've been working on my component-entity engine for about 3 months now, and have managed to get nearly every constituent system working with little effort or compromise. My system has the following ...
8
votes
3answers
988 views
Deferred shading - how to combine multiple lights?
I'm starting out with GLSL and I've implemented simple deferred shading that outputs G-buffer with positions, normals and albedo.
I've also written a simple point light shader.
Now I draw a sphere ...
4
votes
3answers
839 views
Multiple render targets and gamma correctness in Direct3D9
Let's say in a deferred renderer when building your G-Buffer you're going to render texture color, normals, depth and whatever else to your multiple render targets at once.
Now if you want to have a ...
11
votes
2answers
994 views
Projective texture and deferred lighting
In my previous question, I asked whether it is possible to do projective texturing with deferred lighting. Now (more than half a year later) I have a problem with my implementation of the same thing. ...
4
votes
2answers
593 views
How to deal with large depth buffer values due to extreme distances
Alright, this is semi-related to my last question here
So I've got an really big coordinate system and need to handle rendering large astral bodies from extreme distances. My current approach ...
3
votes
1answer
1k views
Why can't I write to my render targets?
Alright, been working on setting up my first deferred rendering attempt using a light prepass technique in Direct3D 11.
Anywho, I've been having problems understanding and using render targets. Never ...