Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#Actualtrock

Posted 18 July 2012 - 04:00 PM

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 Posted Image. 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

HLSL (Vertex Shader):
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;
}

#2trock

Posted 18 July 2012 - 03:57 PM

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?

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

HLSL (Vertex Shader):
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;
}

#1trock

Posted 18 July 2012 - 03:56 PM

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


I am definitely trying to handle them, but definitely believe when you say that 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?

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

HLSL (Vertex Shader):
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;
}

PARTNERS