Jump to content


OpenGL/Delphi/Shaders: GLSL Half-Life skeletal animation


2 replies to this topic

#1 Georgy

    New Member

  • Members
  • Pip
  • 7 posts

Posted 17 October 2006 - 04:24 AM

Easy example on using GLSL Shaders for skeletal animation:
http://www.igrodel.r...dplayer-src.rar - (219kb) source code
http://www.igrodel.ru/glsl.htm - screenshot and EXE. Made with Turbo Delphi.
Compare CPU vs Shader vertex transformation.

Also can be build with Delphi 6. Enjoy!

#2 Georgy

    New Member

  • Members
  • Pip
  • 7 posts

Posted 17 October 2006 - 12:47 PM

Update:
if you see Error: "pre-mature EOF" syntax parse error do not worry.
Go to .\shaders\ folder, find vertex.txt source and remove all russian comments from .\shaders\vertex.txt source code.

Or you can copy and paste vertex.txt source code without comments right from here:

uniform mat4 boneMat[32];
attribute float boneIndex;
void main(void)
{
gl_Position = gl_ModelViewProjectionMatrix * ( boneMat[int(boneIndex)] * gl_Vertex);
gl_FrontColor = gl_Color;
gl_TexCoord[0] = gl_MultiTexCoord0;
}

#3 Georgy

    New Member

  • Members
  • Pip
  • 7 posts

Posted 18 October 2006 - 11:44 PM

Here is a New
highly optimized version that works 1000 times faster :lol:

Source Code (219kb):
http://www.igrodel.r...timized-src.rar

Exe (342kb):
http://www.igrodel.r...timized-exe.rar

USED: GLSL + VBO + one call to glInterleavedArrays to be even more optimized =)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users