3ds Max, Mesh from Strands, and Vray Next Hair Material

 
 
 
Posted by:Trevor
Data created:27 July 2020

I'm very new to Ornatrix and started my learning by following along with this great live stream tutorial Jeordanis Figuereo for creating a beard to learn the ropes. I was able to get quite reasonable results but there were a couple of issues I had. My main one was with rendering and a minor one with guide channel data. 

Guide Channel Issue: 

In the tutorial (in Maya) the strand length guide channel is applied to the magnitude and phase of the Strand Curling modifier. I attempted to duplicate this in 3DS Max but found that when I assigned the channel data to either the magnitude or phase it made absolutely no difference to the result. The same guide channel data did work in other locations, like the Change Width modifier. Also when I assigned the length texture map instead of the channel data (the data was derived from the map) the map did work fine so that seems to be a workaround. So unless I've done something wrong (which is quite possible) I feel that there may be a bug with that particular modifier's guide channel usage.

 

Rendering: 

I am attempting to render the beard/hairs with Vray 5 using the VrayHairNextMtl. When I render it directly using the VrayOrnatrixMod it works great. I get really nice results for my first attempt. However I need to be able to bake these results down to a mesh for use in realtime. So I applied the Mesh from Strands operator, removed the VRayOrnatrixMod and attempted to render it again. I ended up with really flat hair. No sheen, no specular component at all. I tried adjusting all sorts of parameters. Cylindrical, billboards, number of sides, camera oriented, tangent normals, mapping types, per strand UVs, etc. Nothing seemed to come even close to the original render.

Is there any way to convert Ornatrix hair to meshes for baking purposes that maintains the properties that it has when it renders directly under VRay? 

 

One option I considered was using Alembic export and re-import as a VRay Proxy since the proxy can be rendered as a mesh. This might work but ultimately I want to be able to bake down the hair to individual hair cards, matched by material ID, and this would be very complicated if I had to export to alembic first. 

 

Thanks in advance for any tips

 

 

Attached Files:
Image 1Image 2Image 3

Hi Trevor, Great results! I'm glad you liked the live stream. 

Guide Channel Issue: 

It sounds like the channels is generated correctly, so maybe there is a problem with the channel slot in the Curl modifier. I will investigate this. 

Rendering: 

With default settings, turnn ON Per-Strand UVs. Let's make sure that works first. 

Is there any way to convert Ornatrix hair to meshes for baking purposes that maintains the properties that it has when it renders directly under VRay? 

How are you going to bake it? How are you going to export it and to what engine? Besides of converting it to mesh, another option is to just export it as Ornatrix Alembic. Unreal Engine will read it as hair and you can apply a hair shader there. 

Jeordanis Figuereo (Product Designer. EPHERE Inc.)

Thanks for the reply Jeordanis. I have 2 baking workflows. One for things like facial hair/beards and one for longer hair. I do plan to use the UE4 engine. 

 

For beards I would like to be able to take Ornatrix hair and bake it right into the face mesh itself. So the workflow would be to create a beard, convert it to a mesh, and create a color, normal, and possibly tangent normal map for it. I would be using the "Render to Texture" in 3DS Max for this and my renderer of choice is VRay. I am planning on using this workflow for background style characters where the intricate details won't matter as much. So I would like to bake in as much of the detail as I can.

 

The longer hair baking workflow:

1. Start by generating hair planes as is done here: https://www.youtube.com/watch?v=XA8xDo5Cj8U

2. Generate hairs from those planes using Hair from Mesh Strips

3. Bake the hairs down to the planes as described in this EPhere tutorial here: https://www.youtube.com/watch?v=1answy5ybCU 

I will need a color pass, normals, and tangent normals

 

On the rendering side I did a few more tests and included some images with settings. 

 

Render1 is the direct vray render with the material as shown with no changes from the "Light Brown" preset. No maps were used. 

Render2 I added in Mesh From Strands, disabled VRayOrnatrixMod, used billboards and per strand UV coords. As you can see here the render is quite different and a lot of the depth/specularity is missing.

Render3 I tried the same settings but with cylindrical meshes. The result is different than with billboards but still very flat. 

Render4 was just a test render. I altered the "Random gray hair density" in the material. It is supposed to be 30% but it turns 100% of the hair gray. In fact all the randomoization settings, glint, and softness don't work correctly.

 

My guess is that something inside the VRayOrnatrixMod feeds extra data to the renderer and when you try to render the hair as a mesh that data is lost and the results aren't as intended. I am not that concerned about the "randomization" settings inside the material. I can achieve similar results with gradient and noise maps. I am trying to get more consistency between rendering directly without converting to a mesh vs converting to one. 

 


Attached Files:
Image 1Image 2Image 3Image 4

So, what a solution? Trevor? Jeordanis?

 


Attached Files:
Image 1Image 2

Sadly I never really found a great solution. I was never able to get VRay / Orantrix to render with the same quality in mesh mode as it does in hair mode.

 

I managed to use a work around for the beard. What I did was take the portion of the original face model that I grew the hair from and flattened it out to make it perfectly planar just like it's UV shell. I then grew the beard from that flattened model instead of the original. The trick is to make sure the original model and the flattened variety have identical UVs. Once you have the flattened hair looking as you want you need to create an orthogonal camera with appropriate resolution aligned in such a way to render the baked maps you need. You can render directly without requiring bake to texture. This lets you use the full hair rendering model of VRay/Ornatrix without converting to mesh to get a beauty pass. You can then convert the hair to cylindrical mesh to get your normal, tangent normal, and opacity passes as needed (I just added them as render elements). This gives you quite decent results although it is a lot of going back and forth to get right since you can't work on the original model but have to work on a flattened version instead.

For longer hair this process doesn't work nearly as well... or is just much more complicated. Unlike a beard where most of the hair is just at surface level and there's not much layering required, longer hair needs a lot of layered hair planes to bake down to for good results. You can use the same kind of process of creating your hair on the original model, converting said hair to hair planes, and then creating a flattened version of the hair planes and grow your hair on them in order to get a good beauty pass to transfer back to the original hair planes. It's a lot more work and it's a lot more complicated to do this way. It also requires rather huge map resolutions.

I ended up just using the old fashioned approach of creating flat hair cards. Rendering needed hair maps on them. Then using those generated renders to texture ornatrix groomed hair planes on the model in question.