Jump to content
  • Advertisement
Sign in to follow this  
LevyDee

PIX Issue

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I cannot seem to find any information on this, but it seems, that every now and again(consistent with code) PIX likes to omit certain variables from the vs/ps debugger, including any register values for that variable. IE. Can't tell what is happening to a variable as you step through the shader code because it doesn't display anything for that variable. Also, it tends to jump around in the shader code and back track when stepping through, which seems unusual to me.

Anyone have any ideas? I am working on something right now where I do a comparison in my shader, but I can't tell the value of the variable I am comparing against because PIX doesn't show it.

Share this post


Link to post
Share on other sites
Advertisement
If you want to debug your shaders, you should compile them with the D3D10_SHADER_DEBUG and the D3D10_SHADER_SKIP_OPTIMIZATION flags. The compiler can (and will) strip dead code and reorder instructions, which makes it difficult to debug at the source level optimizations enabled.

Share this post


Link to post
Share on other sites
I am using dx9, and I am using the debug flag when creating the effect in my engine, is there something similiar to strip away optimizations in dx9?

Share this post


Link to post
Share on other sites
That doesn't seem to have done anything to resolve my issue.

Here is my shader just incase it will give some clues.

void psLightMap(float2 iUV : TEXCOORD0,
out float4 oColor : COLOR0)
{
//Read buffer data
float4 mapColor = tex2D(ColorMap, iUV);
float4 mapNormal = tex2D(NormalMap, iUV);
float mapDepth = tex2D(DepthMap, iUV).x;
float4 lightMapPrev = tex2D(PrevAccumulation, iUV);

//Put pixel into world position
//Convert from UV coordinates to clip space
float4 pixelWorldPosition;
pixelWorldPosition.x = (iUV.x * 2.0f) - 1.0f;
pixelWorldPosition.y = ((iUV.y * 2.0f) - 1.0f) * -1;
pixelWorldPosition.z = mapDepth;
pixelWorldPosition.w = 1.0f;
pixelWorldPosition = mul(pixelWorldPosition, cameraViewProjectionInverse);
pixelWorldPosition /= pixelWorldPosition.w;

//Get pixel position from light's view
float4 pixelLightView = mul(pixelWorldPosition, lightView);
float4 pixelLightPos = mul(pixelLightView, lightProjection);
pixelLightPos /= pixelLightPos.w;

//Convert pixel position to UV to sample shadow map
float pixelU = pixelLightPos.x / 2 + 0.5f;
float pixelV = (pixelLightPos.y / -2) + 0.5f;
float2 pixelUV = float2(pixelU, pixelV);

//Sample shadow map to get depth from light view
float lightViewDepth = tex2D(ShadowMap, pixelUV);

//Sample current value of light map
float4 lightMapValue = tex2D(PrevAccumulation, pixelUV);

//Testing color output before creating an accumulated light map buffer for deferred rendering
if(lightViewDepth <= pixelLightPos.z)
{
oColor = mapColor * 0.5;

return;
}
else
{
oColor = mapColor;

return;
}
}

Share this post


Link to post
Share on other sites
Im going to bump this thread because this issue is really bugging me, and slowing my progress down.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!