Heterogeneous participating media tests

General questions about Indigo, the scene format, rendering etc...
User avatar
Borgleader
Posts: 2149
Joined: Mon Jun 16, 2008 10:48 am

Re: Heterogeneous participating media tests

Post by Borgleader » Fri Jan 08, 2010 11:50 am

suvakas wrote:That glass render looks awesome !! :)
That is one sick glass indeed, I wonder if your drink tastes better in it? :lol:
benn hired a mercenary to kill my sig...

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 Jan 11, 2010 1:21 am

Me face amazed !

That is really, really a nice thing to me !

And thanks for the ISL examples... but function declaration has changed for 2.4, isn't it ?

Little digression then, what's planned for an ISL documentation ? I'd gladly help, at least to motivate it ;)

ISL potential is immense, there must be a proper guide to initiate the clever mind.
obsolete asset

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 Oct 18, 2010 1:27 pm

I can't get this shader to work with 2.6.1(http://www.indigorenderer.com/forum/vie ... 268#p86268):

Code: Select all

<medium>
	<name>indigoShader1_medium</name>
	<precedence>6</precedence>
	<basic>
		<ior>1</ior>
		<cauchy_b_coeff>0</cauchy_b_coeff>
		<absorption_coefficient_spectrum>
				<rgb>
					<rgb>0.8000000119 0.8000000119 0.8000000119</rgb>
					<gamma>2.200000048</gamma>
				</rgb>
		</absorption_coefficient_spectrum>
		<subsurface_scattering>
			<scattering_coefficient_spectrum>
				<shader>
					<wavelength_dependent>false</wavelength_dependent>
					<shader>
						<![CDATA[
							def eval(vec3 pos) vec3 :
							   vec3(
							                if(
							                  dist(pos, vec3(0.0, 1.5, 1.5)) < 0.6,
							                  2.0,
							                  0.0
							                 )
							     )
						]]>
					</shader>
			</shader>
		</scattering_coefficient_spectrum>
			<phase_function>
				<uniform/>
			</phase_function>
		</subsurface_scattering>
	</basic>
</medium>
<material>
	<name>indigoShader1SG</name>
	<specular>
		<transparent>true</transparent>
		<internal_medium_name>indigoShader1_medium</internal_medium_name>
	</specular>
</material>
I know it is under positional constraints but Indigo rejects the 'shader' tag in the first place. What am I doing wrong ?

The glass shader in the linked page works, only that colors are not blending for me...
obsolete asset

User avatar
fused
Developer
Posts: 3600
Joined: Fri Sep 22, 2006 7:19 am
Location: Berlin, Germany
3D Software: Cinema 4D

Re: Heterogeneous participating media tests

Post by fused » Mon Oct 18, 2010 1:46 pm

Hey CTZn,

when using shaders for scattering it is

Code: Select all

      <subsurface_scattering>
        <scattering_coefficient>
          <shader>
            <wavelength_dependent>false</wavelength_dependent>
            <shader>
              <![CDATA[ ... ]]>
            </shader>
          </shader>
        </scattering_coefficient>
        <phase_function>
          <uniform />
        </phase_function>
      </subsurface_scattering>
not

Code: Select all

      <subsurface_scattering>
        <scattering_coefficient_spectrum>
          <shader>
            <wavelength_dependent>false</wavelength_dependent>
            <shader>
              <![CDATA[ ... ]]>
            </shader>
          </shader>
        </scattering_coefficient_spectrum>
        <phase_function>
          <uniform />
        </phase_function>
      </subsurface_scattering>
same goes for <absorption_coefficient>.

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 Oct 18, 2010 3:01 pm

Oh, new tags ! Thanks a lot fused, I overlooked this "detail".
obsolete asset

User avatar
arc en ciel
Posts: 138
Joined: Tue Apr 12, 2016 2:33 am

Re: continous blend between three different

Post by arc en ciel » Wed Jun 15, 2016 4:06 am

OnoSendai wrote:In this image, a volumetric shader is controlling the absorption of the glass medium.
It's basically a continous blend between three different absorption colours.
The medium looks like this:

Code: Select all

<medium>
        <name>MedIndigo Material_mid0</name>
        <precedence>10</precedence>
        <basic>
            <ior>1.600000</ior>
            <cauchy_b_coeff>0.000000</cauchy_b_coeff>
            <absorption_coefficient>

              <shader>
                <wavelength_dependent>true</wavelength_dependent>
                <shader>
                  <![CDATA[
                  
                    def col(real t) vec3 :
                    
                      if(
                        t < 0.5,
                        lerp(
                          vec3(100.0, 100.0, 1.0), # blue
                          vec3(1.0, 100.0, 100.0), # red
                          smoothstep(0.25, 0.35, t)
                         ),
                         lerp(
                          vec3(1.0, 100.0, 100.0), # red
                          vec3(1.0, 1.0, 100.0), # yellow
                          smoothstep(0.65, 0.75, t)
                         )
                        )
                      
                     def eval(vec3 pos) vec3:
                         col(e2(pos) * 6.0)
                         
                         # + fbm(pos * 100.0, 6) * 0.5
                  ]]>
                </shader>
              </shader>
            </absorption_coefficient>
        </basic>
    </medium>

hi,

i did some images using the code above, I changed value color for smallest, and tweak smoothstep

what real t is ?
how / where is describe color's model precisely ?
what smoothstep is doing exactly ?

all rendering on i7 2.4 ghz ang gpu 780M :

from left to right, textures on mesh : specular, blended specular/Fast SSS, fast SSS
GPU_4m30_1130spp_2105ksps
Image

BiDir_32m_2678spp_662ksps
Image

all fast SSS mat
GPU_20m_860spp_945ksps
Image
GPU_2m25_607spp_2091ksps
Image
recette :
Image

thx, and happy rendering :D

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

Re: Heterogeneous participating media tests

Post by CTZn » Sat Jun 18, 2016 6:30 am

The col function takes the third component e2() from the position in 3D pos being sampled for input, that is the upwards z vector e2(pos) (counting from element zero).

Smoothstep is just a nicer ramp, aka smooth ramp, as opposed to linear color change. It is used here for remapping purposes based on the z value the function is fed with. I'll leave it here :)

e: by the way thanks this is useful code I was reluctant to figure out, wherever it came from (e: oh yeah from above like all things ;D)!
obsolete asset

User avatar
arc en ciel
Posts: 138
Joined: Tue Apr 12, 2016 2:33 am

Re: Heterogeneous participating media tests

Post by arc en ciel » Sun Jun 19, 2016 1:53 pm

thank's you very much, CTZn, for explanations, I really appreciate.

do you know that your Passionated http://www.indigorenderer.com/materials/materials/1005 is bugging in gpu mode :
GPU path tracing initialisation failed: clBuildProgram failed: CL_BUILD_PROGRAM_FAILURE

StompinTom
Indigo 100
Posts: 1821
Joined: Mon Sep 04, 2006 3:33 pm

Re: Heterogeneous participating media tests

Post by StompinTom » Sun Jun 19, 2016 10:41 pm

Awesome stuff :)

With regard to volume data, OpenVDB (http://www.openvdb.org/) seems to be used a lot. I think the Blender crowd is looking at implementing it in some way. Haven't read into it too much yet, though, so may not be applicable...

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

Re: Heterogeneous participating media tests

Post by CTZn » Wed Jun 22, 2016 2:01 pm

arc en ciel wrote:thank's you very much, CTZn, for explanations, I really appreciate.

do you know that your Passionated http://www.indigorenderer.com/materials/materials/1005 is bugging in gpu mode :
GPU path tracing initialisation failed: clBuildProgram failed: CL_BUILD_PROGRAM_FAILURE
My materials are getting old, I should review them thank you.
obsolete asset

StompinTom
Indigo 100
Posts: 1821
Joined: Mon Sep 04, 2006 3:33 pm

Re: Heterogeneous participating media tests

Post by StompinTom » Wed Jun 29, 2016 8:57 pm

More detail on Blender + OpenVDB: https://wiki.blender.org/index.php/User ... BRendering

Would be awesome to have support for it, it seems to be gaining traction as a volume format for all sorts of things.

Post Reply
41 posts

Who is online

Users browsing this forum: No registered users and 2 guests