Jump to content
Posted 08 May 2011 - 08:15 AM
Posted 08 May 2011 - 10:40 AM
In that tutorial they reconstruct position from depth which is fine.
Are you sure that the sphere has the correct radius? I had this once when I used a sphere that was too small.
Posted 09 May 2011 - 04:16 AM
Posted 09 May 2011 - 01:35 PM
Posted 10 May 2011 - 01:58 AM
You must make you sphere smaller or bigger depending on the maximum light range. You should have a unit sphere (a sphere with radius 1) and then scale this sphere by the maximum light range using a scale matrix, so you end up with a matrix for a sphere which is like this:
Posted 10 May 2011 - 02:58 AM
That's because there's no connection between the range of your light and the size of your sphere.....
//surface-to-light vector float3 lightVector = lightPosition - position; //compute attenuation based on distance - linear attenuation float attenuation = saturate(1.0f - length(lightVector)/lightRadius);
Posted 10 May 2011 - 03:10 AM
Posted 10 May 2011 - 03:59 AM
Solve your attenuation function to find out what the maximum range of lit pixels is, and then make your sphere that big.
Posted 10 May 2011 - 04:44 AM
Posted 10 May 2011 - 12:13 PM
Posted 10 May 2011 - 12:42 PM
Saving the world, one semi-colon at a time.