• 15
• 15
• 11
• 9
• 10

Glowing Model Edges with Deferred Renderer

This topic is 2075 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

HI,
I am trying to get rid of an issue I have with "glowing" edges that has plagued my deferred renderer for a while. I have spent some time looking thru my lighting code and G Buffer Rendering Code, but can not find anything that stands out. This is what I am seeing:

Anyone have any idea where I should start looking? It definitely negatively affects the final image quality. I do use normal map and specular map sampling in my Gbuffer Shader, if that makes a difference. I can post code as well, just don't want to explode this thread with unnecessary code for my various .fx / c# code.

Note: This is using a single directional light that does not cast shadows, but does read normals/spec.

Share on other sites
This looks like you are not correcting for the half texel offset in dx9. Have a look in the dx documentation at this page:
"Directly Mapping Texels to Pixels (Direct3D 9)", it explains the problem and how to solve it (super simple, just adjust uvs by half a texel in shaders)

Share on other sites
Agreed with previous poster, my immediate thoughts are also that you aren't handling half texel offsets properly.

Share on other sites

Agreed with previous poster, my immediate thoughts are also that you aren't handling half texel offsets properly.

I am trying to handle the offset, but definitely believe when you say that this is where the problem lies . As I understand it, this is only necessary when rendering fullscreen Quads within a deferred renderer. Is this a false assumption? If this is incorrect, during which render calls should I be handling offset ie. initial GBuffer render, light passes, drawing the final quad to the screen etc.?

I will do a full audit tonight, but this is what I am doing when rendering quads:

C#:
Vector2 halfPixel = new Vector2(.5f/GBufferSize.X, .5f/GBufferSize.Y); //this is passed into the effect file

 struct VertexShaderOutput { float4 Position : POSITION0; float2 TexCoord : TEXCOORD0; }; VertexShaderOutput VertexShaderFunction(VertexShaderInput input) { VertexShaderOutput output; output.Position = float4(input.Position, 1); //align texture coordinates output.TexCoord = input.TexCoord - halfPixel; return output; }  Edited by trock