Using medium nodes

Forums: Using medium nodes
Post, discuss and share handy resources like textures, models and HDRI maps in this forum.
Forum rules
Please do not post any material that is copyrighted or restricted from public use in any way. OTOY NZ LTD and it's forum members are not liable for any copyright infringements on material in this forum. Please contact us if this is the case and we will remove the material in question.

Using medium nodes

Postby roeland » Fri Oct 28, 2011 5:14 am

roeland Fri Oct 28, 2011 5:14 am
As of version 1.0 beta 2.55 OctaneRender supports participating media inside objects (absorption, SubSurface Scattering
and emission). These settings are stored in medium nodes, which are attached to the corresponding input pin of diffuse
or specular material nodes.

There are two types of medium nodes, absorption and scattering. Scattering has parameters for absorption and scattering of light passing
through the medium, and emission inside the medium. Absorption is a simple version with only absorption.

Rendering a medium requires the path tracing or PMC kernel, with a sufficiently large maxdepth setting. The direct light kernel
renders an approximation.


Meshes

Participating media should only be added to meshes that define a closed volume, rather than planes. Using planes to model
leaves of a plant with SSS will for instance not work. Using a single plane as ground plane should be OK (it will be treated
as an infinively deep material). The mesh can have opaque objects nested inside, but nested participating media are not supported.

The normals of the mesh must be oriented properly (outwards).

How to make a medium node work

specular.png
material node parameter setup for using medium nodes.


A specular material is the easiest: by default it is set up properly. Transmission must be nonzero;
for the best effect reflection and transmission should be set to 1.0.


On diffuse materials subsurface scattering only works after they are set up with diffuse transmission.
To do so, connect a node to the transmission input pin, or in the node inspector use the drop down box to create a
node (beta 2.58b and later).

The reflection value needs to be set to a sufficiently low value, as only the part of the spectrum that is not reflected can
enter the inside of the object. If the reflection is set to 1.0, all light gets reflected regardless of the transmission value. If
set to 0.0, all light gets transmitted, but this gives an unnatural appearance. Values of 0.1–0.2 are a good starting point.
Also, if the reflection is coloured, the transmitted light will have the complementary color (e.g. if the reflection is set to
yellow, the transmitted light is blueish).

The transmission value works the same as in the previous releases, and is multiplied with the complement of the reflection
spectrum. This should be set to a high value.


Medium node parameters

Absorption is controlled with the absorption texture, which defines how fast light is absorbed
while passing through a medium. A setting of 0.0 means no absorption. The higher the value the faster light is absorbed by
the medium. This setting is wavelength-dependent, in the following setup for example it is set to absorb blue light faster
than other colors, giving the object a yellow appearance.

Textures are restricted to values between 0.0 and 1.0, but the absorption value can have a wider range of values. To allow
setting these values the absorption texture is multiplied with the scale parameter.

absorption settings.png
matball.png


Subsurface scattering is controlled by the scatter texture (multiplied by the scale value),
and the phase function. The scattering texture defines how fast light gets scattered when traveling
through the medium, in a similar way to how absorption is defined. A very high value means light gets scattered very fast, a
value of 0.0 means no scattering.

The phase function controls in what direction light gets scattered. There is currently one kind of phase function defined,
with one parameter, scattering_direction. If set to 0.0, it means light gets scattered the same amount in any direction. A
setting larger than 0.0 means forward scattering, the larger the value, the more light is scattered in a similar direction as
it was traveling. 1.0 means it doesn't change direction. A negative value means backscattering, so more light is scattered
back to where it came from. This makes objects appear brighter on the side where the light is coming from.

The following setup uses a wavelength dependent scattering. Blue light is scattered more, so it has more tendency to scatter
back out of the material before it gets absorbed. Yellow-red light is scattered less, so more of it goes straight through the material,
giving shadowed areas the yellow color.

node settings.png
dragonrender.png


Scattering can generate a lot of noise with small light sources and low roughness. You can increase the caustic_blur parameter
in the kernel settings.

For a fast approximation you can use a specular material with both scattering and fake_shadows enabled.

The unit for absorption and scattering is m^-1 (or 1/m). If you have a measured value in cm^-1 you can convert it to m^-1 by
multiplying it by 100. For example: suppose you want to enter 4.5 cm^-1. This equals 450 m^-1. You can enter this value by
setting the scale to 1000 and the absorption texture to 0.45.

Finally emission is defined by attaching an emission node to the emission input pin. When connecting an emission node to
a medium node, it defines emission inside the volume instead of at the surface of the object. The power parameter gets a
different meaning: it controls how fast the radiance along a ray increases while traveling through the volume, and not the
total power. It is not multiplied with the scale parameter.

This effect works best with large and not too bright objects, very small bright objects will create a lot of noise.

The following image shows a normal mesh emitter (left) and a volume emission (right). The emitter in the right side has specular
material with an index of refraction of 1.0 (making it invisible without the emission).
cube1.png


--
Roeland
Last edited by roeland on Mon Mar 11, 2013 5:20 am, edited 4 times in total.
Reason: Added explanation for the stepsize parameter.
User avatar
roeland
OctaneRender Team
OctaneRender Team
 
Posts: 1808
Joined: Wed Mar 09, 2011 10:09 pm

Re: Using medium nodes

Postby bepeg4d » Fri Oct 28, 2011 8:52 am

bepeg4d Fri Oct 28, 2011 8:52 am
Thanks Roeland for the complete explenation ;)
ciao beppe
User avatar
bepeg4d
Octane Guru
Octane Guru
 
Posts: 9939
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

Re: Using medium nodes

Postby ycarry » Fri Oct 28, 2011 1:23 pm

ycarry Fri Oct 28, 2011 1:23 pm
Thanks Roeland!
ycarry
Licensed Customer
Licensed Customer
 
Posts: 202
Joined: Thu Feb 04, 2010 7:55 pm
Location: France

Re: Using medium nodes

Postby Jaberwocky » Fri Oct 28, 2011 1:32 pm

Jaberwocky Fri Oct 28, 2011 1:32 pm
Cheers Roeland in explaining it.
CPU:-AMD 1055T 6 core, Motherboard:-Gigabyte 990FXA-UD3 AM3+, Gigabyte GTX 460-1GB, RAM:-8GB Kingston hyper X Genesis DDR3 1600Mhz D/Ch, Hard Disk:-500GB samsung F3 , OS:-Win7 64bit
User avatar
Jaberwocky
Licensed Customer
Licensed Customer
 
Posts: 976
Joined: Tue Sep 07, 2010 3:03 pm

Re: Using medium nodes

Postby gabrielefx » Fri Oct 28, 2011 1:45 pm

gabrielefx Fri Oct 28, 2011 1:45 pm
very useful!!

thanks!
quad Titan Kepler 6GB + quad Titan X Pascal 12GB + quad GTX1080 8GB + dual GTX1080Ti 11GB
User avatar
gabrielefx
Licensed Customer
Licensed Customer
 
Posts: 1701
Joined: Wed Sep 28, 2011 2:00 pm

Re: Using medium nodes

Postby cornel » Fri Oct 28, 2011 2:02 pm

cornel Fri Oct 28, 2011 2:02 pm
Great, thanks!

I do have a question regarding the scattering direction.
How does it affect the render in detail?
Win 7 x64 | GTX770 Phantom 2GB | Phenom II X6 3.2GHz | 16GB
User avatar
cornel
Licensed Customer
Licensed Customer
 
Posts: 132
Joined: Sun Nov 14, 2010 11:31 pm
Location: Munich, Germany

Re: Using medium nodes

Postby nuverian » Fri Nov 18, 2011 3:16 pm

nuverian Fri Nov 18, 2011 3:16 pm
I didnt understand a think. Can't get SSS working no matter what..
http://www.nuverian.net
nuverian.deviantart.com
---
i7 920 2.66, 6G RAM, GTX 660 Ti, Win7 64x.
User avatar
nuverian
Licensed Customer
Licensed Customer
 
Posts: 119
Joined: Wed Feb 17, 2010 3:30 pm

Re: Using medium nodes

Postby t_3 » Fri Nov 18, 2011 4:44 pm

t_3 Fri Nov 18, 2011 4:44 pm
cornel wrote:Great, thanks!

I do have a question regarding the scattering direction.
How does it affect the render in detail?

simply said, if scattered to the inside (+1) the material appears darker, if scattered to the outside (-1), the material appears brighter, toned by whatever texture or color is set in the scattering node...

@nuverian: just try to start with a dead simple diffuse or specular material and maybe place some emitters in a way, they help visualizing the effect. just turning on sss on premade materials doesn't work well, and the more textures or other settings are added to a material the harder it is to get it right - it also depends on what to expect from sss; i thought of it before like it was something magical, that you can turn on and -bang- everything looks great... of course it isn't that way ;) often in the final image the effect is hard to spot, but if you do some a/b comparsions, you know the difference (at least talking about common scenes, not the ones especially playing with sss as special effect)...
The obvious is that which is never seen until someone expresses it simply

1x i7 2600K @5.0 (Asrock Z77), 16GB, 2x Asus GTX Titan 6GB @1200/3100/6200
2x i7 2600K @4.5 (P8Z68 -V P), 12GB, 1x EVGA GTX 580 3GB @0900/2200/4400
User avatar
t_3
 
Posts: 2871
Joined: Tue Jul 05, 2011 5:37 pm

Re: Using medium nodes

Postby colorlabs » Sun Nov 20, 2011 6:38 pm

colorlabs Sun Nov 20, 2011 6:38 pm
I just can't get any SSS at all, diffuse or specular, even copying & pasting the settings in these screenshots. Could someone attach some sample scenes where it works?
Mac OS X 10.8.0 | ASUS GTX 580 1.5GB | MSI GTX 470 | ATI Radeon 6870 | Core i7 2.9Ghz | 16GB
colorlabs
Licensed Customer
Licensed Customer
 
Posts: 209
Joined: Sun Aug 08, 2010 2:53 pm

Re: Using medium nodes

Postby t_3 » Mon Nov 21, 2011 1:44 am

t_3 Mon Nov 21, 2011 1:44 am
... i tried to create a scene to give an idea what sss does; it uses the same settings for diffuse and specular materials, which is a bit complicated (because of the very different impact of the transmission color); it's not that exciting, but i'm not a pro in material creation anyway - and it should be simple (as requested) ;)

description of the image:
  • sphere 1: blue diffuse
  • sphere 2: blue diffuse + green transmission
  • sphere 3: blue diffuse + green transmission + sss (most visible on the shadowed side, because light is scattered back and the transmisson color gets less visible)
  • sphere 4: blue specular + green transmission
  • sphere 5: blue specular + green transmission + sss (pretty visible)

by the way, the sss node (same for all materials) uses no textures, but only plain intensities (floattextures): a little absorption, scattering set a little outwards and full scattering.

ps: while changing the scattering ammount and scattering direction values of the scene, the differences should be pretty easy to spot; turning scattering to zero just makes sphere 3 and 5 appear (of course) exactly like 2 & 4.
Attachments
SSStest.png
SSStest.zip
octane scene and object files:
(271.1 KiB) Downloaded 3233 times
The obvious is that which is never seen until someone expresses it simply

1x i7 2600K @5.0 (Asrock Z77), 16GB, 2x Asus GTX Titan 6GB @1200/3100/6200
2x i7 2600K @4.5 (P8Z68 -V P), 12GB, 1x EVGA GTX 580 3GB @0900/2200/4400
User avatar
t_3
 
Posts: 2871
Joined: Tue Jul 05, 2011 5:37 pm
Next

Return to Resources and Sharing


Who is online

Users browsing this forum: No registered users and 7 guests

Tue Mar 19, 2024 6:19 am [ UTC ]