Page 1 of 2

dichroic glass

Posted: Tue Mar 17, 2009 5:28 am
by hva
I'm modeling a new building we are designing. Modeling in Blender and going to da final render with Indigo.
It's supposed to have a glass skin treated with a dichroic thin film or coating.
I though maybe indigo would be able to render this kind of material somehow, but I don't really know how. could someone help me pointing me in the right direction?

Posted: Tue Mar 17, 2009 8:53 pm
by hva
I forgot to mention that I used to fake the effect of a dichroic glass in blender rather easily through the use of a magic procedural texture. Of course this can't be the way in Indigo for qhat i can see.

Posted: Tue Mar 17, 2009 9:43 pm
by CTZn
What was the magic of the procedural texture hva ? Based on light or camera angles, or world orientation ? These informations are not accessible via isl (apart maybe the later), they must be taken ("baked" ?) from the host app/exporter to be aknowledged by the Indigo Shading Language; this is an advanced topic, exporter-specific until isl allow such accesses.

Questions regarding your scene:

Do you expect transparency from your dichroic glass ? If yes, how close/accurate ? Or reflections would be enough ?

The most accurate approximation I can imagine right now is a glass with different colors for absorbtion and sub-surface scattering. Scatter should be of a tight spread angle... Either what you might be able to bake the procedural texture and use it on a blended phong, as specular_reflectivity...

all theorical ;)

Posted: Wed Mar 18, 2009 2:34 am
by CTZn
Something around those lines:

Code: Select all

<medium>
	<name>dichrolike_medium</name>
	<precedence>6</precedence>
	<basic>
		<ior>1.393849969</ior>
		<cauchy_b_coeff>0</cauchy_b_coeff>
		<absorption_coefficient_spectrum>
				<rgb>
					<rgb>0.0420953331 0.010 0.03045000076</rgb>
					<gamma>2.200000048</gamma>
				</rgb>
		</absorption_coefficient_spectrum>
		<subsurface_scattering>
			<scattering_coefficient_spectrum>
				<rgb>
					<rgb>3.195000076 16 4.097499847</rgb>
					<gamma>2.200000048</gamma>
				</rgb>
			</scattering_coefficient_spectrum>
			<phase_function>
				<henyey_greenstein>
					<g_spectrum>
				<rgb>
					<rgb>1 0 1</rgb>
					<gamma>1</gamma>
				</rgb>
					</g_spectrum>
				</henyey_greenstein>
			</phase_function>
		</subsurface_scattering>
	</basic>
</medium>

<material>
	<name>previewmaterial</name>
	<specular>
		<transparent>true</transparent>
		<internal_medium_name>dicrolike_medium</internal_medium_name>
	</specular>
</material>
Don't use that material if it's not for real glassery or jewelry, not that it correspond to an existing material but it will not be efficient for exterior shots I fear.

Again it's an approximation, colours are split not based on their wavelenghts but on their nature, absorbed/scattered. Though, the phase_function parameter will dispatch scattering based on wavelenghts (kind of), you may want to experiment with that one. Also you may want to divide scale-dependent parameters by 10 or 100 in that code. Finally, colors are not balanced.

An image with that material is cooking, will post.

Posted: Wed Mar 18, 2009 3:52 am
by cpfresh
can't wait to see this material render ...

Posted: Wed Mar 18, 2009 4:10 am
by CTZn
Eat it crude then :lol: (edit: it's better cooked now)

You can see the effect of the phase function: scattering red and blue components are propagating almost straight inside the medium, while green has a razing scattering angle. Of course both emiters are of plain white emission.

Edit: directly inspired by http://www.indigorenderer.com/joomla/co ... temId=6578

PS: Unlike what I formerly stated, since this shader heavily relies on phase function it can be called "polychroic" (can it actually ?), dichroism is effectively reached because R and B components have the same phase param; It's not simply discriminating between (non) absorbed light and scattered light.

Posted: Wed Mar 18, 2009 6:44 am
by Kram1032
pretty nice test :D

Posted: Wed Mar 18, 2009 7:55 am
by CTZn
I'm currently tweaking the material, depending on results I may upload it in the matDB.

Update:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>

<scenedata>
	<medium>
		<name>dichro_medium</name>
		<precedence>6</precedence>
		<basic>
			<ior>1.393849969</ior>
			<cauchy_b_coeff>0</cauchy_b_coeff>
			<absorption_coefficient_spectrum>
					<rgb>
						<rgb>6 3.5 3</rgb>
						<gamma>2.2</gamma>
					</rgb>
			</absorption_coefficient_spectrum>
			<subsurface_scattering>
				<scattering_coefficient_spectrum>
					<rgb>
						<rgb>11 6 14</rgb>
						<gamma>2.200000048</gamma>
					</rgb>
				</scattering_coefficient_spectrum>
				<phase_function>
					<henyey_greenstein>
						<g_spectrum>
							<peak>
								<peak_min>485</peak_min>
								<peak_width>80</peak_width>
								<base_value>-0.065</base_value>
								<peak_value>0.72</peak_value>
							</peak>
						</g_spectrum>
					</henyey_greenstein>
				</phase_function>
			</subsurface_scattering>
		</basic>
	</medium>
	
	<material>
		<name>previewmaterial</name>
		<specular>
			<transparent>true</transparent>
			<internal_medium_name>dichro_medium</internal_medium_name>
		</specular>
	</material>
</scenedata>
Nearly final, you can save it as an igm file.

Posted: Wed Mar 18, 2009 7:07 pm
by Jambert
Simply Great :)

Posted: Wed Mar 18, 2009 7:08 pm
by cpfresh
CTZn
very very cool! :D

Posted: Wed Mar 18, 2009 8:57 pm
by CTZn
Thanks a lot, Jambert and cpfresh !

I'll look for references now and will try to get a final material. hva, such references would have come in handy :) Perhaps I'll explain what's going on with that peak spectrum then.

How helpfull do you see these materials hva ?

Posted: Wed Mar 18, 2009 10:02 pm
by CTZn
Some investigations:

from http://www.lasercommunity.com/lc_view_p ... php?aid=17 about lasers:
If you really want a beamsplitter, they are available online. Watch out, as some are polarizing (reflect/refract based on the angle of polarization of the laser) while others are dichroic (reflect/refract based on wavelength of light).
wich pointed me to perhaps use tabulated data for phase function, along with another one for ior [edit: scratch the later]...

found this: J-band Dichroic Mirror Transmission Data Table - [link to main page]

Note that the page also contains interesting atmospherical data.

Posted: Thu Mar 19, 2009 5:23 am
by CTZn
Final, or close; I'm not sure about absorbtion:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>

<scenedata>
	<medium>
		<name>dichroic_glass_A_medium</name>
		<precedence>6</precedence>
		<basic>
			<ior>1.39</ior>
			<cauchy_b_coeff>0.0018</cauchy_b_coeff>
			<absorption_coefficient_spectrum>
					<rgb>
						<rgb>1.27 2.45 1.8</rgb>
						<gamma>2.2</gamma>
					</rgb>
			</absorption_coefficient_spectrum>
			<subsurface_scattering>
				<scattering_coefficient_spectrum>
					<rgb>
						<rgb>4.4 3.2 4.8</rgb>
						<gamma>2.200000048</gamma>
					</rgb>
				</scattering_coefficient_spectrum>
				<phase_function>
					<henyey_greenstein>
						<g_spectrum>
						
							<!--peak>
								<peak_min>480</peak_min>
								<peak_width>70</peak_width>
								<base_value>-0.065</base_value>
								<peak_value>0.72</peak_value>
							</peak-->
							
							<regular_tabulated>
								<start_wavelength>0.4E-06</start_wavelength>
								<end_wavelength>0.7E-06</end_wavelength>
								<num_values>6</num_values>
								<values>
								-0.975 -0.8 -0.6 0.6 0.8 0.975
								</values>
							</regular_tabulated>
							
						</g_spectrum>
					</henyey_greenstein>
				</phase_function>
			</subsurface_scattering>
		</basic>
	</medium>
	
	<material>
		<name>previewmaterial</name>
		<specular>
			<transparent>true</transparent>
			<internal_medium_name>dichroic_glass_A_medium</internal_medium_name>
		</specular>
	</material>
</scenedata>
Some more tweakings and I upload it.

Posted: Thu Mar 19, 2009 6:39 am
by PureSpider
UT voice from somewhere: TRI-TRI-TRIPPLE POST!

Really like what you created here :)
Keep it on and finish it ;)

Posted: Thu Mar 19, 2009 1:34 pm
by CTZn
If that wasn't with you I would have beaten my own record right now :twisted: Eeew, I'm tweaking, documenting myself, rendering, pruning renders, learning, eventually spreading knowledge...

Basically reporting, no ;) ?

Note: All these materials should greatly benefit from a very subtle bump mapping, smooth wavy style. If you can displace that, that would be even better. Perfect flat surfaces are so boring !

Code: Select all

<?xml version="1.0" encoding="utf-8"?>

<scenedata>
	<medium>
		<name>dichroic_glass_B_medium</name>
		<precedence>6</precedence>
		<basic>
			<ior>1.48357</ior>
			<cauchy_b_coeff>0.00072487</cauchy_b_coeff>
			<absorption_coefficient_spectrum>
							<regular_tabulated>
								<start_wavelength>0.4E-06</start_wavelength>			<!-- from the beginning of the visible spectrum -->
								<end_wavelength>0.7E-06</end_wavelength>				<!-- to its end -->
								<num_values>20</num_values>						<!-- get 20 samples -->
								<values>											<!-- 5x4 -->
									0 0.01 0.03 0.003 0.0186127
									0.006 0.008 0.1 0.095 0
									0.8639 0.81 0.07983 0.62 0.541978
									0.94 0.007439 0.24 0.000612 0.00624
								</values>
							</regular_tabulated>
			</absorption_coefficient_spectrum>
			<subsurface_scattering>
				<scattering_coefficient_spectrum>
							<regular_tabulated>
								<start_wavelength>0.4E-06</start_wavelength>
								<end_wavelength>0.7E-06</end_wavelength>
								<num_values>10</num_values>
								<values>
									0.2 0.94 0.81 0.62 0 0.1 0.006 0.003 0.01 0
								</values>
							</regular_tabulated>
				</scattering_coefficient_spectrum>
				<phase_function>
					<henyey_greenstein>
						<g_spectrum>							
							<regular_tabulated>
								<start_wavelength>0.4E-06</start_wavelength>
								<end_wavelength>0.7E-06</end_wavelength>
								<num_values>10</num_values>
								<values>
								0.027 -0.25 -0.975 -0.8 -0.96 0.62 0.81 0.094 0.18 0.05
								</values>
							</regular_tabulated>
						</g_spectrum>
					</henyey_greenstein>
				</phase_function>
			</subsurface_scattering>
		</basic>
	</medium>
	
	<material>
		<name>previewmaterial</name>
		<specular>
			<transparent>true</transparent>
			<internal_medium_name>dichroic_glass_B_medium</internal_medium_name>
		</specular>
	</material>
</scenedata>

Code: Select all

<?xml version="1.0" encoding="utf-8"?>

<scenedata>
	<medium>
		<name>dichroic_glass_D_medium</name>
		<precedence>6</precedence>
		<basic>
			<ior>1.72</ior>
			<cauchy_b_coeff>0.0018</cauchy_b_coeff>
			<absorption_coefficient_spectrum>
					<rgb>
						<rgb>1.27 2.45 1.8</rgb>
						<gamma>2.2</gamma>
					</rgb>
			</absorption_coefficient_spectrum>
			<subsurface_scattering>
				<scattering_coefficient_spectrum>
							<regular_tabulated>
								<start_wavelength>0.4E-06</start_wavelength>
								<end_wavelength>0.7E-06</end_wavelength>
								<num_values>10</num_values>
								<values>
									0 -0.25 -0.975 -0.8 -0.6 0.62 0.81 0.94 0.2 0
								</values>
							</regular_tabulated>
				</scattering_coefficient_spectrum>
				<phase_function>
					<henyey_greenstein>
						<g_spectrum>
							<regular_tabulated>
								<start_wavelength>0.4E-06</start_wavelength>
								<end_wavelength>0.7E-06</end_wavelength>
								<num_values>10</num_values>
								<values>
									0 -0.25 -0.975 -0.8 -0.6 0.62 0.81 0.94 0.2 0
								</values>
							</regular_tabulated>
						</g_spectrum>
					</henyey_greenstein>
				</phase_function>
			</subsurface_scattering>
		</basic>
	</medium>
	
	<material>
		<name>previewmaterial</name>
		<specular>
			<transparent>true</transparent>
			<internal_medium_name>dichroic_glass_D_medium</internal_medium_name>
		</specular>
	</material>
</scenedata>
Removed dichroic_glass_E cause it had wrong settings (negative absorbtion).

Would you help render Pure :P ?

edit; more references for dichroic glasses: http://www.worldglassnet.com/pages/appG ... subcat=All

PostS.: I edited previous codes, they weren't matching the matDB naming convention, I think that's better now. Will do a last check before upload.