I’m trying to set up a shader using a VRayHairSampler plugged into a ramp to drive color along the length of a strand and I notice that it by default returns the % along strand distance to a 0-1 value.
I’d like to have the ramp be a fixed distance along the strand instead of % of strand length, is there a way to return the length of each strand so I can multiply that against the % value and get the desired results?
Hello Richard,
This new feature is almost ready. We wanted to check with you if we understood the problem correctly.
We added a new output for the VRay Fur/Hair sampler called “Distance Along Strand Normalized”. We also added a new float input parameter “Max Distance”. You should set the max distance to the length value of your longest strand in scene units and the new output will then give you a number between 0 and maximum 1. The maximum depends of the current strand length. If it is a short one, the maximum will be less than 1.
This way when you plug the new output to the ramp, it should give you what you are looking for.
Do you think all this is handy or you prefer that the new output just yields the absolute strand length in scene units and you manually transform this value to something useful (e.g. divide by a number, etc.)?
This is very exciting, the image is exactly the effect I’m looking for
I don’t know that I have a preference between the vray fur/hair sampler doing the math for me or to do it externally. Would either option support either a per strand value or a painted texture similar to how color values are passed through to the strands?
I assume you are referring to the Max distance value. For now the value is uniform throughout the whole hair system, but it can change per frame. Basically it is used to divide the absolute strand position. It is there for convenience for the simplest use case, but you can always leave it to its default value (1.0). Then the output will simply give you the absolute strand position and it can be used with a combination of other nodes, such as Color Math, to achieve you the desired result.
If you have any suggestion how we can improve the Max distance parameter or you have an exact use case, please let us know.