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 31 July 2012 - 10:28 AM

Alright, so it looks like my shaders are not properly downscaling the render target target that contains the luminance data. Everything seems correct until I get to the final single pixel target. At that point, I am (seemingly) only getting a 1 pixel sample from my previous/larger RenderTarget (not totally sure which pixel it is pulling though).

It's odd, because they all scale down just fine, and I can see in my luminance chain render targets that they are showing light where my screen is lit (albeit in mega-low resolution).

I have to figure out why my final downscale shader is not properly sampling each pixel it needs to before it outputs the current frame's luminance. Below is my scaling shader code. Note that this function should be taking in 5 samples total as a sort of manual linear filter (see below)

float4 vColor = 0;
for (int x = 0; x < 4; x++)
{
  for (int y = 0; y < 4; y++)
  {
   float2 vOffset;
   vOffset = float2(g_vOffsets[x], g_vOffsets[y]) / g_vSourceDimensions;
   float4 vSample = tex2D(PointSampler0, in_vTexCoord + vOffset);
   if (bEncodeLogLuv)
	vSample = float4(LogLuvDecode(vSample), 1.0f);
   vColor += vSample;
  }
}
vColor /= 16.0f;

if (bEncodeLogLuv)
  vColor = LogLuvEncode(vColor.rgb);

if (bDecodeLuminance)
  vColor = float4(exp(vColor.r), 1.0f, 1.0f, 1.0f);

return vColor;

#1trock

Posted 31 July 2012 - 02:46 AM

Alright, so it looks like my shaders are no properly downscaling the render target target that contains the luminance data. Everything seems correct until I get to the final single pixel target. At this point, I am seeming only getting a 1 pixel sample from my previous/larger RenderTarget.

It's odd, because they all scale down just fine, and I can see in my luminance chain render targets that they are showing light where my screen is lit (albeit in mega-low resolution).

At this point I have to figure out why my final downscale shader is not properly sampling each pixel it needs to before it outputs the current frame's luminance. Below is my scaling shader code. Note that this function should be taking in 5 samples total as a sort of manual linear filter (see below)

float4 vColor = 0;
for (int x = 0; x < 4; x++)
{
  for (int y = 0; y < 4; y++)
  {
   float2 vOffset;
   vOffset = float2(g_vOffsets[x], g_vOffsets[y]) / g_vSourceDimensions;
   float4 vSample = tex2D(PointSampler0, in_vTexCoord + vOffset);
   if (bEncodeLogLuv)
    vSample = float4(LogLuvDecode(vSample), 1.0f);
   vColor += vSample;
  }
}
vColor /= 16.0f;

if (bEncodeLogLuv)
  vColor = LogLuvEncode(vColor.rgb);
 
if (bDecodeLuminance)
  vColor = float4(exp(vColor.r), 1.0f, 1.0f, 1.0f);

return vColor;

PARTNERS