3
$\begingroup$

sphere before nodes linked

sphere after nodes linked

Before and after linking the nodes. I am trying to create a partially transparent cornea for context! The entire sphere keeps turning black when I link the mapping node to the gradient texture node.

$\endgroup$
1
5
$\begingroup$

If a Texture Coordinate input is not present, the space in which the Gradient > Linear is measured defaults to Generated.

Generated space measures 0-1 along the sides of an object's bounding box, aligned to the object's own X,Y and Z axes. In that space, the minimum X of your sphere's surface maps to 0, and its maximum X maps to 1.

An un-rotated Linear Gradient varies along X of the given space. The output of that node in Generated space is 0 at the left of your sphere, and 1 at the right. The Color Ramp expects a 0-1 input. In this case, that's what it's getting, and mapping that range as determined by the sliders.

When you connected the Texture Coordinate node, you chose Object space for the gradient. That space is measured in Blender Units, from the object's origin, along its axes. The sphere's origin is still at its center, and it's 0.172 units in diameter.

In Object space, the sphere's minimum X is -0.086 ,and its maximum X is +0.086. That's the range the Color Ramp is getting as input. All the negative values are off the left of the ramp. The positive values will be mapped to whatever is between 0 and 0.086 in the ramp. In this case, Black.

TLDR;

To get the same results as before, use the Generated output of the Texture Coordinate node

$\endgroup$
5
  • $\begingroup$ Hi Robin - thank you for this! It worked... until I changed the the Z rotation coordinates. Do you know why this is? Sorry if you covered this previously, I'm relatively new to Blender! $\endgroup$ Aug 1 at 18:46
  • $\begingroup$ You would expect the Generated texture-space to stick to the object if it's rotated in Object Mode. The object's bounding box travels with it. What effect are you looking for? Lit side of a planet, or something like that? $\endgroup$ Aug 1 at 18:59
  • $\begingroup$ @Emma Ahh! You mean in the mapping node? Generated's origin is at min (XYZ) so that's the rotation pivot. You may want a rotation about the middle of the sphere. Use a Vector Rotate node instead of a Mapping node, Axis Angle, and set the origin to (0.5,0.5,0.5) . $\endgroup$ Aug 1 at 19:11
  • $\begingroup$ It worked Robin! Thank you so much :D $\endgroup$ Aug 2 at 6:35
  • $\begingroup$ @EmmaCulhane For the use of the Texture Coordinate node and the differences between Generated and Object output and possible conversions, there is a YT channel by some guy (or actually two channels), he does a lot of procedural stuff with Texture Coordinates. His tutorials are a bit... unconventional, but I've learned a lot about normal vector manipulation etc. from that. The channels are called "Default Cube" and "CG Matter". It comes in quite handy sometimes if you know how to use the different types of coordinates and when it's better to use Generated, Object or UV etc. $\endgroup$ Aug 4 at 8:34
1
$\begingroup$

Since your using the object coordinates, I think it might be caused by not applying the transformation. I presume you changed the scale of the object somewhere.

so the solution is to apply the transformation :D

Select the sphere and hit Ctrl+A and select All transformations.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.