[Bf-cycles] Volume Refraction shader

storm kartochka22 at yandex.ru
Mon Feb 6 21:48:43 CET 2017

В Пн, 06/02/2017 в 00:45 +0200, Mircea Kitsune пишет:
> This is something I've been wanting to get to the developers to for
>> while. It's a feature I hoped to use on several occasions, but 
> unfortunately it doesn't exist nor seems to be in any official plans
> as 
> of yet. Please consider a solution if possible. Thank you.
> Suggestion request: Implementing a volume refraction shader. Either
> by 
> allowing the existing Refraction BSDF to work on the Volume material 
> output, or by defining a new Volume Refraction shader if that is a 
> better approach.
> Suggested functionality: When a ray passes through a volume affected
> by 
> this shader, its trajectory is bent, just like Glass BSDF or
> Refraction 
> BSDF does for surfaces. Optionally, an IOR value may let users
> define 
> the probability and / or angle at which rays have their course
> modified, 
> whereas a Roughness value adjusts how blurry the view gets through
> such 
> a volume... the two ideally operate in an independent way so that 
> refraction and blur can work without one another.
> Purpose 1: The most important practical use of this shader is proper 
> heat haze, emulating the air deformations we see above hot ovens /
> jet 
> engines / roads during summer days. As a workaround, this is already 
> possible to do with render nodes, by rendering your volume as a black
>> white mask on a different render pass then plugging it into the
> Vector 
> input of a Displace node through which the main render is passed. 
> However this is just a workaround that so happens to work: It leads
> to 
> quality loss due to smudging and stretching the render result,
> causes 
> empty spaces if the transformation of the mask warps near an edge,
> is 
> much less realistic compared to the ray actually traveling a
> different 
> trajectory, and might ultimately be slower depending on what 
> calculations are implied.
> Purpose 2: This would allow a greater level of detail for objects
> such 
> as crystals, diamonds, gems, ice crystals, and other types of rough 
> glass. You can already design realistic crystals in Cycles, by 
> customizing the IOR and Roughness of a Glass BSDF or Refraction
> BSDF, 
> causing different spots to refract or blur in different amounts.
> However 
> you can't differentiate such spots volumetrically inside the crystal 
> itself, and can't create rough blurry strands or inner glass pieces
> that 
> have a different refraction angle from others. This can of course be 
> worked around by adding smaller meshes inside the main crystal and 
> giving them different materials, but this technique will cause sharp 
> edges and is less correct and flexible compared to volumes in many
> cases.
> _______________________________________________
> Bf-cycles mailing list
> Bf-cycles at blender.org
> https://lists.blender.org/mailman/listinfo/bf-cycles

It is exactly how is "Phase function" work (it is same as BSDF but for
volume particle, just not very obvious term due historical reason). It
is already implemented, using very common and simple Henyey-Greenstein
equation. Can be controlled by "asymmetric" or "G" parameter in Volume
Scatter node.

One problem it is not depend on wave length, so no rainbow effect, but
it is same with existing refraction and any other node. Another problem
that if you want fata morgana - like thing using it you need to make
"G" factor close to 1 and insane high number of bounces, almost
impossible on home PC.

I have implemented all that in experimental branch, and sometime it
work, but volume noise start cleaning after 8+ hours, as probability of
chained ray paths is very low, (and all that for glass of juice take
tiny fraction of viewport) i even stop posting updated version due it
very CPU expensive and just no one interested. Maybe in 1-2 CPU
generation it will be useful.

If you want to learn more about that matter, google "particle media
scattering", "water droplet phase function"

More information about the Bf-cycles mailing list