Ok to stomp out every doubt that vertex shaders with java/lwjgl is possible, I added a shader demo ported from the Cg shader from
http://www.cgshaders.org/shaders/show.php?id=11
to current lwjgl cvs. If you don’t like cvs, you can get it from
http://odense.kollegienet.dk/~naur/grassshader.zip
Because the demo needs some bug fixes in the linux version of lwjgl (hey the linux port is still young!), I added fresh linux libraries to the zip archive. The port should look like the one on the cgshaders.org page*, however the java version does not use the Cg runtime like the original. Partly because the Cg runtime is not nescessary but mostly because the is no Cg runtime bindings in lwjgl (yet). Likewise, the teapot in the original is gone from the java version (it uses glut).
Anyway, if it runs on your machine, you are looking at a vertex shader in java/lwjgl! It runs like crap on my GeForce2 mx (vertex shaders runs in software on those), so make sure you’ve got something bigger.
- I don’t have a windows machine so I might be wrong.
- elias