7
$\begingroup$

I want to calculate the density of a volumetric Emission material using the distance inward from the mesh surface. I've been able to do this with a cube and several coordinate systems: generated, object, I can display the u,v-coordinates as colors on the surface of a uv-mapped mesh. I can use the Mapping Node to rotate these coordinates around the X- or Y-axis and see the w-coordinate in shades of blue.

Within the Blender manual pages for Input Nodes, the description of the Texture Coordinate Node makes no mention of unsupported coordinate systems for volume materials. But the description of the Geometry Node states "For volume shaders, only the position and incoming vector are available."

Is the w-coordinate of the UV coordinate system supported for volume materials? I fear that the w-coordinate cannot be defined within a mesh of arbitrary shape because each interior point can be projected back to the mesh along many normal vectors. But I'm not sure I understand the w-coordinate well.

$\endgroup$

1 Answer 1

4
$\begingroup$

If by UV you mean unwrapped coordinates then no, volumetrics can not use UV coordinates. This is for the exact reason you stated in your question, by unwrapping a mesh you are only assigning coordinates to the surface of your mesh, not the volume.


Here are the texture coordinates that work for volumetrics (i.e. not calculated based on the surface of the mesh).

Texture coordinate node:

  • Generated: Generated coordinates are based on the bounding box of the object. The left, bottom, front corner is (0, 0, 0) and the right, top, back corner is (1, 1, 1); the volume of the bounding box is interpolated linearly between these. By default all procedural textures use generated coordinates.
  • Object: The coordinates in local-space of the specified object on the texture coordinate node.
    enter image description here
  • Camera: The position in camera-space.

Other nodes:

  • Position (geometry node): The position in world-space.
  • Location (object info node): The object's position in world-space. Note: Unlike object, camera, and position this is the position of the origin of the object possessing the material, not the point within the object. (This one probably isn't that useful for your purposes.)

For more on texture coordinates see my explanation of texture coordinates here.

$\endgroup$
3
  • $\begingroup$ I think the OP was asking about the UV coordinate system in particular, but I guess this doesn't have a W axis? $\endgroup$
    – gandalf3
    Commented Jul 15, 2015 at 3:59
  • $\begingroup$ @gandalf3 Ahh, I didn't think of it that way, coming from Max I am not used to UV only referring to unwrapped. Technically unwrapped coordinates do have a W coordinate, but it is always 0. But the reason they don't work for volumentrics is that they are only defined for the surface of a mesh, the the volume. $\endgroup$
    – PGmath
    Commented Jul 15, 2015 at 13:21
  • $\begingroup$ @PGmath, thanks for the effort to provide descriptions of the coordinates supported by volumes. $\endgroup$
    – astrogeek
    Commented Jul 15, 2015 at 13:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .