Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 09 Oct 2007
Offline Last Active May 08 2016 06:18 AM

Posts I've Made

In Topic: Linear gradient shader ( Photoshop-like)

04 May 2016 - 01:22 PM

If isFixed is false, it looks like the gradient is supposed to start at the bottom of the window. Have you verified that isFixed is false? You could also try passing psInput.UV.y as the output of the shader to verify that its value is correct.

With isFixed false I want the gradient influenced by the camera position. My shader is wrong, since the start point of the gradient is the bottom of the window instead of the bottom of the sprite.

The question is: how can I modify the shader in order to have the gradient starting from the bottom of the sprite? Maybe I need the size of the sprite in pixel? Or there are other convenient ways?


The other question regards the "fixed gradient": if I want the gradient not influenced by the camera position, what is the convenient way? It's possibile to have these two behavior in the same shader?



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?

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?

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.