LDraw.org Discussion Forums
POV-Ray: Transparency using fade_color - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html)
+--- Forum: Rendering Techniques (https://forums.ldraw.org/forum-20.html)
+--- Thread: POV-Ray: Transparency using fade_color (/thread-21928.html)



POV-Ray: Transparency using fade_color - Niklas Buchmann - 2016-12-02

Hi everyone!

In Roland's thread POV-Ray export questions, Christoph Lipka suggested using the fade_color mechanism to render transparent objects instead of filter/transmit.

I've been playing around with the settings for a while now and while the results look promising, they are not quite where I would like them to be:
[attachment=2631]

What I think is missing is some 'milkyness' in the transparent parts, some scattering of light inside them to make them glow. This is especially apparent for transparent parts in front of a dark background. Using a scattering media might be a solution, but that only works on hollow objects.

Has anyone else used fade_color before and can give some advice?


RE: POV-Ray: Transparency using fade_color - Roland Melkert - 2016-12-02

(2016-12-02, 15:15)Niklas Buchmann Wrote: What I think is missing is some 'milkyness' in the transparent parts, some scattering of light inside them to make them glow. This is especially apparent for transparent parts in front of a dark background.  Using a scattering media might be a solution, but that only works on hollow objects.
This is what my current settings give.
[attachment=2634]

Code:
#local ldrawPlasticNor=normal {
bumps 0.001
scale 0.5
turbulence 0
};

#local ldrawPlasticFin=finish {
diffuse 1
brilliance 1
conserve_energy

specular albedo 0.1
roughness 0.01

reflection 0.15
};

#local ldrawPlasticTrans_f=0.75;
#local ldrawPlasticTrans_t=0.25;

#local ldrawPlasticTransInt=interior {
ior 3
fade_power 2
fade_distance 10
};


The hardest part is found tweaking is getting transparency good for all colors as especially red and yellow seem to loose their transparency very fast.


RE: POV-Ray: Transparency using fade_color - Niklas Buchmann - 2016-12-02

(2016-12-02, 18:31)Roland Melkert Wrote:
(2016-12-02, 15:15)Niklas Buchmann Wrote: What I think is missing is some 'milkyness' in the transparent parts, some scattering of light inside them to make them glow. This is especially apparent for transparent parts in front of a dark background.  Using a scattering media might be a solution, but that only works on hollow objects.
This is what my current settings give.


Code:
#local ldrawPlasticNor=normal {
bumps 0.001
scale 0.5
turbulence 0
};

#local ldrawPlasticFin=finish {
diffuse 1
brilliance 1
conserve_energy

specular albedo 0.1
roughness 0.01

reflection 0.15
};

#local ldrawPlasticTrans_f=0.75;
#local ldrawPlasticTrans_t=0.25;

#local ldrawPlasticTransInt=interior {
ior 3
fade_power 2
fade_distance 10
};


The hardest part is found tweaking is getting transparency good for all colors as especially red and yellow seem to loose their transparency very fast.

You're still using transmit/filter (which are texture attirbutes) in your example. I want to get rid of a colored texture for transparent parts altogether and use the interior statement to color the parts like this:

Code:
#declare LDXColor46 = material {
    texture {
      pigment {color srgb <1,1,1>        transmit 1        filter 0      }
      finish  { lg_transparent_finish }
      normal  { lg_transparent_normal }
    }
    
    interior {
      ior 1.6
      fade_color srgb <247/255, 241/255, 31/255>
      fade_distance 1
      fade_power 1
    }
}

I like the results of this method a lot, the parts do look more realistic and seem to have more depth. It's just that I'm not happy with the results in all circumstances.


RE: POV-Ray: Transparency using fade_color - Roland Melkert - 2016-12-02

(2016-12-02, 19:38)Niklas Buchmann Wrote: You're still using transmit/filter (which are texture attirbutes) in your example. I want to get rid of a colored texture for transparent parts altogether and use the interior statement to color the parts like this:

Code:
#declare LDXColor46 = material {
    texture {
      pigment {color srgb <1,1,1>        transmit 1        filter 0      }
      finish  { lg_transparent_finish }
      normal  { lg_transparent_normal }
    }
    
    interior {
      ior 1.6
      fade_color srgb <247/255, 241/255, 31/255>
      fade_distance 1
      fade_power 1
    }
}

I like the results of this method a lot, the parts do look more realistic and seem to have more depth. It's just that I'm not happy with the results in all circumstances.
Did not realize that, just when I thought I was done tweaking Smile


RE: POV-Ray: Transparency using fade_color - Roland Melkert - 2016-12-02

(2016-12-02, 19:38)Niklas Buchmann Wrote: I like the results of this method a lot, the parts do look more realistic and seem to have more depth. It's just that I'm not happy with the results in all circumstances.

What about transparent rubber and stacked transparent parts.

Also I don't understand the fade_distance of 1, if I do that instead of 20 I end up with black white transparent plates in the below scene.

[attachment=2637]


RE: POV-Ray: Transparency using fade_color - Niklas Buchmann - 2016-12-05

(2016-12-02, 22:31)Roland Melkert Wrote:
(2016-12-02, 19:38)Niklas Buchmann Wrote: I like the results of this method a lot, the parts do look more realistic and seem to have more depth. It's just that I'm not happy with the results in all circumstances.

What about transparent rubber and stacked transparent parts.

Also I don't understand the fade_distance of 1, if I do that instead of 20 I end up with black white transparent plates in the below scene.

I don't understand the details of how fade_color works either, the results can be pretty unpredictable. That's why I was hoping for some input, but maybe this is the wrong place.

Right now I'm testing using a scattering and absorbing media inside transparent bricks and the results are a lot more consistent. Maybe that's a more viable way.


RE: POV-Ray: Transparency using fade_color - Niklas Buchmann - 2016-12-06

This is the result using media in transparent bricks:

[attachment=2640]