Task #7 - Shaders (Release 1.0)

After starting to get into the new Eberly book(with his new shader friendly architecture) as well as own research I'm leaning towards making a simpler fix to the shadersystem for the 1.0 release. Getting the shader system up to were we would really want it, would need to many core changes to jme to fit in an 1.0 time and task frame.



So I'm voting for only making the shadersystem we have now more stable, less memoryhungry, a bit faster, and less bloated, which I know how to fix allready…the biggest issues i've had with it until now(not counting the possibility of changing the current design too much) is that it would eat memory like a horse, and often stall if you didnt clear the uniforms before updating them every update loop…



any input on that?

Sound reasonable.  Does this mean any significant changes to how uniforms and other args to a shader are set and/or used?

i would then leave the setuniform methods unchanged(might add some more to take Vector3f or so) to not break any code, but rewrite alot behind the scenes

A rewrite of the shadersystem has been checked in, staying inside the bounds of a 1.0 release as said earlier…



Some of the changes:

  • Memory issues resolved with significantly less memory used
  • No need to use clearUniforms every update anymore(and thus set all shadervariables every update). Needed in many occations before due to memory leaks
  • A bit faster due to only updating the changed uniforms/attributes and less memory allocations
  • Shader attributes(setAttributePointer) actually work(they were completely broken). Removed setAttribute methods because they have no usage in that context.
  • A lot cleaner code
  • Added setUniform methods for all boolean types
  • Added conveniance methods to setUniform for Vector3f, Vector4f, ColorRGBA and Quaternion
  • Added javadocs
  • Added two small tests



    If I have overlooked or screwed anything up please let me know, since it's hard to test every different angle…