[PD] GEM: glsl

Cypod cypod25 at gmail.com
Sat Jul 7 06:38:37 CEST 2007


Glad I finally got some time to start hacking on this stuff. Texturing and
model deformation in the same [glsl_program]
//vert
uniform float time;

void main(void)
{
// gl_FrontColor = gl_Color;
    gl_TexCoord[0] = gl_MultiTexCoord0;
vec4 v = vec4(gl_Vertex);
v.z = v.z * sin(5.0*v.x + time*0.1);
 gl_Position = gl_ModelViewProjectionMatrix * v;
}


//frag
uniform sampler2DRect MyTex;

void main (void)
{
 vec4 color = texture2DRect(MyTex, gl_TexCoord[0].st);
 color = color* 0.5;
 gl_FragColor = color;
}



-- 
B~
www.cypod.co.nr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070706/1713678d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xlube.pd
Type: application/octet-stream
Size: 5942 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070706/1713678d/attachment.obj>


More information about the Pd-list mailing list