ISL - Indigo Shader Language - I need an education...

Announcements, requests and support regarding the Blender Indigo export script
Post Reply
15 posts • Page 1 of 1
OBI_Ron
Posts: 75
Joined: Sun Aug 13, 2006 2:36 am

ISL - Indigo Shader Language - I need an education...

Post by OBI_Ron » Fri Jan 30, 2009 5:36 am

Hello Everyone,

So, I have tried the Indigo Shader tutorial, and got similar results. So I thought I'd try the same shader in the displacement slot - that worked also. However, When I tried it in the Albedo slot, I got an error (I am at work now, and cannot give the specific error). I checked all of the obvious, I had a UV set, and copied the name to the proper field, and also pressed the shader icon.

I suspect that either:
1) The information in the Indigo Shader Language reference has all of the information, and I am unable to decipher it, or...
2) I need a better grounding in what all this shader programing is all about.

I would greatly appreciate any information you can offer. I really want to be able to use Indigo to it's fullest, and I think the only thing holding me back is time (Yeah right - Like I'm the only one suffering from only having 24 hours in a day) and knowledge.

Thanks in Advance!!
Last edited by OBI_Ron on Sat Jan 31, 2009 7:47 am, edited 1 time in total.

MSUdom5
Posts: 159
Joined: Sun Jul 20, 2008 6:04 am
Location: Mississippi, USA
Contact:

Post by MSUdom5 » Fri Jan 30, 2009 6:33 am

Which Indigo Shader tutorial are you talking about? Could you post a link to it?

OBI_Ron
Posts: 75
Joined: Sun Aug 13, 2006 2:36 am

Post by OBI_Ron » Fri Jan 30, 2009 6:46 am


MSUdom5
Posts: 159
Joined: Sun Jul 20, 2008 6:04 am
Location: Mississippi, USA
Contact:

Post by MSUdom5 » Fri Jan 30, 2009 6:54 am

Albedo is a wavelength dependent parameter, so an albedo shader must return a vec3. Since bump and displacement are wavelength independent, they need only return a real.

So the function

Code: Select all

def eval() real :
noise(getTexCoords(0)*30.0)*0.002
Must be:

Code: Select all

def eval() vec3 :
vec3(noise(getTexCoords(0)*30.0)*0.002)

OBI_Ron
Posts: 75
Joined: Sun Aug 13, 2006 2:36 am

Post by OBI_Ron » Fri Jan 30, 2009 7:45 am

MSUdom5,

OK, now I see it. In the manual, under diffuse, it states that albedo is a wavelength dependent parameter.

What I could use more help with, generally speaking is "how would I know that a wavelength dependent parameter requires a vec3".

In short, I need a better frame of reference, or a better understanding of the terms.

Is there any good source of reading material?

Any help and / or advice is greatly appreciated.

User avatar
Kram1032
Posts: 6649
Joined: Tue Jan 23, 2007 3:55 am
Location: Austria near Vienna

Post by Kram1032 » Fri Jan 30, 2009 8:06 am

wavelenght-dependent = colour-dependent.
colours on a screen = red, green and blue
quick counting gives..... 1..... 2..... THREE!
vec_THREE_
:D

vec is for "vector" (normalized vector with coordinates between 0 and 1, as r g and b can be between 0 and 1....)
and 3 is for 3 coordinates.
:)
anything "wavelenght dependent" is a vec3

MSUdom5
Posts: 159
Joined: Sun Jul 20, 2008 6:04 am
Location: Mississippi, USA
Contact:

Post by MSUdom5 » Fri Jan 30, 2009 8:10 am

OBI_Ron wrote:MSUdom5,

OK, now I see it. In the manual, under diffuse, it states that albedo is a wavelength dependent parameter.
Yep. The manual is your friend. :)
OBI_Ron wrote: What I could use more help with, generally speaking is "how would I know that a wavelength dependent parameter requires a vec3".
This is also in the manual under the definition of 'wavelength dependent parameter'. There are actually 2 ways to define a shader for WD params. The manual explains them both. (p. 74)
OBI_Ron wrote: In short, I need a better frame of reference, or a better understanding of the terms.

Is there any good source of reading material?

Any help and / or advice is greatly appreciated.
Really, the manual and content buried in this forum are the best reading materials. However, shaders are one of the more complicated features of Indigo, and my guess is that the majority of users haven't gotten a chance to dig in and learn how to use them.

MSUdom5
Posts: 159
Joined: Sun Jul 20, 2008 6:04 am
Location: Mississippi, USA
Contact:

Post by MSUdom5 » Fri Jan 30, 2009 8:13 am

Kram1032 wrote:anything "wavelenght dependent" is a vec3
You can also define a wavelength dependent shader like this:

Code: Select all

eval(real wavelen, vec3 pos) real
which operates on each wavelength independently.

What's the range of wavelen? [0,1]?

OBI_Ron
Posts: 75
Joined: Sun Aug 13, 2006 2:36 am

Post by OBI_Ron » Fri Jan 30, 2009 1:09 pm

Thanks everyone for the guidance - I am beginning to piece it all together. I also found the ISL Previewer app to help in my learning.

Thanks again!

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

Post by CTZn » Sat Jan 31, 2009 6:32 am

Thank you for the thread OBI_Ron, the vast majority of us need a proper ISL education ! May I ask you please to edit the first post in order to append an ISL tag to it ? For future reference ;)

Thanks MSUDom for that last trick !
obsolete asset

OBI_Ron
Posts: 75
Joined: Sun Aug 13, 2006 2:36 am

Post by OBI_Ron » Sat Jan 31, 2009 7:50 am

Done!

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

Post by CTZn » Sat Jan 31, 2009 10:37 am

Almost more than required, thanks ;)
obsolete asset

OBI_Ron
Posts: 75
Joined: Sun Aug 13, 2006 2:36 am

Post by OBI_Ron » Sun Feb 01, 2009 12:20 pm

Hello again,

Here is some information I have put together. It is very basic, and will not be much help to most of you, but it is a start for the uninitiated.

http://www.cdupload.com/files/45841_kcm ... _Noise.pdf

Here are a couple of observations - from a Blender / Blendigo perspective:

1) Speaking of diffuse material, RGB, ISL Shader and Albedo texture are mutually exclusive. Particularly from a Blendigo standpoint. When you click the shader button, the rgb component is not written to the igs file, and if you add it back, and have the shader information as well, you will get an error. I tried loading a texture (in the Blendigo gui), but it had no effect.

2) Considering (getTexCoords(0)... the 0 is the UV texture layer. If you added a second UV texture layer in Blender, and selected it in the Blendigo gui, the 0 would become 1, and so on.

3) The following code gives an error:

Code: Select all

	<diffuse>
			<albedo>
				<shader>
					<shader>
						<![CDATA[
					def eval(vec3 pos) vec3 :
					vec3(noise(getTexCoords(0)*5.0)*1.0) 
						]]>
					</shader>
				</shader>
				<shader>
					<shader>
						<![CDATA[
					def eval(vec3 pos) vec3 :
					vec3(noise(getTexCoords(0)*5.0)*1.0) 
						]]>
					</shader>
				</shader>
			</albedo>
		</diffuse>
But the following code does not, but I did not see a difference - it seemed as though the second was ignored, but I don't know if that is due to trying to use 2 noise shaders or if it is incorrect, but just not incorrect enough to make Indigo give an error:

Code: Select all

			<albedo>
				<shader>
					<shader>
						<![CDATA[
					def eval(vec3 pos) vec3 :
					vec3(noise(getTexCoords(0)*5.0)*1.0) 
						]]>
					</shader>
					<shader>
						<![CDATA[
					def eval(vec3 pos) vec3 :
					vec3(noise(getTexCoords(0)*20.0)*1.0) 
						]]>
					</shader>
				</shader>
			</albedo>
This was an attempt to blend 2 shaders - thinking in terms of Blenders texture slots.

4) Although these are, to some extent procedural textures, they rely on the quality of your UV layout.

5) Given - vec3(noise(getTexCoords(0)*20.0)*1.0) - changing the first number, 20 changes the scale uniform. You can have the same effect scalling your UV layout - but you could scale the UV layout non-uniform to stretch the effects.

Now, I need someone to throw be a bone - How do I add color to a noise shader?

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

Post by CTZn » Sun Feb 01, 2009 1:24 pm

use the same noise function with a different uv offset for each component (RGB) ? Well, no meat really :D

Attending the thread, interesting matter...
obsolete asset

OBI_Ron
Posts: 75
Joined: Sun Aug 13, 2006 2:36 am

Post by OBI_Ron » Mon Feb 02, 2009 6:13 am

OK Everybody,

Here is where I put to rest any and all beliefs that I have an amazing grasp of the obvious.

While desperately searching for a specific line of code that sets rgb for a diffuse shader, I finally got the ISL previewer to work on a windows machine (I normally use Ubuntu, and the graphics card I have doesn't support glsl), and I notice that the Suzanne obj loads up with color already applied - WOW, what magic - Duh!

Diffuse = rgb

I am going to take a few hours off...I have a tutor coming over to help me with my remedial breathing lessons.

Post Reply
15 posts • Page 1 of 1

Who is online

Users browsing this forum: No registered users and 56 guests