...making refraction work properly?

kyoto kidkyoto kid Posts: 41,198
edited December 1969 in Daz Studio Discussion

...been working on a scene where I would like a "swimming pool" like water effect. For the last several days been stymied on how to get the refraction settings working right.

What I am trying to achieve is a semi transparent look to the water and get the proper amount of refractive bending for what is underneath the water's surface.

I tried using the "calm water" texture from the Daz 3DShaders, but once I add even a small amount of refraction strength (like .1%) the plane goes completely opaque and all details underneath the surface are lost. Lowering the opacity channel does nothing to help and in some cases, makes the surface plane turn black for some reason.

I could just use a stock water plane but I also lose the transparency and details of what is underneath the surface with them if they have refraction settings or when refraction strength is added.

Comments

  • CypherFOXCypherFOX Posts: 3,401
    edited December 1969

    Greetings,
    I'm sure you've already thought of this, but whenever I hear 'the surface went completely opaque when I did thing...', I think 'try increasing the raytrace depth'. I'm fairly sure that raytrace depth usually needs to be bumped up to handle refraction into and out of objects.

    -- Morgan

  • kyoto kidkyoto kid Posts: 41,198
    edited June 2014

    ...I upped it to 6 and still looks "opaque". Will try doubling that (meaning very slow rendering)

    What I am trying for is an effect similar to the photos below:

    Granted can't get the caustics as Daz studio doesn't support that.

    refraction_2.jpg
    400 x 224 - 26K
    refraction_1.jpg
    640 x 427 - 252K
    Post edited by kyoto kid on
  • LeanaLeana Posts: 11,812
    edited December 1969

    You could get the caustics using a light gel, there are a few packs in the store which do that.

  • SzarkSzark Posts: 10,634
    edited December 1969

    Can post your surface settings and max ray depth of 6 is overkill, 2 will do fine for water.

  • Richard HaseltineRichard Haseltine Posts: 102,291
    edited June 2014

    Try setting refraction to 100% - I haven't tried for ages, but initially I found partial values (over 0 and under 100) unhelpful. Also make sure your index of refraction is right - too high and you won't see anything as the rays are being diverted away from the mesh.

    DS does support caustics, but you have to use a special light, camera and surface created in Shader Mixer so Leana's approach is usually the most practical.

    Post edited by Richard Haseltine on
  • kyoto kidkyoto kid Posts: 41,198
    edited June 2014

    Szark said:
    Can post your surface settings and max ray depth of 6 is overkill, 2 will do fine for water.

    ...here you go:

    I am using a shader created by TJohn which has a calm surface map similar to that found in a pool. I cannot show a final render or screen shot of the image as it is for a challenge.

    settigs.jpg
    911 x 813 - 278K
    Post edited by kyoto kid on
  • kyoto kidkyoto kid Posts: 41,198
    edited December 1969

    Leana said:
    You could get the caustics using a light gel, there are a few packs in the store which do that.

    ...unfortunately too poor at the moment to purchase anything.
  • kyoto kidkyoto kid Posts: 41,198
    edited December 1969

    Try setting refraction to 100% - I haven't tried for ages, but initially I found partial values (over 0 and under 100) unhelpful. Also make sure your index of refraction is right - too high and you won't see anything as the rays are being diverted away from the mesh.

    DS does support caustics, but you have to use a special light, camera and surface created in Shader Mixer so Leana's approach is usually the most practical.


    ...doing a test render now.
  • SzarkSzark Posts: 10,634
    edited June 2014

    I use a Diffuse strength lower than that, normally around 10-20% and Opacity down to 5 - 15% with Refraction on 100%

    EdiT: and shader to Glossy Metal. ;)

    and Multiply Specular though Opacity to OFF. :)

    and which I see you have done...doh!

    Post edited by Szark on
  • LeanaLeana Posts: 11,812
    edited December 1969

    Kyoto Kid said:
    Leana said:
    You could get the caustics using a light gel, there are a few packs in the store which do that.

    ...unfortunately too poor at the moment to purchase anything.I didn't mean that you should purchase anything, simply that it was doable as it had been done for some products. ;)
    I'm pretty sure you can find royalty-free caustics patterns, or even create some yourself.
  • kyoto kidkyoto kid Posts: 41,198
    edited December 1969

    ...the only thing that comes close which I have are the GOBO filters for AoA's advanced spotlight, would have to figure out how flag the light to just illuminate the bottom of the pool. Not sure how to create such an effect on my own.

  • JaderailJaderail Posts: 0
    edited December 1969

    A Gel light in its simplest form is just a Plane with a Diffuse map and a Transparency map placed on it then this plane positioned in front of a Spotlight. Any one can build one if you understand the basics of textures.

  • kyoto kidkyoto kid Posts: 41,198
    edited June 2014

    ...still learning that. Also if it is placed in front of the light, it would have an effect on the scene above the water plane. I need it to only affect what is below the water plane.

    Post edited by kyoto kid on
  • JaderailJaderail Posts: 0
    edited December 1969

    Kyoto Kid said:
    ...still learning that. Also if it is placed in front of the light, it would have an effect on the scene above the water plane. I need it to only affect what is below the water plane.
    Place a Light only under the Water then. Or several if needed. Your not limited to the number of lights used in a scene. And only the AoA lights Add to, With each other I mean, so use what you need where you need it.
  • kyoto kidkyoto kid Posts: 41,198
    edited June 2014

    ...OK looks like I'm getting close to the results I need.

    Set Diffuse strength to 50% (lower made the water look too dark for the scene) and opacity to 25%. Tried using a the skydome map as a reflection map but that seemed give the water a muddy look (due to the clouds) so just went with adjusting the reflection colour.

    Discovered that Refraction Strength percentages below 100% do indeed work as they affect just how much light bending occurs deeper beneath the surface . Found 60% to be good for the depth I am using.

    Now need to add the caustics.

    Post edited by kyoto kid on
  • JaderailJaderail Posts: 0
    edited December 1969

    Kyoto Kid said:
    ...OK looks like I'm getting close to the results I need.

    Set Diffuse strength to 50% (lower made the water look too dark for the scene) and opacity to 25%. Tried using a the skydome map as a reflection map but that seemed give the water a muddy look (due to the clouds) so just went with adjusting the reflection colour.

    Discovered that Refraction Strength percentages below 100% do indeed work as they affect just how much light bending occurs deeper beneath the surface . Found 60% to be good for the depth I am using.

    Now need to add the caustics.

    Tip: You could fake that too... by putting that on your pools textures instead of using Gels or Gobo's.
  • kyoto kidkyoto kid Posts: 41,198
    edited December 1969

    ...I'll have to do that with lighting as the set I am using for the "pool" doesn't have a separate surface zone for the portion that is submerged. Using the Geometry editor would remove all the texture details once I assign the new surface area.

  • JaderailJaderail Posts: 0
    edited December 1969

    Kyoto Kid said:
    ...I'll have to do that with lighting as the set I am using for the "pool" doesn't have a separate surface zone for the portion that is submerged. Using the Geometry editor would remove all the texture details once I assign the new surface area.
    Ah yes, good point. And even a step ahead of my thinking I might add.
  • AndySAndyS Posts: 1,438
    edited December 1969

    Hi,

    let me show the parameters I use.
    (a refraction of 1.37 is what you find in the literature)
    The water displacement map is derived from the Aikanaro environmet delivered together with the DAZ base installation.

    If you use refraction, the opacity parameter doesn't matter anymore. (Opacity gets overwritten by refraction strength)

    I hope it can help.

    Water_w_Refraction.jpg
    1310 x 750 - 194K
  • kyoto kidkyoto kid Posts: 41,198
    edited June 2014

    ...my question is why is there a 67.3% ambient setting? I have the ambient channel set to 0% (0,0,0 colour) I find that increasing the Ambient channel tends to muddy the surface so that the refractive effect is compromised.

    Index of refraction for fresh water is 1.33.

    Also, opacity does not get overwritten by refraction strength as I have tried different opacity settings and I get different results.

    Post edited by kyoto kid on
  • Herald of FireHerald of Fire Posts: 3,504
    edited December 1969

    It's worth noting that moving water has different levels of refraction, which gives it that 'wobbly' effect you would see underwater. I'm not sure how you would go about simulating this in Daz Studio without using multiple water mediums with slightly different IORs all bunched together.

    In fact, one of the challenges I set myself was to try and create this effect in a waterfall using refraction strength maps and layering different waterfall planes with slightly different IORs. The results weren't awful, but neither were they particularly great either.

    I'd be interested to see how your results pan out, and whether anyone can offer a workable solution to creating a water with realistic caustics and refraction.

  • AndySAndyS Posts: 1,438
    edited June 2014

    Kyoto Kid said:
    Also, opacity does not get overwritten by refraction strength as I have tried different opacity settings and I get different results.

    wowho!

    From the moment on, refraction is active (somewhat clearly >0), I could set opacity to what ever I wanted, in the render result wasn't any difference. The resulting opacity only depended on the refraction strength parameter. Except you have opacity at 100%. In the design-mode you see an opacity, what is totally different in the render result. Please keep that in mind.

    With ambient strength and color you're right. But with daylight it gives a special color. And it was a beginner fault of mine. ;-)

    But at all: The render engine doesn't handle the reflection that satisfying, when using refrection too. So I found with that little changed water refraction factor a little better visible reflection.

    I got the "wobbly" effect, as you call it, when I used a more disturbed surface. I'm not quite sure if it depends on using displacement instead of simple bump. Can you see it for the legs of the character in the attached picture? Thus it's not necessary to look for further improvements of DAZ.

    The next challenge was to create the decreasing translucency with increasing depth. Here I used the UberVolume shader of omnifreaker. And it worked well. But be warned: That'll increase render time as hell.

    Example: murky water pond

    refractive_effect.jpg
    697 x 659 - 67K
    Post edited by AndyS on
  • kyoto kidkyoto kid Posts: 41,198
    edited June 2014

    ...that looks very convincing. Also like the "murky pond".

    I don't use UberVolume because of the huge hit it makes on rendering time. I wish I could show the latest test render, however, as this work is for a challenge, I can only post the final version in the challenge thread.

    Post edited by kyoto kid on
  • AndySAndyS Posts: 1,438
    edited December 1969

    Kyoto Kid said:
    I don't use UberVolume because of the huge hit it makes on rendering time.

    as does complex Hair. >:(

    There should be a different product to create foggy environments, what can be used too.
    Any experience with that?

  • kyoto kidkyoto kid Posts: 41,198
    edited June 2014

    ...the only other one I know of is Nerd3D's Fog Tool Deluxe (which I have), but that uses an array of transparency planes to simulate fog that also really slows down render time as well and I don't think it would give the desired effect.

    ...so how do you designate just the space under the water plane as UberVolume?

    Post edited by kyoto kid on
  • AndySAndyS Posts: 1,438
    edited December 1969

    Kyoto Kid said:
    ...the only other one I know of is Nerd3D's Fog Tool Deluxe (which I have), but that uses an array of transparency planes to simulate fog that also really slows down render time as well and I don't think it would give the desired effect.how funny! That's just the way I tried it by myself, before I learnt to use UberVolume. --> Murky by opacity planes

    ...so how do you designate just the space under the water plane as UberVolume?


    I used a little more space below the water surface. UberVolume needs a 3D object (create a primitive cube) as container. Apply the UberVolume to it and turn the opacity to 0. For some reason it didn't work to directly declare the cube surface as the water surface itself.
    But this was some DAZ releases earlier. Possibly the same reason why refraction vs. opacity works different now compared to my "trial and error" experiences.
  • kyoto kidkyoto kid Posts: 41,198
    edited December 1969

    ...well, the UberSurface idea won't work as it crashed 4.6 the moment I started the render. Probably a conflict with the EZ Volume camera I suspect.

  • AndySAndyS Posts: 1,438
    edited December 1969

    :question: What UberSurface you're talking about?

  • kyoto kidkyoto kid Posts: 41,198
    edited June 2014

    ...apologies, UberVolume.

    Again I don't use Uber Environment Effects and Lights all that much because of the heavy demand they make on the render process. I tend to create fairly detailed scenes as well often with multiple characters, props and sets that end up with a fairly high poly count.

    Post edited by kyoto kid on
  • AndySAndyS Posts: 1,438
    edited December 1969

    Ah OK,

    not only the render time was an argument for me from the beginning on to use a simple support light mounted to my camera (corresponding to a support flash in real photography) instead of ambient lighting (UE2).
    I found that ambient light too much smoothes the structural details of the bodies of my characters for example.

    But in some other scenes, the use of ambient light, especially in the IDL mode (indirect lighting - creating a very nice bouncing effect) is to prefer. Depends on the purpose.

    Andy

Sign In or Register to comment.