ISL - Indigo Shader Language - I need an education...
ISL - Indigo Shader Language - I need an education...
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!!
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.
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
Must be:
So the function
Code: Select all
def eval() real :
noise(getTexCoords(0)*30.0)*0.002
Code: Select all
def eval() vec3 :
vec3(noise(getTexCoords(0)*30.0)*0.002)
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.
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.
wavelenght-dependent = colour-dependent.
colours on a screen = red, green and blue
quick counting gives..... 1..... 2..... THREE!
vec_THREE_

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
colours on a screen = red, green and blue
quick counting gives..... 1..... 2..... THREE!
vec_THREE_
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
Yep. The manual is your friend.OBI_Ron wrote:MSUdom5,
OK, now I see it. In the manual, under diffuse, it states that albedo is a wavelength dependent parameter.
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: What I could use more help with, generally speaking is "how would I know that a wavelength dependent parameter requires a vec3".
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.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.
You can also define a wavelength dependent shader like this:Kram1032 wrote:anything "wavelenght dependent" is a vec3
Code: Select all
eval(real wavelen, vec3 pos) realWhat's the range of wavelen? [0,1]?
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:
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:
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?
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>
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>
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?
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.
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.
Who is online
Users browsing this forum: No registered users and 56 guests