The Black Eyes Bug -- Explained

margravemargrave Posts: 1,822
edited October 2021 in Daz Studio Discussion

As I'm sure most of you know, there's a bug in Iray that makes a character's eyes turn black, their haircap poke through their forehead, and their skin develop a horrible fake tan if they're too far from world origin.

The two competing solutions for this are:

  1. Shift your scene so the characters are at world origin.
  2. Change the "Instance Optimization" setting.

Of the two, the second is obviously easier, but it was never clear why changing whether instances are enabled would solve it.

Well, I was going through the Iray documentation, and I found this nugget:

3.6.2Increasing computational precision and accuracy

When instancing mode is set to “on”, “auto” or “user”, the scene is automatically shifted in space. This increases the precision and accuracy of rendering computations and reduces precision artifacts that originate from self-intersection. To disable this behavior, set bool instancing_shift_camera to “false”.

It is also possible to force an update of the scene shifting by calling the API method IScene::set_dirty at the beginning of a frame with a flag value that marks the instance transforms as dirty. This is recommended if the camera was moved a long distance (like when rendering new frames of an animation, or the user interactively changing it over time), as there is no automatic update of the shifting in order to avoid unexpected stutter through scene updates when moving the camera.

Basically, when you enable instancing, Iray will automatically move your whole scene to world origin, thus fixing the black eyes bug. So the two solutions are actually the same. It's just that one involves parenting your objects to a null and physically dragging them around the scene, while the other is a simple toggle switch. :)

If you've been following solution #1, you might want to save yourself the effort.

Post edited by margrave on

Comments

  • GordigGordig Posts: 9,247

    I've always been in the habit of adding characters first and posing them before adding the environment, which I then move around the characters as needed. Therefore, I've never experienced the bug myself.

  • charlescharles Posts: 775
    edited July 2021

    What has always actually worked for me is to apply the Eyes Cornea Bulge 100%

    But it's good to know about this type of behanvior from the engine.

     

     

     

    Post edited by charles on
  • rames44rames44 Posts: 329

    I actually found it curious that "shift the scene during rendering so that the camera was at (0,0,0)" was NOT the default behavior, given that some of the math appears to be done with limited-precision variables. But I hadn't considered the potential effect of things like finite-sized domes and such, which tends to explain it.

  • Nice technical explanation, seriously lacking on the "Now what do we do with this?".

    To add to margrave's explanation.

    We don't have "Auto, on, or user" as options, in DS, we have "Auto, speed and memory".(Render settings(tab)>Optimization>Instancing optimization(Drop down))

    Auto and speed produced this problem, in my testing.

    Memory does not.

    So, if you're encountering this problem, set the option to Memory.

     

    I also came across something, rather interesting, when testing this.

    Since this setting will impact ram utilization, when using instances, i loaded an instance of g8f at the default 0,0,0 postion, and started running a second set of tests.

    The 'problem' didn't occur, with the setting on "Auto".

    It only occured if i set to "Speed".

     

    So, another possible solution to this problem.

    Create an instance of the offending figure, and put it at or close to 0,0,0.

     

     

     

     

  • margravemargrave Posts: 1,822

    DrunkMonkeyProductions said:

    Nice technical explanation, seriously lacking on the "Now what do we do with this?".

    To add to margrave's explanation.

    We don't have "Auto, on, or user" as options, in DS, we have "Auto, speed and memory".(Render settings(tab)>Optimization>Instancing optimization(Drop down))

    Auto and speed produced this problem, in my testing.

    Memory does not.

    So, if you're encountering this problem, set the option to Memory.

     

    I also came across something, rather interesting, when testing this.

    Since this setting will impact ram utilization, when using instances, i loaded an instance of g8f at the default 0,0,0 postion, and started running a second set of tests.

    The 'problem' didn't occur, with the setting on "Auto".

    It only occured if i set to "Speed".

     

    So, another possible solution to this problem.

    Create an instance of the offending figure, and put it at or close to 0,0,0.

    "Speed" is off, "Memory" is on.

    To solve the problem, you set it to memory, which enables instancing. If you disable instancing, then creating an instanced figure is just bloating your VRAM with two identical meshes.

  • PadonePadone Posts: 3,481

    As I understand it, that is only good for single frames. That is, you have to switch from auto to memory or vice versa to trigger the refresh. That does not work for animations since there's no way to call set_dirty() via script. And even if if was, that would require programming skills that not all animators have.

    Long story short, iray is not designed for animations. That there's no motion blur is another clue about it.

  • WendyLuvsCatzWendyLuvsCatz Posts: 37,905

    probably why I am not so silly parenting everything and moving it around the camera, I used to do that with 3Delight too

    my main reason is actually to animate the skydome, the black sclera avoidance a bonus

  • Padone said:

    As I understand it, that is only good for single frames. That is, you have to switch from auto to memory or vice versa to trigger the refresh. That does not work for animations since there's no way to call set_dirty() via script. And even if if was, that would require programming skills that not all animators have.

    Long story short, iray is not designed for animations. That there's no motion blur is another clue about it.

    I don't think you understand how DS handles animation.

    Regardless of which option one chooses, Image series or movie, DS renders each frame one at a time.

    For the Image series option, these are output to your directory of choice.

    For the Movie option, the frame series is generated, placed in c:\users\(name)\appdata\roaming\daz 3d\studio4\temp\render, then compiled into the output of choice, and saved to the selected directory.

     

    The setting, Image optimization, should be saved in the scene file, and would switch from the default(auto) to what ever setting was used in the scene file.

    If it doesn't , then it probably wasn't set when the scene was saved, or there's an error.

     

    Since the setting is getting changed, by the scene saved settings, the criteria you laid out is being met.

    So no additional programming is necessary.

     

    I did a quickie test with a 30 frame animation and with g8f at 0,0,-5000, Instancing optimization set to 'Memory'.

    Saving the scene and then loading on my render server, the setting changed to scene saved, memory,  and the black eye problem didn't appear in any frame.

     

    Regarding a lack of motion blur, meaning it wasn't meant for animation, isn't true.

    Iray does have motion blur, it's just not implemented in DS Iray.

    The programmers manual i came across for iray does talk about motion blur,(https://www.migenius.com/migenius/doc/resources/general/iray/manual/index.html#/concept/motion_blur.html?zoom_highlight=motion+blur )

    The operations manual available on the IrayPlugins site, show motion blur for both the 3ds max plugin(https://raytracing-docs.nvidia.com/iray/manual/index.html#camera#15169 ), and the maya plugin(https://www.irayplugins.com/maya-doc/introduction.htm?ms=EQAAAABACA%3D%3D&st=MA%3D%3D&sct=MA%3D%3D&mw=MjQw).

     

     

     

  • PadonePadone Posts: 3,481
    edited October 2021

    @DrunkMonkeyProductions It seems you're right I didn't get it. From the iray docs I understood that the "instancing to memory" trigger has to be renewed once you change the camera position. But in my tests it seems not. That is, once I set "instancing to memory" I can move the camera around at large distances and the "black sclera" aka "geometry precision issue" doesn't arise anymore.

    Then I don't understand what set_dirty() refers to. Unless there's a fix in daz studio so that if the user sets "instancing to memory" then set_dirty() is called whenever you move the camera. But this is not advised by the iray docs because of possible "unexpected stutters".

    Anyway yes, it seems to work fine here.

    Post edited by Padone on
  • Padone said:

    @DrunkMonkeyProductions It seems you're right I didn't get it. From the iray docs I understood that the "instancing to memory" trigger has to be renewed once you change the camera position. But in my tests it seems not. That is, once I set "instancing to memory" I can move the camera around at large distances and the "black sclera" aka "geometry precision issue" doesn't arise anymore.

    Then I don't understand what set_dirty() refers to. Unless there's a fix in daz studio so that if the user sets "instancing to memory" then set_dirty() is called whenever you move the camera. But this is not advised by the iray docs because of possible "unexpected stutters".

    Anyway yes, it seems to work fine here.

    can't help ya on the set_dirty thing, not a code monkey, just a drunk one(lol).

    I just push buttons till i break stuff.

     

  • For the black eyes, I hit on this fix:  Surfaces tab > {your character's name} > Surfaces > Eye Moisture > Base > Refraction Weight.   Probably defaulted to 1.00, reduce it.  I've sometimes had the problem corrected if I reduce it even to 0.9999, sometimes you have to reduce it further.

  • MIH_BADMIH_BAD Posts: 30

    Hello,

    you are a freaking genius!!!!!!!!!!!! This bug was so disturbing, I wanted to throw everything out the window a couple of times!

    Thanks for sharing and I wish you an amazing day and weekend  yes angel 

    Just did a test and it works with 0.99 as you mentioned. I don't know how to thank you enough! angel

    VictorWhiskeyKilo said:

    For the black eyes, I hit on this fix:  Surfaces tab > {your character's name} > Surfaces > Eye Moisture > Base > Refraction Weight.   Probably defaulted to 1.00, reduce it.  I've sometimes had the problem corrected if I reduce it even to 0.9999, sometimes you have to reduce it further.

  • VictorWhiskeyKilo said:

    For the black eyes, I hit on this fix:  Surfaces tab > {your character's name} > Surfaces > Eye Moisture > Base > Refraction Weight.   Probably defaulted to 1.00, reduce it.  I've sometimes had the problem corrected if I reduce it even to 0.9999, sometimes you have to reduce it further.

    Thank you!  I just came across this discussion after fighting with this today. Moving the character to world center and changing Instance Optimization had no effect on the actual render. (Moving to world center worked before in another scene but not this one. ???) It would clear up in the Iray view in the Viewport but the final render still came out with black eyes.  I changed the Refraction Weight as suggested and it worked. Thank you so much!

  • I'm having this black eye issue and reducing the Refraction Weight of the Eye Moisture has fixed the white part of the eye but my character's Irises are still black. Any other tricks I can try? 

    I also tried the below with no joy:

    1. Shift your scene so the characters are at world origin.
    2. Change the "Instance Optimization" setting.

    Thanks,

    Jayne

  • Thank you, thank you!

    It's first time I encountered this and I was tearing my hair out what's happening.

    Selecting Memory instantly solved the issue. 

    DAZ 4.21/3090

  • crosswindcrosswind Posts: 4,798

    Yea ~ different reason leads to different trick...

  • dtr123dtr123 Posts: 4

    Touching/Reducing "Max Path Length" to 3 or less in [Render-Settings] "Optimization" can cause black eyes. To reset to none or to increase the value fixes it..

  • Select GEN : SURFACES : EyeMoisture

    It is set to GLASS - THIN - CLEAR by default.

    I set mine to "Iray - Liquids - Water Thin" and that fixes it for me and looks a WHOLE lot better.

Sign In or Register to comment.