Do you have any plan to update the render element in 3dsMax to get the reflection roughness and the metalness values of the VrayMtl?
For now, the reflection glossiness pass renders perfect white even if some VrayMtl are set with a roughness value of 1 (which is wrong).
It’s simply always representing glossiness.
So to get roughness you only need to do 1 minus the RE, for the material in question (i.e. you’ll want the material masked out, if you mix the approach.).
As for metalness, there is no real material which has half measures: it’s either a metal (metalness of 1), or it’s not and is a conductor (metalness of 0).
What would you use the RE for, in compositing?
Thank you for your response! I use the render elements to generate textures for real-time rendering in Unity, projected in camera space, allowing me to get a nice pre-computed render (with Vray) mixed with some realtime stuff (I export world space normals as well with the SamplerInfo pass etc…).
I agree, the fact that the roughness is missing from RE can be easily corrected in my shader in Unity. But it becomes a mess if in the same render some materials use glossiness and others use roughness. As an example, I use some KitBash 3D models and I can’t be sure every material is configured with the roughness workflow. But I can deal with that, just have to check each material…
The metalness is more problematic for me. Some time ago, I used to work with the PBR specular workflow in Unity: this way, I could use the VrayMtlIOR, VrayMtlReflectionColor and VrayMtlReflectionGlossiness rendered with the RE to feed my realtime material. It worked well, because in Vray all my metal materials were done with the fresnel option unchecked or a very high IOR value. But now, the metallic workflow is used everywhere. As an example, Substance Sampler (ex-Alchemist) only exports a metalness map (with the Vray export preset). And most of the online material libraries deliver textures with the metallic workflow. And I’ve not found any way to represent the metalness values in my renders with the render element. We can get almost anything we want with the RE, but not that. It’s frustrating : )
Indeed, you’d need to mask out which shader is rough and which is gloss, or better still, simply run a script and ensure they all use the same approach (see below.).
(
/*
Switch to Roughness
*/
theMats = getclassinstances VRayMtl
for m in theMats where not m.brdf_useRoughness do --these use glossiness
(
m.brdf_useRoughness = true --make it use roughness
if m.texmap_reflectionGlossiness != undefined and m.texmap_reflectionGlossiness_on do --we have a map and its influence is active
(
theOutput =output map1:m.texmap_reflectionGlossiness name:(m.texmap_reflectionGlossiness.name + "_inverterMap") --create and set up the output map
theOutput.output.invert=true --invert it
m.texmap_reflectionGlossiness = theOutput --put the inverted map back in
)
m.reflection_glossiness = 1.0 - m.reflection_glossiness --always invert glossiness because a map influence may be partial
if m.texmap_refractionGlossiness != undefined and m.texmap_refractionGlossiness_on do --we have a map and its influence is active
(
theOutput =output map1:m.texmap_refractionGlossiness name:(m.texmap_refractionGlossiness.name + "_inverterMap") --create and set up the output map
theOutput.output.invert=true --invert it
m.texmap_refractionGlossiness = theOutput --put the inverted map back in
)
m.refraction_glossiness = 1.0 - m.refraction_glossiness --always invert glossiness because a map influence may be partial
)
theMats=#() --clean up
theOutput=undefined
)
The metalness is more problematic for me. Some time ago, I used to work with the PBR specular workflow in Unity: this way, I could use the VrayMtlIOR, VrayMtlReflectionColor and VrayMtlReflectionGlossiness rendered with the RE to feed my realtime material. It worked well, because in Vray all my metal materials were done with the fresnel option unchecked or a very high IOR value. But now, the metallic workflow is used everywhere. As an example, Substance Sampler (ex-Alchemist) only exports a metalness map (with the Vray export preset). And most of the online material libraries deliver textures with the metallic workflow. And I’ve not found any way to represent the metalness values in my renders with the render element. We can get almost anything we want with the RE, but not that. It’s frustrating : )
I see, that makes perfect sense.
I’ll ensure to poke the devs about this.
This is nice to you, it works perfectly! I notice these lines are repeated twice, I guess this is a copy/paste mistake?
if m.texmap_reflectionGlossiness != undefined and m.texmap_reflectionGlossiness_on do --we have a map and its influence is active
(
theOutput =output map1:m.texmap_reflectionGlossiness name:(m.texmap_reflectionGlossiness.name + "_inverterMap") --create and set up the output map
theOutput.output.invert=true --invert it
m.texmap_reflectionGlossiness = theOutput --put the inverted map back in
)
m.reflection_glossiness = 1.0 - m.reflection_glossiness --always invert glossiness because a map influence may be partial
Thanks a lot, I will look forward to this feature update
Hi! Any news about the possibility to output the metalness value of all VrayMtls with a Render Element someday? I found another thread about the same issue (Baking texture in Vray Next - Common :: Render Theory - Chaos Forum), but it the case of the render element, the workaround with an ExtraTexMax can’t work.