Blue Acrylic Appearing Purple

Announcements, requests and support regarding SkIndigo - the Sketchup / Indigo exporter.
ieatfish
Posts: 127
Joined: Sun Jan 31, 2010 5:29 pm

Blue Acrylic Appearing Purple

Post by ieatfish » Wed May 12, 2010 6:53 am

I'm attempting to make a simple transparent blue acrylic material. You can see the target here: http://www.tapplastics.com/shop/product.php?pid=341& It's the darker of the blues. 1/4" thick and the IOR is 1.49.

The issue is no matter what I do, it renders as a bright violet color. Even when I set the RGB sliders to full Blue in Sketchup, it comes out with any internal reflections as a purple color. I've tried using specular, glossy transparent, and a few other options. I can get a nice purple, a nice cyan, and any other color but I can't seem to get a nice solid deep blue that doesn't have purple. Lighting doesn't seem to affect it either.

Here is an example of what it looks like. In Sketchup, material is a Specular, RGB sliders full on blue only, and 60% opacity.

Image
Intel Core-i7 @ 4.0 GHz | GTX 580 | 12 GB RAM

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

Re: Blue Acrylic Appearing Purple

Post by StompinTom » Wed May 12, 2010 7:09 am

Check your white balance. Blue isn't blue under certain white balances. RGB values aren't universal, they get translated within the renderer.

ieatfish
Posts: 127
Joined: Sun Jan 31, 2010 5:29 pm

Re: Blue Acrylic Appearing Purple

Post by ieatfish » Wed May 12, 2010 7:24 am

StompinTom wrote:Check your white balance. Blue isn't blue under certain white balances. RGB values aren't universal, they get translated within the renderer.
Thanks for the advice. I tried rendering with the white balance at ~5000 and 5500 using just the sun for lighting and it still has that purple tint. Maybe the material itself has the issues but I've tried so many combinations. The closest I've gotten to what I was looking for is the Sapphire gemstone material in the Library. But it was much too dark and I couldn't figure out how to make it lighter. :? I don't know why this is being so frustrating, lol. Every other color translates very well from Sketchup to Indigo.
Intel Core-i7 @ 4.0 GHz | GTX 580 | 12 GB RAM

User avatar
galinette
1st Place Winner
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Re: Blue Acrylic Appearing Purple

Post by galinette » Wed May 12, 2010 7:52 am

I'm pretty sure this is the explanation.

When colouring a specular transparent material, sketchup uses the medium absorption. It sets it to an absorption colour complementary to the colour you set (blue > complementary is yellowish). Because if you absorb yellow, the remaining light is blue. But...

That means the color effect is volumetric, and depends of the size of your object (which is the distance of light paths through the object). Light is not coloured when crossing the surface (like with "absorption layer transmittance colour", translated in sketchup by "surface colour") but when passing through the medium.

Blue light is a quite pure color from a spectral point of view : it must contain only low wavelengths to appear blue). That means, all non-blue light must be absorbed when passing through the object. If your object is not thick enough, there is still some red light remaining when light goes out, making it appear purple. Skindigo is not able to forecast this, as its material editor does not takes object size into account.

To conclude : your object is pink, because:
- It's not thick enough
- The absorption coefficient is not big enough
- Skindigo is stupid, because it tryes to convert an absorption amount (in %) to an absorption coefficient (in m^-1) which is phisically impossible if you do not take the mean object size into account.
- Making absorbing media is tricky. Most of the time RGB values are not enough, you have to tweak absorption spectra. Because usual RGB > spectral conversion generates some fat absorption peaks, and you will either end up with a pink object (thin) or a very dark blue one (thick). A good example is ruby or sapphire gems : it's impossible to have the color effect correctly rendered without entering absorption spectrum
- If you use surface absorption instead of medium absorption, the effect may be less appealing (this is usually not physically correct) but for thin objects this is much more simple to control color and transparency.

To conclude : for strong medium absorption, RGB usually sucks. You can't get all the material effects as in reality. This is one of the big advantage of Indigo : you can provide spectral absorption data. And make nice looking real glass for instance.

Bla bla bla.... (sorry for the long post)
Eclat-Digital Research
http://www.eclat-digital.com

ieatfish
Posts: 127
Joined: Sun Jan 31, 2010 5:29 pm

Re: Blue Acrylic Appearing Purple

Post by ieatfish » Wed May 12, 2010 8:42 am

Wow, you must have been formulating that reply before I even posted my question. :lol:

Thanks for the info! So now I need to go on a hunt for some spectral data, it seems. Or use surface absorption.
Intel Core-i7 @ 4.0 GHz | GTX 580 | 12 GB RAM

User avatar
galinette
1st Place Winner
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Re: Blue Acrylic Appearing Purple

Post by galinette » Wed May 12, 2010 9:20 am

Part of my professionnal work is consists in playing with spectrometers and absorbing materials (real ones, not computer graphics) so I had the main elements of my post in mind for some time :)

Another example is sunlight passing through atmosphere. During the day, you have white sunlight, because light passes through a thin layer of air. At sunset, it goes red (thick layer of air). But at intermediate times, it's not a color between white and red but a different color (yellow).

This shows you that by setting a medium to be red, you can end up with a yellow object. You're experiencing a similar problem.

Here is a quick render showing well the phenomenon:
test.jpg

To make a blue medium, you can try this in your material code (hands in notepad required...)
Replace the "1.0"s by a higher value (more opacity) or a lower one (less opacity) if required.
Increase the "0.0"s and lower the "1.0"s to desaturate the material.

Code: Select all

            <absorption_coefficient_spectrum>
                <regular_tabulated>
                    <start_wavelength>0.38E-06</start_wavelength>
                    <end_wavelength>0.78E-06</end_wavelength>
                    <num_values>41</num_values>
                        <values>
                           1.0
                           1.0
                           1.0
                           0.0
                           0.0
                           0.0
                           0.0
                           0.0
                           0.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                        </values>
                </regular_tabulated>
            </absorption_coefficient_spectrum>
 
Eclat-Digital Research
http://www.eclat-digital.com

ieatfish
Posts: 127
Joined: Sun Jan 31, 2010 5:29 pm

Re: Blue Acrylic Appearing Purple

Post by ieatfish » Wed May 12, 2010 9:28 am

Okay, I understand that in a general sense, but I don't quite understand how to use it in a material. Also, why are there that many values? Thanks for the help, by the way. I'm having a custom computer case built for me and it involves some of this blue acrylic.

I've been using the Inidgo Material Editor but I've also just been changing settings in the Skidigo interface since something may look correct in the IME but doesn't work in Sketchup due to the difference in dimensions of the objects.
Intel Core-i7 @ 4.0 GHz | GTX 580 | 12 GB RAM

User avatar
galinette
1st Place Winner
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Re: Blue Acrylic Appearing Purple

Post by galinette » Wed May 12, 2010 9:38 am

When giving a spectrum to Indigo, you need to provide the value (here the absorption coefficient) for each wavelength with a constant increment. Here I have chosen to give it from 380nm to 780nm by 10nm increment (this is the range I commonly use for color applications), so there are 41 values.

You can choose to use less values, for instance with a 20nm increment, but this gives you less precision in the sharpness of the absorption band, and the risk to include other colors and thus have pinkish effects for instance.

I believe Indigo calculates only in the 400-700nm range, in that case you could use a bit less values as below. Just make a specular material with the Indigo material editor. Then save it in a igm file (not pigm!). Edit it with a notepad-like program. Find the part between <absorption_coefficient_spectrum> and </absorption_coefficient_spectrum> and replace it by this code. Then use the material as a linked IGM.

Basically, the "1.0"s correspond to the wavelengths you want to absorb, and the "0.0" to the wavelengths you want to transmit.

Code: Select all

          <absorption_coefficient_spectrum>
                <regular_tabulated>
                    <start_wavelength>0.40E-06</start_wavelength>
                    <end_wavelength>0.70E-06</end_wavelength>
                    <num_values>31</num_values>
                        <values>
                           1.0
                           0.0
                           0.0
                           0.0
                           0.0
                           0.0
                           0.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                           1.0
                        </values>
                </regular_tabulated>
            </absorption_coefficient_spectrum>

Eclat-Digital Research
http://www.eclat-digital.com

ieatfish
Posts: 127
Joined: Sun Jan 31, 2010 5:29 pm

Re: Blue Acrylic Appearing Purple

Post by ieatfish » Wed May 12, 2010 9:52 am

Hmm, I get a syntax error with the <regular_tabulated> part.

edit: But I think I understand how the code works, let me see if I can't fix what I'm doing wrong.
Intel Core-i7 @ 4.0 GHz | GTX 580 | 12 GB RAM

User avatar
galinette
1st Place Winner
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Re: Blue Acrylic Appearing Purple

Post by galinette » Wed May 12, 2010 10:15 am

In the last code sample, I have put only 30 values, vs 31 declared. That's probably causing an error. Just add another 1.0 at the end.

Etienne
Eclat-Digital Research
http://www.eclat-digital.com

ieatfish
Posts: 127
Joined: Sun Jan 31, 2010 5:29 pm

Re: Blue Acrylic Appearing Purple

Post by ieatfish » Wed May 12, 2010 10:17 am

galinette wrote:In the last code sample, I have put only 30 values, vs 31 declared. That's probably causing an error. Just add another 1.0 at the end.

Etienne
Yup, that was it. I just got on to post it. So, it doesn't seem to be changing the color at all. But at least I don't get an error anymore. :lol:

It is coming through as completely clear. Here is the igm file:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<scenedata>
	<medium>
		<name>Unnamed</name>
		<precedence>2</precedence>
		<basic>
			<ior>1.49</ior>
			<cauchy_b_coeff>0</cauchy_b_coeff>
			<absorption_coefficient_spectrum>
				<regular_tabulated>
					<start_wavelength>0.40E-06</start_wavelength>
                    			<end_wavelength>0.70E-06</end_wavelength>
                    			<num_values>30</num_values>
                        		<values> 1.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 </values>
				</regular_tabulated>
			</absorption_coefficient_spectrum>
		</basic>
	</medium>
	<material>
		<name>Blue Acrylic</name>
		<specular>
			<internal_medium_name>Unnamed</internal_medium_name>
			<transparent>true</transparent>
			<layer>0</layer>
		</specular>
	</material>

</scenedata>
Intel Core-i7 @ 4.0 GHz | GTX 580 | 12 GB RAM

User avatar
Whaat
Developer
Posts: 1827
Joined: Fri Dec 22, 2006 6:15 am
Location: Canada
Contact:

Re: Blue Acrylic Appearing Purple

Post by Whaat » Wed May 12, 2010 3:20 pm

ieatfish wrote:I'm attempting to make a simple transparent blue acrylic material. You can see the target here: http://www.tapplastics.com/shop/product.php?pid=341& It's the darker of the blues. 1/4" thick and the IOR is 1.49.

The issue is no matter what I do, it renders as a bright violet color. Even when I set the RGB sliders to full Blue in Sketchup, it comes out with any internal reflections as a purple color. I've tried using specular, glossy transparent, and a few other options. I can get a nice purple, a nice cyan, and any other color but I can't seem to get a nice solid deep blue that doesn't have purple. Lighting doesn't seem to affect it either.

Here is an example of what it looks like. In Sketchup, material is a Specular, RGB sliders full on blue only, and 60% opacity.

Image
It should work if you increase your opacity higher than 60. Also, if you click on the absorption swatch, you can manually enter your desired absorption value.

User avatar
Whaat
Developer
Posts: 1827
Joined: Fri Dec 22, 2006 6:15 am
Location: Canada
Contact:

Re: Blue Acrylic Appearing Purple

Post by Whaat » Wed May 12, 2010 3:29 pm

Oh...I just noticed that you are also using 'Surface Color' set to Sketchup. You should change this to 'None'

ieatfish
Posts: 127
Joined: Sun Jan 31, 2010 5:29 pm

Re: Blue Acrylic Appearing Purple

Post by ieatfish » Wed May 12, 2010 3:53 pm

Just tried that, Whaat. Set my opacity to 65%, put the absorption to yellow and orange, and turned off the Surface Color. Still looked the same as the OP. :(
Intel Core-i7 @ 4.0 GHz | GTX 580 | 12 GB RAM

User avatar
Whaat
Developer
Posts: 1827
Joined: Fri Dec 22, 2006 6:15 am
Location: Canada
Contact:

Re: Blue Acrylic Appearing Purple

Post by Whaat » Wed May 12, 2010 5:07 pm

Weird, I can create a deep blue specular material 1/4" thick no problem just be setting RGB to 100% blue and a high opacity value....Not sure what you are doing differently. Maybe it's all tonemapping settings? Try playing with tonemapping and white balance until you get the color tone you want.

Post Reply
24 posts

Who is online

Users browsing this forum: No registered users and 26 guests