Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualNoMonkey89

Posted 14 February 2013 - 06:33 AM

Ok just looking over your code compared to that in the slides... Why are you doing the following, I don't see it in the example code from the slides?

 

 

 ddx1 = -ddx2 + ddx1;

 

I tried my own approach of a derivative to see if it changes anything. I now put it back to the original code from the slides

And in regards to the following and what you asked earlier:

 

 

 + float2(texelSize, 0)

 

What this code does is sample neighbouring texels. So if you have a non-square texture then replace float2(texelSize, 0) with float2(1.0 / texSizeX, 0) and replace float2(0, texelSize) with float2(0, 1.0 / texSizeY).

Allright, I figured that out but even if I'm using not the correct texelSize i figure it's not the cause of my problem. But I will fix this now.

 

I'd also check your depth format. Check you're using a 32bit floating point target as 16bit may not be enough.

It's a 32-bit target (called Ogre::PF_FLOAT32_R)

 

I also assume you are calculating posEye as follows (cause it's not defined in your original post)

 

float3 posEye = uvToEye(texCoord, depth);

 

Yeah, it's float3 posEye = uvToEye(input.texco, depth, invProj_m); 

Dont know why it's not in my original post, It's definitively in my program blink.png 


#1NoMonkey89

Posted 14 February 2013 - 06:31 AM

Ok just looking over your code compared to that in the slides... Why are you doing the following, I don't see it in the example code from the slides?

 

 

 ddx1 = -ddx2 + ddx1;

 

I tried my own approach of a derivative to see if it changes anything. I now put it back to the original code from the slides

And in regards to the following and what you asked earlier:

 

 

 + float2(texelSize, 0)

 

What this code does is sample neighbouring texels. So if you have a non-square texture then replace float2(texelSize, 0) with float2(1.0 / texSizeX, 0) and replace float2(0, texelSize) with float2(0, 1.0 / texSizeY).

Allright, I figured that out but even if I'm using not the correct texelSize i figure it's not the cause of my problem. But I will fix this now.

 

I'd also check your depth format. Check you're using a 32bit floating point target as 16bit may not be enough.

It's a 32-bit target (called Ogre::PF_FLOAT32_R)

 

I also assume you are calculating posEye as follows (cause it's not defined in your original post)

 

float3 posEye = uvToEye(texCoord, depth);

Yeah, it's float3 posEye = uvToEye(input.texco, depth, invProj_m); 

Dont know why it's not in my original post, It's definitively in my program blink.png


PARTNERS