forked from blender/blender
MaterialX: Implement Gradient Texture node. #28
@ -177,10 +177,16 @@ NODE_SHADER_MATERIALX_BEGIN
|
||||
res = vector.extract(1).atan2(vector.extract(0)) / (val(float(M_PI * 2.0f))) + val(0.5f);
|
||||
break;
|
||||
case SHD_BLEND_QUADRATIC_SPHERE:
|
||||
/* Bias a little bit for the case where input is a unit length vector,
|
||||
* to get exactly zero instead of a small random value depending
|
||||
* on float precision. */
|
||||
res = (val(0.999999f) - vector.dotproduct(vector).sqrt()).max(val(0.0f));
|
||||
res = res * res;
|
||||
break;
|
||||
case SHD_BLEND_SPHERICAL:
|
||||
/* Bias a little bit for the case where input is a unit length vector,
|
||||
* to get exactly zero instead of a small random value depending
|
||||
* on float precision. */
|
||||
res = (val(0.999999f) - vector.dotproduct(vector).sqrt()).max(val(0.0f));
|
||||
break;
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user