convert Iray Refraction (thin wall ON) for Eyemoisture G3 material

Create issue
Issue #136 resolved
engetudouiti created an issue

This subject is related to #51, Then I often have felt difficultiy to convert iray refraction (thin wall on) of eye mats , but today I tried one way which I planed but did not test. without mix with transparent shader.

compare these 2 pic please. both use same HDRI, and same cycles mat setting for all eyes mat. every render setting is perfectly same . which image you think better or more reasonable for eye reflection,and refralciton?

pic1 (without solidfy modifier) eyetest_nothick.png

pic2 (with solidfy modifier only about "eye moisture sphere" vertices) eyetest_thick.png

At first, about genesis3 (and maybe genesis2 have same eyereflection parts) eye reflection part geometry is mostly closed sphere without any thickness. (so it is same as primitive sphere)

And "Eyemositure" is reflection (and refraction) part for genesis3female eye. Then Daz iray mat often use "reflaction with (thin wall "on") for the surface.

I understood why iray refraction (thin wall ON option) will not be converted correctly for principled bsdf transmisison. I had felt it may difficult to achieve it, with principled bsdf transmisison only. Then I suggested to mix transparent shader to reduce problems. (if you need) . Of course it is not best way, because if I mix transparent shader with transmission, it may reduce wrong refraction problem. But it will reduce reflection (specular glossy) effect too. we often need clear specular reflection about eye moistyre mat. (to show env image etc). So I hope to use cycles principled bsdf "transmission" as iray "refraction (thin wall)" if it can work.

When we set "thin wall = on" iray just treat closed surface thickness as almost zero (really thin wall maybe micro meters?). then it can show correct refraction for eye mositure with keep reflection. .

On the other hands, Cycles principled bsdf transmission, (and cycles refraction shader) treat closed sphere as "full thickness sphere" about refraction. If we set refraction (or principled transmission) for closed sphere, it work as "thick magnifying glass" with sphre radius. it is pic1 (without solidfy modifier)

It show pupil becom very large, and deep refraction effect with ior. To correct it perfeclty actually we need to change geometry of eye moisture (mainly closed sphere part mesh), not shader.

There are 2 ways, 1 is destructive. simply apply normal thickness for the eyemoisture sphere surface. (about 0.01 scale, may need 0.0003 etc as you like, with keep good offset) it is most reliable, and may not cause setting problem or flip UV things.

I hope to keep original mesh, for morph import, then duplicate original full body mesh, remove other part, and only remain eyemositure sphere, and apply thickness manually. then use mask modifier, or apply transparent shader for original mesh eye mositure, but use transmiison (principled bsdf) for, new duplicate eyemositure. it work well.

2 is non desructive, use solidfy modifier. the merit is it not chagne actuall vertex count, then import morphs still work. but about this case, I needed to set up carefully, I saw some strange normal problem. (I serch google, and there were some reports with solidfy modifier and normal problem, but I can not find clear answer, it seems depend on each case,,)

Above pic, I apply solidfy modifier, only about moisture sphere part. with vertex group. then remove doulbe uv, about I edited parts. material view seems show wrong normal about non solidfy mesh parts, (it show invert normal, though I have not apply thickness for other skin parts). but when render it ,I have no problem.

And this is my setting of solidfy modifier, for the selected parts (I set new vertex group for the eyemoisture sphere)
transsetting.JPG

and you can see, I actually only use principled bsdf transmission (weight should be 1), then it keep real reflection, with refraction, as same as iray refraction (thin wall ON) setting.

and I feel it reduce high noize problem about eye refrection. (deep thick refraction with reflection often cause issue for noize I think, it more strong when we try in room render, with many light setting)

So I may need more test, but I feel, at least about eye mat (for g3 etc) this procedure work well, and will be auto applied by plug in . But To suggest this as request, I need more test (I need to find best setting and stable procedure, because I saw some flipping UV with solidfy modifier and needed to correct it, to get this render)

Anyway, I hope thomas check this topic. you may not hope to mix transparent shader for convert iray refraction , I believe. and it may be useful for those who have seen same problem, but not hope to mix with perfect transparent shader for eye mositure part. (or reflection sphere of eye)

Comments (13)

  1. Thomas Larsson repo owner

    This is a very interesting observation. For a long time I have been unhappy about the eye materials, which tend to make the eyes to dark imo. Adding this feature was straightforward and is implemented in the latest commit.

    However, the solidify modifier is disabled, both in the viewport and in rendering, because it seems to lead to problem.

    G2F: solid-g2f.png

    G8F: solid-g8f.png

    The problem is that the skin material changes, in particular for G8F, despite the fact that the vertex group only includes eye vertices. The viewport color also becomes darker, but that is something that I could live with. But the modifier is generated, so if you want to test you can just enable it in render and viewport.

    EDIT: The vertex group had to be inverted. Now things to work as expected, so I turn on the modifier. Eventually there should be a setting that controls this, I think.

    Here is G8F again. The lighting isn't great and there are fireflies, but the important thing is that the eyes are brighter and the skin is unchanged.

    solid-g8f.png

  2. engetudouiti reporter

    I need to say , about G8, I remember, the eye reflection geometry change,

    So this procedure mostly work about G3 and other generation figure, which have sphere parts eye reflection mesh (DAZ often change this eye reflection part material name, and some generation figure, not have this mesh part,,)

    And I find, it may not need as perfectly closed, I think. because G3 eyemoisture are not perfectly closed sphere., but blender refraction seems count all volume as thickness correspond to sphere part radius I believe,.

    could you find which material group cause main eye reflection for G8 ? I may hope to check about G8 .

    And ,,,yes,, I already find same problem, about black strange artifact. or flip normal etc.

    when I apply solidfy modifier, for the eye sphere parts only with vertex group.

    I believe, it should be blender bug. because the strange part are excluded from modifier. but this strange black artifact happen to me. and I found some report about solidfy modifier, and these strange normal things.

    and,, it is really strange, because it only happen about one scene. another scene cause no problem. (so I up-loaded pic with safe scene)

    I hope to find, why it happen only about one scene, but it take more time, then what I currently recommend way is like that. (so please test with your choiced actor figure,, it should improve much about refraction shader problem of blender (or principled bsdf transmission)

    1. duplicate full mesh, (in object mode) of figure, set name as "EyeReflector"
    2. select the duplicated mesh, and in edit mode, select only vertices of eye reflection part, where it may cause this refraction problem ,,)
      3 invert selection, then delete all.. so now you only get EyeReflector part mesh. with keep armature modifier. (so mostly 2 double sphere like shape)

    4 remove un-used modifier if you have arelady set (may only need, armature, and sub-D) of the eyeReflector .

    5 remove un-used vertex group,, (usually r-eye and l-eye only need. I lock it in vertex group, then delete un-lock all vertex group, to clean up)

    6 apply solidfy modifier for the reflector mesh. then adjust thickness as you like. about this case, I have no problem. you can test it, only render the eye reflector, with material setting.

    7 select your actor figure mesh. then in edit mode, make new vertex group to hide reflector part eye mesh

    8 apply mask modifier, and set the reflector part vertex group (inverse)

    9 then, your actor mesh eye reflector part should be masked in render, and viewport . and your "eye reflector mesh with solidfy modifier will be render as Actor new eyereflector. (so it keep armature modifier, eye reflector usually only use eye bone controll seldom morphed. I think)

    This way need some step more, but it cause no strange black double effect. or (normal problem I think) and keep clean original. (only add mask modifier)

    =========== this is the render scene, with current setting, I render with solidfy on and off only about separated mesh (eye reflector) ,with mask same parts of actor (genesis3) it drastcally change..

    I can see with solidfy modifier, real eye colnea vivid eyellow color. and clear water like eye moisture. (so I keep roughness reall low value, about this scene, , but it show more reasonable eye, with each roughness or specular I believe )

    (but,, it may take 5 minutes work,,^^; to separate mesh etc,, )

    with modifier for separated eye part. solid_separate1.JPG

    witout modifer for separated eye part. solid_separate2.JPG

    I may test with G8 then may hope to offer more usable feedback again.

  3. engetudouiti reporter

    To clear show what I suggested, I test with cycles glass shader. it may be used with no principled bsdf option, I feel. I made fake geometry like g3 eye moisture (it is not closed sphere )without thickness. and locate cube in to the mesh.

    compare 2 pic. first is maybe what we may see, when" convert iray mat refraction with thin wall on" for eye reflector. it clear wrong.

    then we need to add thickness (with modifier, or manually etc,,) anyway for this eye reflection (almost opacity with reflection) parts mesh. it may not matter, which shader we may used, (reflaction + glossy, or glass or, principled transmisison)

    Though I can not confrim, how we can achive it with plug in. and which way is problem free

    bad convert glass_off.JPG

    good convert glass_on.JPG

  4. engetudouiti reporter

    Sorry long and continuous reply. then I finally test with G8female. (but not up-dated to recent version ,then just check please, how this convert way work)

    At first, I found G8 eye reflection mat seems slightly different from G3 G8 use, eyemoisture (of actor figure) + Cornea for, continuous reflection sphere.

    Then as already thomas mentioned, and I pointed out,, use solidfy modifier with vertex problem may cause problem easy. then about this test, I manually duplicate first (in obj mode, not to break vertex order etc,,) then remove un-used part from duplicated mesh, , and remain only about eyemoisture + cornea part (material), then named the mesh as"eyemoisture"

    And I set mask modifier, for genesis8 original mesh, about eyemoisture, and cornea. so when I render, it only use, new eyemoisture (cornea and eyemoisture) which duplicated from original.

    And found, about eyemoisture and cornea, actually daz iray default mat slightly different, about glossy color effect option. and glossy color is not full 1.0 1.0 1.0 etc, but about this test, I hope to simplify.

    then use same mat, for both. (simply set principled bsdf transmission as 100 weight, then not set roughness for transmission)

    and it is my recommend,, even though it is not correct from formula, I feltl, for cycles, we many better keep glossy color as full 1.0 1.0 1.0 about these refraction mat to clear see inside mesh color.

    it maybe special case, then user may manually set glossy color as 1.0 1.0 1.0 about these mat (which you hope clear transmission) anyway this is final render, with same simple setting, I hoped to set roughness more low, and up-specurarity etc,, but not hardly change.
    I did not set up G8mat or light as my best,, (so I seldom use G8 ^^;) but it show clear difference already, with same setting and light source.

    no solidfy with new eyemositure mesh (with mask genesis8 mesh) G8Nothick.JPG

    solidfy with new moisture mesh (with mask for genesis8 mesh) G8thick.JPG

    But I still feel,, G8 eye tend to show too dark. I feel,, it depend on inner material setting etc.. but about this report, I only sugest, anyway we need to set thickness correctly for those reflection part. for iray thin wall option.

  5. engetudouiti reporter

    mm,,,, I read again your edit topic, about G8 , if you hope to apply solidfy modifer for some vertex, you may only need to make group which you hope to add solidfy and assgin it to the group.

    then set the group in solidfy modifier. if you set it "invert",, it means, blender only apply solidfy for non grouped vertex. but not apply for grouped vertex.

    Then even though I inverse it, I clear see same strange black back face (as if it seems duplicated) with render mode,, about poligons which actually no solidfy. I can confrim it, with some scene.

    If I set low value without vertex group to solidfy full mesh, it seems reduce this black render problem (or triangle edge) but it duplicate full vertex when render, I afraid.

    I hope to check, how you group vertices for solidfy for g3 and g8, , and how it work,, but current version cause another issue ^^; then could not,,,

    I am regretting,, I did not up-dated these 3 days,, because I started new scene already,, ,,

    then I can not test with another beta version, to compare which version cause this problem ,,,

  6. Alessandro Padovani

    I don't know if this may help. Below is how I do glass transparency in cycles. To me it works fine without using a solidify modifier. And I use it for the G3F eyes too in the eyemoisture and cornea materials. With different degrees of metallic depending on the intensity I want for the reflections.

    Also if I may suggest to leave the solidify modifier as an option rather than the default, since most users as myself may not need it to get good looking eyes.

    Then of course anyone may have his own preferred approach to pbr transparency, since this is a complex matter.

    eyes-nodes.JPG

    g3f-eyes.JPG

  7. Thomas Larsson repo owner

    Those eyes look very nice. However, the material settings dont seem to have any obvious relation to the original iray parameters. The question is how to automatically detect the refractive eye materials and how to modify them, without relying on material names. Checking for Thin Walled On and Refraction Weight might work.

    I really would like to avoid adding modifiers for dealing with materials if possible, and destructively changing the geometry is out of the question; it would move the imported mesh too far from the Daz original and opens a can of worms that I don't want to think about.

  8. Alessandro Padovani

    Yes that is a complex matter, and I know very little that's why I didn't touch the transparency subject yet. So all the posts by engetudouiti are very instructive and interesting to me.

    I know what I use is a "custom material". That is not intended for automatic conversion. I just wanted to post here my little knowledge and opinions just in case they could help.

    I agree to leave out modifiers whenever possible that's why I asked to make it an option if possible. And I also definitely agree to leave out geometry modifications. Personally to keep the original mesh is essential to me.

    EDIT. As for commit fbb2873 I find the ignore option very useful thank you. So I can just go to the eyes materials and set my custom shaders.

  9. engetudouiti reporter

    Yes I understand. I do not push this procedure include in plug in. If it need to modify geometry actually without modifier. and may better if modifier work well, without change normal etc,, I approve, add it as option too.

    If modifier work, it may cause no difference, when plug in set sub-D or mask, etc, so I supposed, thomas offer it as "thin wall" option, when user need. But I said, to "request" it for add on, I need more test.

    Thomas kindly seems try to include with recent beta for my request. (so it mainly used for test, how it work. )

    I just show ways from geometry (and ideally with modifier) apploach . but if it need to flip normal etc, it means change geometry.

    And the reason why I duplicate mesh etc,, this manuall destructive apploach can clear show difference without any problem. (and keep original as same as before, with mask modifier, then can import morph etc,,) I just felt it seems good to show how test these clear. and show difference about cycles refraction and thickness, then How convert iray "refraction shader" with "thin wall" option.

    It is mostly used for thin water material. (sweat etc) as same as eye parts mat. Nvidia offer MDL example for "water(thin wall)" too.

    http://raytracing-docs.nvidia.com/iray/manual/index.html#physically_plausible_scene_setup#15007

    It is one of major iray strong point than cycles principled bsdf nodes. If we set ior = 1.00, it show fresnel and refracttion as perfect normal direction only. ior 1.00 refraction = use transparent shader for refraction.

    But fresnel with ior = (1.0 to 1.001)(vacuum) and ior = (1.3 to 1.4 ) (water ,real glass etc) show clear difference for reflection.

    Most of case, we may not hope to use ior 1.0 for water or eye moisture reflection.

    what iray refraction with "thin wall" do , it almost use transparent shader about refraction, but at same time use material " ior" for reflection .

    to convert it for cycles, one glass shader,or one bsdf transmission are immposible. these 2 pic show, same thickness plane,with cycles principled transmisison shader, but change only about ior value.

    set ior 1.3 and ior 1.0 or 1.1 clear show difference about reflection effect. it is same, if we add same shader for no thickness sphere material.

    ior1.JPG

    ior1_1.JPG

  10. engetudouiti reporter

    And this clear show how iray thin wall "off" effect change with ior about reflection only. (so from iray document, I believe refraction not count ior about thin wall )

    iray_ior_1.1.JPG

    iray_ior_1.3.JPG

    Then we may hope to get ior 1.3 reflection (with specular refraction or opacity) pic with cycles, or mimic it.

  11. engetudouiti reporter

    This probem is solved in #144 (for me) ,but I need to manually set-up shader

    About this plug in, new 2 option has been aleady added by different apploach.

  12. Log in to comment