Heterogeneous participating media tests

General questions about Indigo, the scene format, rendering etc...
User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Heterogeneous participating media tests

Post by OnoSendai » Sun Nov 01, 2009 8:20 pm

So, I've been upgrading the absorption_coefficient_spectrum and scattering_coefficient_spectrum parameters in media to 'proper' parameters, called 'volume parameters'. These can either be constant, (with respect to position), or shaders. In the case of shaders, the shader program can compute more-or-less arbitrary spectra as a function of position.

Here are some tests using a shader to drive the absorption coefficient: (scattering coefficient is zero, so no scattering). There's a cube with IOR 1.0 in the middle of this scene.

Please excuse the noisy renders, I'm working on an old laptop.

Clamped sin wave absorption with phase increasing to the right:
sin_absorption.JPG
sin_absorption.JPG (67.51 KiB) Viewed 9196 times

Code: Select all

<absorption_coefficient>
        <shader>
          <shader>
            <![CDATA[	
						
def eval(vec3 pos) vec3 :
	vec3(
                sin(
                  doti(pos) * 10.0
		)
        )
	]]>
          </shader>
          <wavelength_dependent>false</wavelength_dependent>
        </shader>
Colourful absorption test:
colourful_absorption.JPG
colourful_absorption.JPG (62.24 KiB) Viewed 9201 times

Code: Select all

      <absorption_coefficient>
        <shader>
          <shader>
            <![CDATA[	
						
						def eval(vec3 pos) vec3 :
							vec3(
                  doti(pos) + 1.0,
                  0.0, #doti(pos) + 1.0,
                  1.0 - doti(pos)
              )
						]]>

          </shader>
          <wavelength_dependent>true</wavelength_dependent>
        </shader>
       </absorption_coefficient>

User avatar
WytRaven
Indigo 100
Posts: 905
Joined: Mon Aug 27, 2007 8:24 pm
Location: Dubbo, Australia
Contact:

Re: Heterogeneous participating media tests

Post by WytRaven » Sun Nov 01, 2009 9:58 pm

Oooooh! Nice! :)
:idea: "A foolish consistency is the hobgoblin of little minds..." - Emerson 1841

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Re: Heterogeneous participating media tests

Post by CTZn » Mon Nov 02, 2009 3:54 am

Aaaah yeees !!!

Even though the two examples are only of technical interest there's much more beneath... I can see clouds layers on the first one, and ground fog in the second, yummy
Thanks a lot Ono, how exciting !
obsolete asset

User avatar
Borgleader
Posts: 2149
Joined: Mon Jun 16, 2008 10:48 am

Re: Heterogeneous participating media tests

Post by Borgleader » Mon Nov 02, 2009 4:14 am

I have a little question about this...would it allow something like, a drop of blood in water? (kind of a gore example but, first thing that came to mind after watching the "SAW" game review)
benn hired a mercenary to kill my sig...

User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Re: Heterogeneous participating media tests

Post by OnoSendai » Mon Nov 02, 2009 9:22 am

Borgleader wrote:I have a little question about this...would it allow something like, a drop of blood in water? (kind of a gore example but, first thing that came to mind after watching the "SAW" game review)
Sure.. if you can write the shader for it :)

User avatar
Borgleader
Posts: 2149
Joined: Mon Jun 16, 2008 10:48 am

Re: Heterogeneous participating media tests

Post by Borgleader » Mon Nov 02, 2009 9:29 am

OnoSendai wrote:
Borgleader wrote:I have a little question about this...would it allow something like, a drop of blood in water? (kind of a gore example but, first thing that came to mind after watching the "SAW" game review)
Sure.. if you can write the shader for it :)
We will assimilate someone to do it for us 8) No but seriously cool stuff :)
benn hired a mercenary to kill my sig...

sweetcement
Posts: 22
Joined: Sun Jun 10, 2007 1:35 am

Re: Heterogeneous participating media tests

Post by sweetcement » Fri Nov 06, 2009 11:25 pm

Smoke, clouds, etc. Explosions. Air pollution.

I remember the cloudy sky tests a couple of years ago -- used a noise to simulate clouds, looked pretty good.

What would be really interesting is if we could manipulate index of refraction by position...atmospheric media to simulate the sun getting squashed looking during sunset, etc.

Or an atmospheric gradient that is steeper, so it makes the horizon curve up, like some estimates said would be seen by space probes that landed on Venus.

Or mirages, or simulating the horizon on a flat earth, or a world much larger than earth -- atmospheric refraction would make it look like the world was a shallow bowl, since the rays of light near the horizon would follow curved paths because of atmospheric density gradients.

User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Re: Heterogeneous participating media tests

Post by OnoSendai » Sat Nov 07, 2009 11:23 am

sweetcement wrote:Smoke, clouds, etc. Explosions. Air pollution.

I remember the cloudy sky tests a couple of years ago -- used a noise to simulate clouds, looked pretty good.

What would be really interesting is if we could manipulate index of refraction by position...atmospheric media to simulate the sun getting squashed looking during sunset, etc.

Or an atmospheric gradient that is steeper, so it makes the horizon curve up, like some estimates said would be seen by space probes that landed on Venus.

Or mirages, or simulating the horizon on a flat earth, or a world much larger than earth -- atmospheric refraction would make it look like the world was a shallow bowl, since the rays of light near the horizon would follow curved paths because of atmospheric density gradients.
I don't think I'll allow modification of the IOR anytime soon, because it makes the ray paths non-linear as you said. Although it would allow some cool effects I guess :)

User avatar
psor
1st Place Winner
Posts: 1295
Joined: Sun Jun 25, 2006 1:25 am
Location: Berlin
Contact:

Re: Heterogeneous participating media tests

Post by psor » Sat Nov 07, 2009 11:30 am

OnoSendai wrote:I don't think I'll allow modification of the IOR anytime soon, because it makes the ray paths non-linear as you said. Although it would allow some cool effects I guess :)

What would happen then? :twisted: :wink:




take care
psor
"The sleeper must awaken"

User avatar
OnoSendai
Developer
Posts: 6241
Joined: Sat May 20, 2006 6:16 pm
Location: Wellington, NZ
Contact:

Re: Heterogeneous participating media tests

Post by OnoSendai » Sat Nov 07, 2009 11:52 am

If you allow modification of the IOR, you can simulate stuff like heat haze, mirages etc..

User avatar
benn
Posts: 1046
Joined: Mon Dec 08, 2008 12:47 pm
Location: Wellington, New Zealand
Contact:

Re: Heterogeneous participating media tests

Post by benn » Sat Nov 07, 2009 11:55 am

Could we also hack up relativistic effects with that? ;D Bendy stick renders!

User avatar
psor
1st Place Winner
Posts: 1295
Joined: Sun Jun 25, 2006 1:25 am
Location: Berlin
Contact:

Re: Heterogeneous participating media tests

Post by psor » Sat Nov 07, 2009 11:57 am

@Nik

Well that's what sweetcement said, then you said ...
OnoSendai wrote:I don't think I'll allow modification of the IOR anytime soon, because it makes the ray paths non-linear as you said.

... and then I said ...
psor wrote: What would happen then?
More to read as why wouldn't you wanna allow that. Is there a side effect you want to avoid? :? ;)





take care
psor
"The sleeper must awaken"

User avatar
lycium
Posts: 1216
Joined: Wed Sep 12, 2007 7:46 am
Location: Leipzig, Germany
Contact:

Re: Heterogeneous participating media tests

Post by lycium » Sat Nov 07, 2009 8:39 pm

benn wrote:Could we also hack up relativistic effects with that? ;D Bendy stick renders!
actually, i'm just busy learning about that this evening...

neo0.
Posts: 1784
Joined: Thu Feb 28, 2008 7:11 am
Location: the US of A

Re: Heterogeneous participating media tests

Post by neo0. » Sun Nov 08, 2009 3:07 pm

Will this only be available to people who know ISL?

User avatar
lycium
Posts: 1216
Joined: Wed Sep 12, 2007 7:46 am
Location: Leipzig, Germany
Contact:

Re: Heterogeneous participating media tests

Post by lycium » Sun Nov 08, 2009 3:19 pm

edit: see nick's reply on next page
Last edited by lycium on Sun Nov 08, 2009 5:54 pm, edited 1 time in total.

Post Reply
41 posts

Who is online

Users browsing this forum: Majestic-12 [Bot] and 21 guests