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: