I’m trying to create a very smooth gradient effect on a 3D object that will be attached to the camera in XR. I don’t want to use the built in vignette as I’ll be applying this to different effects and different eyes. This is a spatial shader.
I’m using a radial black to white gradient as a texture 2d and putting it into the ALPHA output of the shader, but it’s giving a much sharper distinction between the black and the transparent than I’d like.
e.g. This is what I would like to see - a very long transition between black to clear.
Thanks, although I’ve tried a few things, the shader is essentially - a black solid going into ALBEDO, and a radial gradiant going into ALPHA (multiplied by a float for changing opacity by script).
Switch texture interpolation color space to linear and interpolation mode to cubic.
You can further soften the falloff by adding the following as the last line: ALPHA = pow(ALPHA, exponent);
exponent needs to be between 0.0 and 1.0
In general a better approach might be to use a curve texture. This will let you explicitly control the falloff using a curve but you’ll need to draw the circle in the shader. Something like:
Thanks for all your help. I’ve marked your post as the solution due to the texture interpolation modes making a difference to the gradient to make it begin to be smoother.
As a final note - I’ve ended up getting the effect that I wanted by:
Doing those settings on the gradient.
Making a much smoother gradient in the gradient editor in general
Enabling HDR 2D in settings - I did this originally to help with banding, but it had by far the biggest effect on the smoothness. It did require some re-working of my background textures which were not HDR to begin with.