iRay Refraction Bugs pt.2

Hi,

 

Allready in the first part (www.daz3d.com/forums/discussion/57352/iray-water-shader-help-needed) I detected, that iRay has serious problems calculating how light and shadow proceed under the water surface.

At the moment I use the normal iRay water shader provided with DAZ4.8 ( with or without dispersion).
Today I rendered a scene with a small mostly shaded waterpool in it and tumbled about some strange light glow in it. So I decided to build a special set where the handling of light and shadow can be studied isolated.

In the attached pictures you see on top an overview of the set. The pool is 4 by 4 meters, 2 meters deep and round 3 eters above it I placed two slim planes (sh1 and sh2) producing well defined shadow zones.

But the render result revealed a desaster for iRay!

In the picture at the bottom left you see the shadow of the shadow-plane 2 (sh2) beginning left on the side of the pool. But it is not directly continued under water, as you would expect. You see the shadow of the rim at the ground and only after a wide gap the shadow of sh2 newly begins.

A different problem is marked with the red circle: How does the shadow of the edge continue below the water level?
OK, this problem is shown really more dramatically in the picture at the bottom right. Here you see how far iRay shifted the shadow (sh2) from the position where it should have been.

I attached the scene file too. So one of you who have got the 4.9 beta can test it and play around with the set.
Up to now I don't have any feedback from the technical support in which release the refaction problems (first thread) would be reworked. Neighter did I find any hint in the release notes.

Or is it only a bug in the iRay water shaders? I really don't have any idea. I tried a lot and followed every hint in the first thread. But nothing helped.

 

Andy

Refraction_Error_iRay.jpg
2000 x 2014 - 395K
duf
duf
Pool iRay.duf
48K

Comments

  • mjc1016mjc1016 Posts: 15,001

    That shadow on the left edge of the pool IS NOT the shadow starting for sh2.  It IS the shadow for that wall of the pool.

    Your light is at a fairly shallow angle...and it looks pretty much correct for that angle of light.

    The other problem...I'm not sure, but I think it is also related to the sidewall and the angle of the light.

  • AndySAndyS Posts: 1,409
    edited January 2016

    Not sure, if whether you got it right.

    On the left floor you see a short part of the shadow from the plane sh2. The light is very steep (Summer, short after high noon). You can try to place an auxiliary solid plane over the pool and you will see.

     

    mjc1016 said:
    The other problem...I'm not sure, but I think it is also related to the sidewall and the angle of the light.

    Yea, but shouldn't the shadow not directly continue, only changing the angle at the water surface?

    So - I inserted some auxiliar lines, showing the relation between shadowing planes and the resulting shadows.

    Refraction_Error_iRay aux.jpg
    1000 x 700 - 48K
    Post edited by AndyS on
  • mjc1016mjc1016 Posts: 15,001
    edited January 2016

    I'm using your pic here...

    The lines I added ar where the shadows would connect to the existing shadow.  The light on the lower corner of the pool is about the right angle to produce that configuration, especially if the IOR is higher than 1.33...

    3eb1e419dde2a514f31bcce53f6de0.jpg
    1000 x 700 - 105K
    Post edited by mjc1016 on
  • AndySAndyS Posts: 1,409
    edited January 2016
    mjc1016 said:
    The lines I added ar where the shadows would connect to the existing shadow.

    Yes.

    My question is, if the shadow already begins on the floor outside the left side of the pool and the shadowing plane is solid up to its end, where does the sunlight in front of the shadow on the ground of the pool come from?
    That region, I marked as a gap "??" in the that picture of the opening post.

    But if you see the shadowlines in the red circle of the bottom left picture of the opening post, you can estimate that iRay don't take the level of the water surface into account. It calculates the shadow of the under water region as if even the shadowing object was within that same refractive medium. For the calculation of the shadow they forgot, that the index of refraction changes at the water surface from 1 to 1.33. They only calculated all the way with 1.33 (red lines).

     

    And following the optical priciples, the rays have to be broke down, not up!
    But because we look from above, the refraction of the rays is neutralized by the way, the light takes back into our eys, the shadowline on the edge (red circle in the first post) should be a streight line over and under water. But as you see, in the iRay render it is not.

    So I ask myself how DAZ dares to announce the version 4.9.0.61 a release candidate, if such desastrous bugs are not solved.
    Couldn't find anything related in the release notes.

    Refraction_Error_iRay aux2.jpg
    1000 x 582 - 50K
    refract.jpg
    1056 x 658 - 54K
    Post edited by AndyS on
  • Arnold CArnold C Posts: 740

    Spot Light (Light Geometry: Disc, Weidth/Heigth: 10.00, Spread Angle: 4.00, Luminous Flux: 12000) over a  2x2 m Plane Primitive into a 1x2 m cube out of water with an IOR of 1.3333, at an incident angle of 45°. Regarding "Snell's Law" the lightrays would have to be refracted at an angele of 32° towards the Normal. Refusing being refracted, the lightrays travel happily ever after straight forward as if they'd still travel through a vacuum.

    Refraction Test.jpg
    1920 x 1080 - 171K
  • Arnold C said:

    Spot Light (Light Geometry: Disc, Weidth/Heigth: 10.00, Spread Angle: 4.00, Luminous Flux: 12000) over a  2x2 m Plane Primitive into a 1x2 m cube out of water with an IOR of 1.3333, at an incident angle of 45°. Regarding "Snell's Law" the lightrays would have to be refracted at an angele of 32° towards the Normal. Refusing being refracted, the lightrays travel happily ever after straight forward as if they'd still travel through a vacuum.

    Caustic sampler?

  • AndySAndyS Posts: 1,409

    Hi Takeo,

    that's the crazy point: In the case of light down into water, Caustic Sampler ON/OFF doesn't matter. Perhaps there is the first part of the bug.
    For the direction out of the water, there is a difference, as I'm going to show later.

  • AndyS said:
    In the case of light down into water, Caustic Sampler ON/OFF doesn't matter.

    Something just occurred to me; is the water surface smooth or is there a bump, normal or displacement applied? The reason for the appearance of caustics at the bottom of the pool is because the top surface is irregularly wavy, and the angle between light beams and the water surface is all over the place. If it isn't, then there's only straightforward refraction at a single angle over the whole top surface.

  • AndySAndyS Posts: 1,409
    edited February 2017

    The problem is, I never saw the caustic sampler create the varying intensity due to interference. Not in reflection, nor in lighter and darker zones on the ground due to a wave structured surface.
    At the moment caustic sampler only should create a more correct proceeding of the light through refractive volumes.

    I say "should", cause I can demonstarte, that it does not in all the situations it really should.

    But at the moment I've got a different problem by the render not progressing for over one hour being stuck at 4.9% from 40 to 3078 iterations so I broke it up.

    non-Progress.jpg
    356 x 1924 - 155K
    Post edited by AndyS on
  • AndySAndyS Posts: 1,409
    edited February 2017

    Now I can show the summary for light/shadow entering into the water and proceding out of the water.

    As a reference the first picture shows the situation in reality. And we see, the shadowline appears as a straight line.

    The first render shows the light proceeding from above into the water. Comparing with real live physics, the render shows 2 mistakes.
    At the water level there is a big gap of the shadowline (red arrow).
    Under the water surface the light proceeds in a lower angle.
    For this render it doesn't matter whether the caustic sampler was switched on or off.

    Next follows the light proceeding in the opposite direction: upwards out of the water.
    Under water I positioned a spotlight and a plane creating a shadowline.
    First the caustic sampler was switched off; second it was switched on.

    We see, that the caustic sampler causes the gap in the shadowline to disappear, but the light still doesn't proceed in a straight line.
    So there still's something wrong in the usage of the IOR in the interface from DAZ to the render engine.

    Refraction in Real.jpg
    2456 x 1632 - 112K
    refraction_check_iray_2_by_andysanderson-d9ox34z.jpg
    894 x 894 - 83K
    Test Refraction backwards Setup.jpg
    497 x 447 - 40K
    Test Refraction backwards Caustics off.jpg
    600 x 540 - 98K
    Test Refraction backwards Caustics on.jpg
    600 x 540 - 111K
    Post edited by AndyS on
  • Arnold CArnold C Posts: 740
    edited February 2017
    Arnold C said:

    Spot Light (Light Geometry: Disc, Weidth/Heigth: 10.00, Spread Angle: 4.00, Luminous Flux: 12000) over a  2x2 m Plane Primitive into a 1x2 m cube out of water with an IOR of 1.3333, at an incident angle of 45°. Regarding "Snell's Law" the lightrays would have to be refracted at an angele of 32° towards the Normal. Refusing being refracted, the lightrays travel happily ever after straight forward as if they'd still travel through a vacuum.

    Caustic sampler?

    Except that the reflection from the water's surface is better visible, the caustic sampler doesn't make any difference. As does "Thin Walled". Or "Glossy Color Effect" mode... or any other material surface or Render Settings parameter. frown 

    Post edited by Arnold C on
  • Takeo.KenseiTakeo.Kensei Posts: 1,303
    edited February 2017
    AndyS said:

    Hi Takeo,

    that's the crazy point: In the case of light down into water, Caustic Sampler ON/OFF doesn't matter. Perhaps there is the first part of the bug.
    For the direction out of the water, there is a difference, as I'm going to show later.

    It should and without that, light is not bent properly. BTW I'm not sure your examples are correct and you seem to focus too much on theses shadows. As some great man said, beware of the dark side. If once you start down the dark path, forever will it dominate your destiny, consume you it will.

    Anyway, more seriously, I think it works. You don't necessarily need the caustic sampler but it introduces a subtle change that make it more realistic

    See the included pics. The scene is made of objects on a cube of liquid and one distant light. The liquid is rendered once with IOR = 1 and once with IOR = 1.37

     

     

    Arnold C said:
    Arnold C said:

    Spot Light (Light Geometry: Disc, Weidth/Heigth: 10.00, Spread Angle: 4.00, Luminous Flux: 12000) over a  2x2 m Plane Primitive into a 1x2 m cube out of water with an IOR of 1.3333, at an incident angle of 45°. Regarding "Snell's Law" the lightrays would have to be refracted at an angele of 32° towards the Normal. Refusing being refracted, the lightrays travel happily ever after straight forward as if they'd still travel through a vacuum.

    Caustic sampler?

    Except that the reflection from the water's surface is better visible, the caustic sampler doesn't make any difference. As does "Thin Walled". Or "Glossy Color Effect" mode... or any other material surface or Render Settings parameter. frown 

    In fact there is one parameter that makes a big difference. I'll let you find it in the attached pics :)

     

    iray water refr 01.JPG
    1813 x 905 - 128K
    iray water refr 02.JPG
    1815 x 906 - 140K
    Post edited by Takeo.Kensei on
  • Arnold CArnold C Posts: 740
    edited February 2017

     

    AndyS said:

    Hi Takeo,

    that's the crazy point: In the case of light down into water, Caustic Sampler ON/OFF doesn't matter. Perhaps there is the first part of the bug.
    For the direction out of the water, there is a difference, as I'm going to show later.

    It should and without that, light is not bent properly. BTW I'm not sure your examples are correct and you seem to focus too much on theses shadows. As some great man said, beware of the dark side. If once you start down the dark path, forever will it dominate your destiny, consume you it will.

    Anyway, more seriously, I think it works. You don't necessarily need the caustic sampler but it introduces a subtle change that make it more realistic

    See the included pics. The scene is made of objects on a cube of liquid and one distant light. The liquid is rendered once with IOR = 1 and once with IOR = 1.37

     

     

    Arnold C said:
    Arnold C said:

    Spot Light (Light Geometry: Disc, Weidth/Heigth: 10.00, Spread Angle: 4.00, Luminous Flux: 12000) over a  2x2 m Plane Primitive into a 1x2 m cube out of water with an IOR of 1.3333, at an incident angle of 45°. Regarding "Snell's Law" the lightrays would have to be refracted at an angele of 32° towards the Normal. Refusing being refracted, the lightrays travel happily ever after straight forward as if they'd still travel through a vacuum.

    Caustic sampler?

    Except that the reflection from the water's surface is better visible, the caustic sampler doesn't make any difference. As does "Thin Walled". Or "Glossy Color Effect" mode... or any other material surface or Render Settings parameter. frown 

    In fact there is one parameter that makes a big difference. I'll let you find it in the attached pics :)

    Found! smiley

    The parameter you're talking about is "Refraction Color". A simplified method to mimic a material's transmission optical properties without having to use MDL's volume distribution functions (DAZ Iray Uber's "Volume" Group parameters).

    I did another render of the above scene, this time with Caustics Sampler on, and also with a "Refraction Color" of 0.993779, 0.999526, 0.999908 [RGB 254-255-255] which considers the water's transmission optical properties based on data from R. M. Pope and E. S. Fry, "Absorption spectrum (380-700nm) of pure water. II. Integrating cavity measurements," Appl. Opt., 36, 8710--8723, (1997).

    With the Caustics Sampler to On you now better notice the rays of the light being reflected from the surface in the upper left quadrant, but still no refraction occuring to the lightrays travelling through the water cube in the upper right quadrant. What we should observe is the phenomenon shown in the attached picture. What we can observe is that we can't observe something even close happening.


    UPDATE:

    Snell's Law seems to come into account when setting "Thin Walled" to Off, even with a Transmitted Color of default 0.00 black. It seems, having "Refraction Weight" active disables the regular transmission calculations, or else any light entering the cube would be completely being absorbed on the first millimeter (default Transmitted Measurement Distance of 0.1).

    The lightrays within the volume won't be visible this way, but the bundle of those leaving it looks like to have been shifted downwards in my 3rd test render. Drawing some helplines indicate that the lightray bundle had been first refracted towards the normal, and when it leaves the volume is again refracted away from the normal due to the lower IOR of the surrounding air/vacuum.

    For that experiment I reduced the size of the water volume to a cube of 0.5 x 1 m to have the outbound rays of light flowing over the plane primitive.

    Refraction Test 2.jpg
    1920 x 1080 - 488K
    Refraction_photo.png
    800 x 532 - 208K
    Refraction Test 3.jpg
    1920 x 1080 - 226K
    Post edited by Arnold C on
  • prixatprixat Posts: 1,299

    I have not tried to visualise the beam through the block yet. That may be possible with Volumetrics, but who knows if refraction and volumetrics can be combined!

    I noticed another problem similar to the shadow not refracting properly.

    Look at the faint reflection of the spot on the glossy floor. When the beam is refracted to its new position that reflection remains where it was.

    I'm putting both of these down to the relative immaturity of the renderer. Does anyone know how Octane copes with these 'render order' problems?

    nocube.jpg
    987 x 726 - 177K
    Untitled-2.jpg
    972 x 726 - 372K
  • AndySAndyS Posts: 1,409
    edited February 2017

    So,

    really nice, that this thread got alive again. smiley
    Very early I already had a set with a prisma. And it really looked as if the render was correct. The light leaves the prisma at the correct location. I only wasn't able to visualize the ray within the prisma. At least iRay calculated the way of the light outside the refractice medium correctly.
    In the attached picture I visualized the prima itself by using the surface selector.

    Because whether using the Caustic Filter or not, using the pool setup of my post above, there still is the problem that the shadowline "jumps". It continues under water some distance afar. Really no idea why?

    Prisma w Spot 1.jpg
    508 x 455 - 26K
    Post edited by AndyS on
  • AndySAndyS Posts: 1,409
    edited February 2017

    Having found a somehow correct light propagation, there are two other strange effects not really fitting to the results above.

    1. Shadowline broken
    Why does the shadow continue under water only that far shifted (red arrow)?

    2. Dark Water
    Why suddenly turns the water dark, if the angle of the light only lowers 1° below a mysterious limiting angle?

    The angles are 51° and 50° hight above horizon.
    Already in the first picture you see at the right corner an appearing "dark zone". The question really is what DAZ and the render engine calculate for the refracted light into and the re-refracted information coming back out of the refractive medium into our camera. indecision

    Post edited by AndyS on
Sign In or Register to comment.