Forums > Jitter

Attribute variables in GLSL

Oct 22 2009 | 6:29 am


This maybe very silly or beginner’s question.
However, please someone answer this question so I can go on.

I just started to dig into glsl.
I took workshop hosted by Wesley Smith in Korea, read Andrew Benson’s ‘your first shader’, and checked ‘jitter-shaders’ in max5 folder.
And finally started to read orange book.

I encountered a problem when I tried to implement the first shader in orange book into jitter.
I never saw variables attribute used in previous reading.
I’m stuck.
I read over and over but I can’t fully understand how attribute works.

first shader in orange book
//vertex part
uniform float CoolestTemp;
uniform float TempRange;

attribute float VertexTemp;

varying float Temperature;

void main()
Temperature = (VertexTemp – CoolestTemp) / TempRange;

gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

//fragment part
uniform vec3 CoolestColor;
uniform vec3 HottestColor;

varying float Temperature;

void main()
vec3 color = mix(CoolestColor, HottestColor, Temperature);

gl_FragColor = vec4(color, 1.0);

How can I implement attribute variable into jitter way?

I checked the post Wes uploaded a while ago.
I changed the 3 values for ‘p Displace’, nothing happened.

Please help me out!
Thank you.

Oct 22 2009 | 6:33 am

Wes, can you upload the file again?
The link is broken.
It must help.

Oct 22 2009 | 8:08 pm

a quick search for vertex attributes reveals this post as the top match:

Oct 23 2009 | 3:23 am

I checked that before and didn’t understand fully.
I’m checking ‘v001.rutt-etra’ patch right now.

I maybe asking too much for the level of my knowledge…..sad..

I just skip for now and go on for next one.
However, I’ll come back on this.

Viewing 4 posts - 1 through 4 (of 4 total)

Forums > Jitter