I am trying to create a transparent gradient texture for the top of a cylinder / disc / ring.
So far I have used this node configuration that is basically using the mathematical formula sqrt(x^2+y^2) to get the radius as it is explained here RADIAL Colorramp gradient texture
It is working good when the object is a cylinder that has been reduced the Z scale to a minimum so it looks like a disc/ring as it can be seen here:
However, the same material is not working right if the object is a disc created from a extruded circle (from the vertex). Nevertheless, if I change the power to another negative value, the material starts to work although not exactly how I want as it can be seen here:
I guess this has to do with the UV coordinates each object has internally generated but I cannot figure this. Why is this happening?
Also I am open to use another more simple approach than this nodes configuration.





I decided to try your second solution to give more independence to the texture from the size of the object since its possibly going to be reescalated and it works exaclty as I wanted it to work.
However, I dont totally understand the two vector mathematical operations. If i get it right, it goes from values (0,1) to (-1,1) right? Or why do you need to use the substract and multiply in this case?
Thanks
– Daniel Ortega Oct 19 '20 at 14:04