Jump to content

  • Log In with Google      Sign In   
  • Create Account

enigmagame

Member Since 09 Oct 2007
Offline Last Active Oct 25 2012 08:26 AM

Posts I've Made

In Topic: How to reproduce the 3ds Max Gradient Ramp effect?

07 August 2012 - 09:14 AM

Nik02 thanks for the hint, you're absolutely right: thinking on the texture maps has completely moved my focus on the problem.
I've just tried with two control points and the result is correct.

Just another question: I've ramps with four, five or six control points, what is the best way to interpolate these control points and achieve a correct result? Bézier curve?
Thanks.

In Topic: Deferred Shading: point light and bounding volume

10 May 2011 - 12:13 PM

Ok guys, I've found the problem, and it was a very, very, very stupid problem: the size of the sphere mesh.
I was convinced, very convinced, that the size was 1, but I was wrong. Posted ImagePosted ImagePosted Image
I've created a new mesh, and this is the results:

Posted Image

It seems correct. You confirm?
Thanks.

In Topic: Deferred Shading: point light and bounding volume

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.


Sorry, but I don't understand very well. I'm a bit confused.
I've correctly understood the problem that you've explained, but not the solution.

In Topic: Deferred Shading: point light and bounding volume

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.....


Do you mean the attenuation? Because if I use the original attenuation formula described on the tutorial:

//surface-to-light vector
float3 lightVector = lightPosition - position;
//compute attenuation based on distance - linear attenuation
float attenuation = saturate(1.0f - length(lightVector)/lightRadius); 

I obtain the same, wrong, result.

In Topic: Deferred Shading: point light and bounding volume

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:


sphereWorldMatrix=sphereScaleMatrix*sphereTranslationMatrix.


Yes, but I already do that, the vertex shader receive the world matrix (for the sphere) that you've wrote above. I think that the problem isn't here.
The problem is the clear cut, that you can see in all the screenshot that I've linked in the precedents post.
Small sphere radius:
Posted Image]
Big sphere radius:
Posted Image

PARTNERS