Final Judgment: NOT an Alpha Channel issue

FractalDimensiaFractalDimensia Posts: 0
edited May 2013 in Carrara Discussion

I am experiencing a shader issue with the alpha channel, and hoping someone might be able to help me understand the problem.

I mapped a pic of a goldfish onto a 3D surface (Image 1). In the shader, I created an alpha map (Image 2). This works and the resulting goldfish looks fine when rendered without the bowl and water (Image 3) or with just the water (Image 4).

But something happens when the fish are rendered with the fishbowl, either with or without water (Image 5). It is like light operates differently when passing through the transparent regions of the map.

Anyone have an idea what is happening?

Thanks for your assistance!

Fishbowl_5.jpg
640 x 480 - 96K
Fishbowl_4.jpg
640 x 480 - 106K
Fishbowl_2.jpg
640 x 480 - 103K
Goldfish_alpha.jpg
1304 x 507 - 127K
Goldfish.jpg
736 x 462 - 63K
Post edited by FractalDimensia on

Comments

  • ManStanManStan Posts: 0
    edited May 2013

    If you are using preset glass/water shaders, check your refraction.
    Also carrara shader for glass and water don't work well on a single sided mesh, make sure your fish bowl has thickness.

    Post edited by ManStan on
  • FractalDimensiaFractalDimensia Posts: 0
    edited December 1969

    ManStan said:
    If you are using preset glass/water shaders, check your refraction.
    Also carrara shader for glass and water don't work well on a single sided mesh, make sure your fish bowl has thickness.

    Thanks, Stan for your thoughts. I finally had some time to pursue this. I was working on how to adjust the Alpha Channel to make it work, so I was definitely barking up the wrong tree! The problem is definitely related to the Refraction setting of the glass.

    Attached are some further renders to help show the effects of the problem.

    1) Fishbowl using "Crystal" refraction. Problem is there.
    2) Fishbowl done in "Crown Crystal" refraction. Problem still there.
    3) Fishbowl done in "Glass" refraction. Problem still there.
    4) Fishbowl using "Crystal" refraction, with the inside of the bowl removed (so no thickness to the material). Problem is there.
    5) Fishbowl using "Crystal" refraction and BACK side of the bowl removed (only behind the fish). Problem is there
    6) Fishbowl using "Crystal" refraction and FRONT side of the bowl removed (glass only behind the fish). PROBLEM NOT THERE.

    The problem seems to be related to:
    1) How light travels through a refracted material and then passes through an object that has an Alpha channel setting. This seems to mess up the ray tracing path as it passes through the object.
    2) Oddly enough, the Water inside the bowl is visible in all of these images, so it seems the refraction qualities of "Water" does not affect the light rays.

    I tried varying "Other value" in refraction setting to values other than 1.00 without any change.
    I tried removing values of all other channels (setting them to none), except for transparency and refraction without any change.
    The problem does not occur when refraction is set to "none."

    So is this a "bug" or am I possibly doing something noob-ish?

    Fishbowl_Crystal_bowl_with_back_removed.jpg
    640 x 480 - 241K
    Fishbowl_Crystal_bowl_with_inside_removed.jpg
    640 x 480 - 259K
    Fishbowl_Glass_bowl.jpg
    640 x 480 - 256K
    Fishbowl_Crown_Crystal_bowl.jpg
    640 x 480 - 256K
    Fishbowl_Crystal_bowl.jpg
    640 x 480 - 255K
  • FractalDimensiaFractalDimensia Posts: 0
    edited December 1969

    Image #6 (No problem when the bowl is behind the fish...)

    Fishbowl_Crystal_bowl_with_front_removed.jpg
    640 x 480 - 235K
  • wetcircuitwetcircuit Posts: 0
    edited December 1969

    Image #6 (No problem when the bowl is behind the fish...)

    Can you recreate the issue using some simple shapes (so you don't need to share your model) that can be submitted in a bug report to DAZ?

    I think they have a 5MB file limit....

  • araneldonaraneldon Posts: 712
    edited December 1969

    It seems that texture maps don't work properly but procedural noise does.

  • cdordonicdordoni Posts: 583
    edited December 1969

    I can't help but to think that some issues with alpha channels are related to Carrara's lack of 16/32 bit per channel. I have heard from some, though not specifically from developers, that Carrara computes internally to more than 8 bits per channel. However, as soon as you add an alpha, you limit part of the computation to 8 bits because Carrara does not handle more than 8 bits (256 levels) in an alpha channel. I suppose the alpha could be interpolated internally to a greater bit depth, but I don't know if this would really work well with all alphas, though for some it might.

    I would welcome some definitive comments from developers on this subject.

  • wetcircuitwetcircuit Posts: 0
    edited December 1969

    cdordoni said:
    I can't help but to think that some issues with alpha channels are related to Carrara's lack of 16/32 bit per channel. I have heard from some, though not specifically from developers, that Carrara computes internally to more than 8 bits per channel. However, as soon as you add an alpha, you limit part of the computation to 8 bits because Carrara does not handle more than 8 bits (256 levels) in an alpha channel. I suppose the alpha could be interpolated internally to a greater bit depth, but I don't know if this would really work well with all alphas, though for some it might.

    I would welcome some definitive comments from developers on this subject.


    I would guess the issue is about render order.... Various layers of transparency and refraction being culled in a certain order and something going "wrong" with that order....

    I also wonder if you used Transparency on the fins with the same index of refraction as the water, if that would work...

  • JoeMamma2000JoeMamma2000 Posts: 2,615
    edited December 1969

    I haven't really read thru the thread to see what the issue is, but my first thought is maybe if you're dealing with refractions and transparencies there might be a render setting that isn't quite right. Maybe the Ray Depth or whatever it's called. Maybe try cranking that up a bit. Looks like you have multiple layers of transparent materials? Might be Ray Depth....

  • cdordonicdordoni Posts: 583
    edited December 1969


    I would guess the issue is about render order.... Various layers of transparency and refraction being culled in a certain order and something going "wrong" with that order....

    I also wonder if you used Transparency on the fins with the same index of refraction as the water, if that would work...

    Yes, if the issue were strictly alpha channel related it would show regardless of the render order. So were are probably looking at multiple factors. I guess we can only speculate ...........

  • WendyLuvsCatzWendyLuvsCatz Posts: 38,232
    edited December 1969

    for what it is worth, I have experienced similar issues trying to add an alpha map to the ocean primitive with some shaders.
    in a bid to make it round for liquid in a container.
    Reflection and index of refraction seems to counter the alpha invisibility.

  • GFHELGFHEL Posts: 24
    edited December 1969

    Been experimenting a bit.
    The alpha rendering improved after I changed the Ray Depth from 4 to 8 In the transparency channel of the water material.

    Water_material.png
    667 x 519 - 88K
    Water_-_transparency_8_rays.png
    320 x 240 - 57K
    Water_-_transparency_default_4_rays.png
    320 x 240 - 58K
  • DartanbeckDartanbeck Posts: 21,583
    edited December 1969

    Just for kicks, try using your alpha map for the fish in the intensity channel of Transparency instead of alpha - and leave the alpha at none. (Drag the image from Alpha channel to Transparecy Intensity setting). If this helps, but doesn't reslove, try using both(?)

    I think that, what's happening, is that the calculations of "What's transparent and what's not" is getting obscured when they are inside one another. Bah... My brain won't let me comunicate. Still sick - still dizzy... I can think - but just can't seem to speek! LOL
    I hope you can piece together what I tried to say - just as an experiment to see if it works.
    I really like your fish, water, and bowl, By the way. Very nicely done!

  • JoeMamma2000JoeMamma2000 Posts: 2,615
    edited December 1969

    GFHEL said:
    Been experimenting a bit.
    The alpha rendering improved after I changed the Ray Depth from 4 to 8 In the transparency channel of the water material.

    Yes, it will. Ray Depth is extremely important when rendering reflective or transparent/refractive surfaces. It tells the renderer how many bounces to calculate when it's ray tracing the transparencies, etc. And if you don't have enough bounces then transparent stuff might not look transparent.

    It seems as though the OP is simulating a bowl with water inside, which means MANY transparent interface surfaces to calculate...air in front of the bowl, outside glass surface, inside glass surface, water surface, then the other inside glass, and the other outside glass then the air behind the bowl. That's a lot of bouncing around and reflecting and refracting, and if you tell the renderer not to calculate all that then stuff won't look right.

    And don't forget, besides the Ray Depth with the materials, there's also a global render setting for Max Ray Depth. And also attenuation. It's real important to understand those settings because they are very often adjusted when rendering transparent/reflective stuff.

  • DartanbeckDartanbeck Posts: 21,583
    edited December 1969

    GFHEL said:
    Been experimenting a bit.
    The alpha rendering improved after I changed the Ray Depth from 4 to 8 In the transparency channel of the water material.
    That's awesome info to have rttling around in my brain pan - just in the case that something like this happens.
  • FractalDimensiaFractalDimensia Posts: 0
    edited May 2013

    Thanks to everyone for the great suggestions! I have not had a chance yet to experiment with all of them, but will over the next day. I did try adjusting the ray depth settings and transparency channel with no/little effect. I'll study them more in depth and report the results. I also simplified the image and was able to reproduce the problem. (Below is done with a simple 4-sided polygon with the fish shader mapped onto it. You can clearly see the edges of the polygon.)

    Maybe I can provide how to reproduce the problem and others can have a go at it if I can't make headway soon.

    Again, THANKS!
    FD

    Bug_Sample.jpg
    640 x 480 - 113K
    Post edited by FractalDimensia on
  • cdordonicdordoni Posts: 583
    edited December 1969

    a few more things to try if you have not already:

    Is the black in your alpha really "0" and not some low non-zero value that appears black?
    Have you turned off "interpolate" to see what happens (it is "on" in your initial screenshot)?
    Have you turned on "premultiplied alpha" (it is "off" in your initial screenshot)?

    Changing Interpolate and premultiplied alpha settings might not make your alpha work the way you want, but it would be useful to know if it affects the way the black is creating the transparency.


    One other thing to try:

    Don't use an alpha, mask your color fish texture map on a WHITE (rgb 255,255,255) background AND turn "on" the "white is invisible" checkbox

  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    cdordoni said:
    a few more things to try if you have not already:

    Is the black in your alpha really "0" and not some low non-zero value that appears black?
    Have you turned off "interpolate" to see what happens (it is "on" in your initial screenshot)?
    Have you turned on "premultiplied alpha" (it is "off" in your initial screenshot)?

    Changing Interpolate and premultiplied alpha settings might not make your alpha work the way you want, but it would be useful to know if it affects the way the black is creating the transparency.


    One other thing to try:

    Don't use an alpha, mask your color fish texture map on a WHITE (rgb 255,255,255) background AND turn "on" the "white is invisible" checkbox

    I gotta disagree on the white is invisible suggestion. Carrara tends to create a bit of halo sometimes. Besides it's absolute. On or off and no in-between. The tail has some transparency judging by the previous images in the thread.


    If you want transparency in the color channel without using the alpha channel, use a format that supports alphas such as Photoshop, png or tiff. Create your transparencies in your image editor of choice, and save it to one of the above formats. Load it into you shader's color channel and any transparencies or partial transparencies will be there.

  • cdordonicdordoni Posts: 583
    edited December 1969

    I gotta disagree on the white is invisible suggestion. Carrara tends to create a bit of halo sometimes. Besides it's absolute. On or off and no in-between. The tail has some transparency judging by the previous images in the thread.


    If you want transparency in the color channel without using the alpha channel, use a format that supports alphas such as Photoshop, png or tiff. Create your transparencies in your image editor of choice, and save it to one of the above formats. Load it into you shader's color channel and any transparencies or partial transparencies will be there.

    Yes that's true, but it may be useful to know if not using the alpha channel results in correct transparency. Of course, it may cause other problems such as the fringe/halo effect.

  • FractalDimensiaFractalDimensia Posts: 0
    edited December 1969

    Okay. I was able to spend some time on this and discovered that cranking up the crystal bowl's ray depth from 4 to 16 fixed the "problem." I also boosted the "Maximum Ray Depth" in the render window to 18. I tried many of the other suggestions offered, but none of those had any effect.

    This was a great learning experience to understand refraction settings!

    Thanks again for everyone's inputs and suggestions!
    FD

    Fishbowl.jpg
    640 x 480 - 102K
  • evilproducerevilproducer Posts: 9,050
    edited December 1969

    Okay. I was able to spend some time on this and discovered that cranking up the crystal bowl's ray depth from 4 to 16 fixed the "problem." I also boosted the "Maximum Ray Depth" in the render window to 18. I tried many of the other suggestions offered, but none of those had any effect.

    This was a great learning experience to understand refraction settings!

    Thanks again for everyone's inputs and suggestions!
    FD


    Glad you got it to work! The render looks very good!


    So, did it increase render time substantially turning up ray depth?

  • DartanbeckDartanbeck Posts: 21,583
    edited December 1969

    Nice job FD! :)

  • FractalDimensiaFractalDimensia Posts: 0
    edited December 1969

    Okay. I was able to spend some time on this and discovered that cranking up the crystal bowl's ray depth from 4 to 16 fixed the "problem." I also boosted the "Maximum Ray Depth" in the render window to 18. I tried many of the other suggestions offered, but none of those had any effect.

    This was a great learning experience to understand refraction settings!

    Thanks again for everyone's inputs and suggestions!
    FD


    Glad you got it to work! The render looks very good!


    So, did it increase render time substantially turning up ray depth?

    I did not notice a big change. I am rendering using two i7 and an i5 computer in 64-bit mode, so the renders don't take very long. But the scene was fairly simple. I am guessing throwing more objects in the scene would likely change that.

  • FractalDimensiaFractalDimensia Posts: 0
    edited December 1969

    Nice job FD! :)

    Thanks, DB. Cranking up the crystal bowl's ray depth tripled the duration time....

    Here is the final render...

    Fishbowl_Final.jpg
    960 x 720 - 225K
Sign In or Register to comment.