Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualTiagoCosta

Posted 27 July 2012 - 10:21 AM

It's easy (I think Posted Image ):

-Render the scene to a render target.
-In post processing:
Chose 2 random texture offsets (small values) that will be used as offsets to sample the scene texture.
Draw a fullscreen quad and sample the scene texture 3 times:
1 - using no offsets;
2 - using the first texture offset.
3- using the second texture offset.
Ouput the pixel color like this:
return float4(sample1.r, sample2.g, sample3.b, 1.0f);

I think this should work.

Texture2D sceneTexture;

SamplerState triLinearSampler;

float4 PS(PSInput pIn) : SV_TARGET
{
	 float4 sample1 = sceneTexture.Sample(triLinearSampler, pIn.texC, int2(0, 0));
	 float4 sample2 = sceneTexture.Sample(triLinearSampler, pIn.texC, int2(-5, 0));
	 float4 sample3 = sceneTexture.Sample(triLinearSampler, pIn.texC, int2(5, 0));

	 return float4(sample1.r, sample2.g, sample3.b, 1.0f);
}

#3TiagoCosta

Posted 27 July 2012 - 10:20 AM

It's easy (I think Posted Image ):

-Render the scene to a render target.
-In post processing:
Chose 2 random texture offsets (small values) that will be used as offsets to sample the scene texture.
Draw a fullscreen quad and sample the scene texture 3 times:
1 - using no offsets;
2 - using the first texture offset.
3- using the second texture offset.
Ouput the pixel color like this:
return float4(sample1.r, sample2.g, sample3.b, 1.0f);

I think this should work.

Texture2D sceneTexture;

SamplerState triLinearSampler;

float4 PS(PSInput pIn) : SV_TARGET
{
	 float4 sample1 = sceneTexture.Sample(triLinearSampler, pIn.texC, int2(0, 0);
	 float4 sample2 = sceneTexture.Sample(triLinearSampler, pIn.texC, int2(-5, 0);
	 float4 sample3 = sceneTexture.Sample(triLinearSampler, pIn.texC, int2(5, 0);

	 return float4(sample1.r, sample2.g, sample3.b, 1.0f);
}

#2TiagoCosta

Posted 27 July 2012 - 10:18 AM

It's easy (I think Posted Image ):

-Render the scene to a render target.
-In post processing:
Chose 2 random texture offsets (small values) that will be used as offsets to sample the scene texture.
Draw a fullscreen quad and sample the scene texture 3 times:
1 - using no offsets;
2 - using the first texture offset.
3- using the second texture offset.
Ouput the pixel color like this:
return float4(sample1.r, sample2.g, sample3.b, 1.0f);

I think this should work.

Texture2D sceneTexture;

SamplerState triLinearSampler;

float4 PS(PSInput pIn) : SV_TARGET
{
     float4 sample1 = sceneTexture.Sample(triLinearSampler, pIn.texC, int2(0, 0);
     float4 sample1 = sceneTexture.Sample(triLinearSampler, pIn.texC, int2(-5, 0);
	 float4 sample1 = sceneTexture.Sample(triLinearSampler, pIn.texC, int2(5, 0);

	 return float4(sample1.r, sample2.g, sample3.b, 1.0f);
}

#1TiagoCosta

Posted 27 July 2012 - 10:15 AM

It's easy (I think Posted Image ):

-Render the scene to a render target.
-In post processing:
Chose 2 random texture offsets (small values) that will be used as offsets to sample the scene texture.
Draw a fullscreen quad and sample the scene texture 3 times:
1 - using no offsets;
2 - using the first texture offset.
3- using the second texture offset.
Ouput the pixel color like this:
return float4(sample1.r, sample2.g, sample3.b, 1.0f);

I think this should work.

PARTNERS