better refraction
daz studio 4.21.0.5, blender 3.4.1, diffeomorphic 1.7.0.1400
This is related to where it is reported some difference with the iray refraction.#1306
As for refraction we have an issue from some time now that we never noticed. That’s we use the fresnel for surfaces aka reflection, where the back sides are clipped. That doesn’t happen for volumes aka refraction, so in that case the fresnel gets dark.
To fix this I introduced a new output for the daz fresnel group, that doesn’t take into account backsides.
Then in the daz refraction group we can use the new output. Also in my tests a power of 3 seems to better mimic iray.
note. As an alternative we could just use the standard blender fresnel node for the daz refraction group, but that doesn’t take into account the roughness.
note. We may just call it “daz fresnel“ instead of “daz fresnel 2“. Since we don’t have multiple fresnels anymore but just one with multiple outputs.
note. important. The tests with refraction also revealed a better factor with volume, since the props in use volume to tint the glass instead of using the glossy color. We use 200 instead of 100 for the absorption factor. Note that this is only for the absorption density, in my tests the scatter density is good with 100.#1306
# daz volume better factors
absorption density = 200 / iray transmitted measurement distance
scatter density = 100 / iray scattering measurement distance
Below there’s the result with the test scene bottle.duf, that’s using the asset below. I preferred using the daz store assets for testing since simple primitives are not enough to spot the complex behavior of refraction, and that’s probably why we didn’t notice it in the first place.
https://www.daz3d.com/magical-potions-and-bottles
Comments (19)
-
reporter -
reporter Issue
#1306was marked as a duplicate of this issue. -
reporter - marked as minor
- marked as enhancement
-
reporter - edited description
-
Thank you so much for figuring this out … Maybe you guys can put a button on your interface that makes cycles look exactly like iray once you'd figure out all the things…. That's what I would like to see
-
reporter Usually Thomas will fix the code so you don’t have to fix it yourself by hand. There’s your “button“.
-
You guys rock…. That's why you should make a polished website because you guys deserve a parade… People look at the bit bucket interface and they don't realize that is a seriously badass add-on… It's so awesome it's not just an add on it's 2 major pieces of 3d software made one…you deserve a parade!
-
*this is so well coded
-
repo owner Implemented in latest commit. Thank you for the clear explanation.
-
reporter - changed status to resolved
Commit 49b44c6 works great.
Marking as resolved. Eventually will reopen for improvements to eevee, or will use a new report.
-
reporter - changed status to open
-
reporter update. FIX FOR THIN WALLED.
daz studio 4.21.0.5, blender 3.4.1, diffeomorphic 1.7.0.1480
It is reported in
that the new fresnel doesn't work for G9 eyes. This is true and it is because the eyemoisture material is thin walled, so we have to use the dielectric fresnel in this case since there's no volume.#1457To fix this it is convenient to split the "daz refraction" group into two groups "daz refraction" and "daz thinwalled", where thinwalled is used when thin walled is on in daz studio.
# select refraction group if thin walled = on use daz thinwalled else use daz refraction
Then the implementation of the two groups is as below, where essentially we use transparency and dielectric fresnel for thin walled.
Then below the G9 eyes with the fix above.
note. It is suggested in
to use the camera rays to clip shadows, but this can't work in the general case, not even for thin walled. Below an example with a simple crystal balls scene. The blue is thin walled and the red is not.#1457Please note that iray does better caustics, but I didn’t use the new caustics features in blender 3.1 to render the scene.
-
reporter - attached g9-eyes.duf
test scene for G9 eyes
-
reporter - attached stars.jpg
- attached squares.jpg
- attached cristal-balls.duf
test scene for crystal balls both thin walled and not
-
repo owner Fixed in last commit.
-
reporter As for commit 5a3c0dd.
minor bug. The refraction roughness input is not used for thin walled since there’s no volume thus no refraction roughness. It doesn’t harm but would be correct to remove it. Let me know.
-
tysm for fix
-
repo owner Refraction roughness removed from thin wall group.
-
reporter - changed status to resolved
Commit 3dc2626 works fine, thank you for the fast fix as always.
- Log in to comment
note. In
#1306it is also asked if we can improve the glass for eevee. But given that the specific assets use volume to tint the glass in this case eevee can’t be any good. Will see if I can do something though but not now. The above is a good improvement for cycles.