PDA

View Full Version : cannot locate suitable resource to bind parameter



Ehsan Kamrani
05-11-2014, 03:59 AM
Hi,
I'm implementing deferred lighting. My models contain several texture layers including:
Diffuse
Alpha Map
Gloss Map
Specular Map
Dirt Map
Shadow Map

So I should render these layers to 8 color buffers using FBO:
Position
Normal
Diffuse
Normal Map
Alpha Map
Specular Map
Dirt Map
Shadow Map

I also need to output the scene to another buffer. So I need 9 out qualifiers.
My old graphics card (Geforce 9600) supports 8 out qualifiers. So if I try to output another out qualifier, I get this error:

error C5041: cannot locate suitable resource to bind parameter "myVec48"

How can I solve this problem?
Bests

Ehsan Kamrani
05-11-2014, 04:28 AM
Well looks like I can use one draw buffer to render all of the textures. Am I correct? For example:
myVec43 = vec4((diffuseColor.xyz + GlossColor.xyz ) * 0.5, 0.0);
In order to blend diffuse and gloss colors.

Agent D
05-11-2014, 06:09 AM
First of all, you don't need to write a position buffer. You can restore the view space position from the fragment xy position and the value from the depth buffer.

Second of all, what is the difference between "normal" and "normal map"? Normal mapped materials can simply write the perturbed normal to the G-Buffer instead.

Third, you don't use a shadow map for your G-Buffer pass. One big advantage of deferred lighing is the fact that objects don't need to know anything about light or
shadow caclulations. During the light pass you can generate a shadow map for the light you are currently rendering and use that. No need for per-light shadow maps
during the G-Buffer pass.