Tada ;D
Ok so I’ve spent a great deal of time trying to implement those features that I wished were available with Java3D.
After countless trials, I’ve got them implemented somehow, meaning that I’m positive Yuri or David could come up with an even better approach.
The reason why I needed them Pixel and Vertex Shaders is the overhead caused by repeated calls to native functions that Xith3D as well as any java binding outthere causes.
To demonstrate the huge benefits of VertexShaders, I wrote a little shader coder for NeHe’s celshading tutorial.
You need to hit space to have the model moving and notice how good the vertex shaded demo runs: That’s right, on my machine it’s 3X faster than the conventional demo.
I attached the source code for the PS and VS as well as the demo.
Enjoy fellas 
PS: Hi Yuri ;D
Nehe’s Cel-Shading Tutorial (Without VS)
http://www.users.xith.org/JavaCoolDude/JWS/Nehe/Lesson37/Lesson37icon.jpg
Keys: Space, 1,2, Up, Down
Source
Nehe’s Cel-Shading Tutorial (With VS)
http://www.users.xith.org/JavaCoolDude/JWS/Nehe/Lesson37VS/Lesson37icon.jpg
Keys: Space, 1,2, Up, Down
Source
!!ARBvp1.0
ATTRIB OriginalPos = vertex.position;
ATTRIB TmpNormal = vertex.normal;
PARAM lightAngle = program.env[0];
PARAM ModelViewProj[4] = { state.matrix.mvp };
PARAM ModelViewInvertTranspose[4] = { state.matrix.modelview.invtrans};
TEMP TmpVector;
TEMP TmpShade;
TEMP temp;
DP3 TmpVector.x, TmpNormal, ModelViewInvertTranspose[0];
DP3 TmpVector.y, TmpNormal, ModelViewInvertTranspose[1];
DP3 TmpVector.z, TmpNormal, ModelViewInvertTranspose[2];
DP3 TmpVector.w, TmpVector, TmpVector;
RSQ TmpVector.w, TmpVector.w;
MUL TmpVector , TmpVector, TmpVector.w;
DP3 TmpShade.x, TmpVector , lightAngle;
MAX TmpShade.x, TmpShade.x, 0.0;
DP4 temp.x, ModelViewProj[0], OriginalPos;
DP4 temp.y, ModelViewProj[1], OriginalPos;
DP4 temp.z, ModelViewProj[2], OriginalPos;
DP4 temp.w, ModelViewProj[3], OriginalPos;
MOV result.position , temp;
MOV result.color , vertex.color;
MOV result.texcoord[0].x, TmpShade.x;
END
