Author Topic: VRay export problems  (Read 12673 times)

I know there's been a few VRay topics scattered around the boards but I figured i'd post this here as I used Painter to generate the outputs. ps I should note that none of the threads lead me to a solution and I couldn't find any documentation on the subject.

Anyways, I've been testing the viability of the new VRay preset output and i'm not 100% everything is as it should be. On simple materials everything seems to work well but when trying to combine metal/non metal materials on the same shader i've noticed some issues.

I've attached an image that documents my results as well a larger version of my shader setup. I think I have connected the maps correctly but would great if anyone could take a look and see where/if i'm going wrong.

Would also be great if someone could explain how VRay is handling the IOR map internally.

I've only been able to reproduce the painter viewport look in Renderman for Maya (using the PxrDisney shader). I'm not sure if the intention was that we'd get a 100% match in VRay or something in the same ballpark.

thanks in advance.
Last Edit: August 27, 2015, 02:55:52 pm

The outputs looks good to me, it's normal that the non metallic parts have a pure white reflection and it's normal that metallic part have a black diffuse.

Something I don't understand: why did you put gamma correction nodes to diffuse/specular?
The two textures that should have a gamma correction nodes are the glossiness and the ior: they should be interpreted as linear (gamma 1.0).

Vray handle the ior texture as 1/texture. The vray preset actually exports a 1/ior map. So when vray reads the texture we find the correct ior back: 1/(1/ior) = ior

Quote
I'm not sure if the intention was that we'd get a 100% match in VRay or something in the same ballpark.

you should get a 99% match ;)

edit: take a look at this thread:
http://www.polycount.com/forum/showthread.php?t=155524

I'll put this info in the documentation.
Last Edit: August 27, 2015, 03:31:29 pm
Product Manager - Allegorithmic

Hi Nicolas thanks for your reply.

VRay does not respect Maya's in built colour management. We either have to use gamma nodes to inverse the sRGB on our colour maps. (.454 on all channels) or apply Texture input gamma controls on the File node's attributes. Vray automatically applies the sRGB gamma to any inputs that may have colour information (Diffuse/Reflection)

All other 'value' inputs (glossiness/reflection ect) are automatically read as Linear (gamma 1.0).

In this case I have used gamma nodes to illustrate that I have inversed the gamma on these two maps. Looking at your link on Polycount I think I have everything plugged in as you advised so am still at a loss really.
Last Edit: August 27, 2015, 05:00:20 pm

I've sent you a pm.
Product Manager - Allegorithmic

I've fixed the problem in the PBR converter in Designer (will be available in the next minor update).
We'll apply the fix in Painter asap!

Nicolas
Product Manager - Allegorithmic

That's great news. Can you explain what the issue was? would be good for my own understanding.

Some further observations that I have made today.... given that the multi material setup on one shader wasn't working, I tried to re-create 2 layers from painter using a VRayBlend material. From my example you can see I am blending a base metal with a concrete material via the mask that I have exported from Painter. All maps were exported from painter one layer at a time and connected to the shader exactly the same way.

The result is also some way off. Im not sure if the issue is related to the existing bug or a problem with the mask that has been exported.

Last Edit: August 28, 2015, 04:49:35 pm

The problem was on the Reflection map:
Here was the function:

Assuming basecolor is sRGB and metallic is linear.

basecolor = sRGBtoLinear(basecolor);
reflection=  mix(white, basecolor, metallic);
reflection = LineartosRGB(reflection);

The fixed version:
metallic = LineartosRGB(metallic);
reflection = mix(white, basecolor, metallic);


If you want to make the conversion using two materials here's how you should do it:
- First material (dielectric):
   - plug basecolor (the original basecolor from painter) to diffuse
   - set reflection to white
   - use glossiness in glossiness (or 1-roughness) (gamma 1.0)
   - set IOR to 1.4

- Second material (metal):
   - set diffuse to black
   - plug basecolor (the original basecolor from painter) to reflection
   - use glossiness in glossiness (or 1-roughness) (gamma 1.0)
   - set IOR to 100 (or disable fresnel)

- Use the metallic map as the mask between the two materials (gamma 1.0)
Product Manager - Allegorithmic

Thanks for the info.

I made the adjustments you suggested to my blend material setup. On the first VRay setup the result is extremely close now. This has meant using channels from two seperate output presets. Will this be the way forward or will the new VRay preset be updated to work for this multi material workflow? ( i guess we can customize our own channels for export)

Interestingly when I used the IOR map from the VRay preset instead of custom fresnel values that you specified the result was completely different. IOR map seems to work fine for the metal, but when I used the IOR map on the concrete material the result varies a lot. Does this indicate a problem with the IOR for dialectrics or am I missing something here?

If you manually blend the 2 materials, you should not use the IOR map.
The ior map is used to blend the metallic and dielectric material and associate a specific F0 for the 2 materials. So it means this value will vary when the material is half metallic and half dielectric (metallic is grey).

In your setup, the transition is handled by the the VrayBlendMtl (and it's more accurate btw). If you use both the Blend and the ior, you'll get wrong values where metallic is grey.

Here is the result with the corrected exporter in Painter. (the UVs on both model are a bit different, it's visible on the straps)

Product Manager - Allegorithmic

Ah ok. thanks for clearing that up.

Can you post a bigger pic?

(yeah side note...I had to change the uv's to fix a problem with normal maps - vray doesnt like flipped normals which the hanz mesh had for the straps)

EDIT - just seen your pic fullscreen. The dialectric areas look like they reflect a little strongly still. Especially glancing angles. (gloves/straps)
Last Edit: August 28, 2015, 07:19:55 pm

It's probably because we don't use the same brdf for the diffuse component, we use Lambert and vray probably uses Burley.
We won't change that for the moment as it's a lot more expensive.
Product Manager - Allegorithmic

It's probably because we don't use the same brdf for the diffuse component, we use Lambert and vray probably uses Burley.
We won't change that for the moment as it's a lot more expensive.

Nicholas,  Have you observed the same results/issues with Arnold?  Any chance Wes could throw together a short vid on this topic. It's pretty important and would be tremendously helpful for folk looking to expand SP & SD's reach into the world of rendered animation.

VRay export working as of 1.5.5. Appreciate the quick turnaround on this fix.

Non-metal parts of the shader appear to 'glow' more than they do in painter as noted before. Glancing angle reflections are too strong. I've not tested with Arnold since our pipeline is VRay. I suspect it's the pure white values for dialectics in the reflection map coming from Painter. In general having a fully reflective material in VRay never looked great. Probably about as good as it gets for now.

Nicholas, can you explain how the IOR map values from painter are mapped? For instance painter ouputs a 187 rgb value for dialectrics (IOR Map) Thanks.

Quote
Nicholas,  Have you observed the same results/issues with Arnold?

Sorry, forgot to reply...
I've not tested much with Arnold and I don't know what brdf they are using for the diffuse part.
Keep in mind SD/SP are using realtime shaders that contain quite a lot of approximations compared to raytraced/offline renderers. Consequently, there will always have differences.

Quote
Nicholas, can you explain how the IOR map values from painter are mapped? For instance painter ouputs a 187 rgb value for dialectrics (IOR Map) Thanks.

I have 170/255 on my side.. If you use PS, make sure you set the Gray working space to Gamma 2.2 or sGray in the Color settings (PS default to Dot Gain 20%).

The IOR texture represents 1/IOR, in the case of dieletrics SP shader uses a 1.4 IOR, so:
1/1.4 = 0.667...
0.667 * 255 = 170

So when vray reads the texture, the material will have an IOR of 1.4 for dielectric parts.

SD allows the user to input an additional "specularLevel" map to adjust this value (between approx. IOR 1.0 and 1.8). This is not yet available in Painter.


Product Manager - Allegorithmic

That's awesome !

Does anybody know how to convert PBR Materials and their texture maps for 3dsmax and Vray ?

I created a short VIDEO that shows my current progress / questions:

https://youtu.be/-MytgGALMBI



Thx for any little help, hints, tipps & tricks !