Question Regarding Vertex Shaders

I was thinking about moving my terrain code to the gpu but before I begin I would like to clarify a few things. I understand to “call” in a shader from a java file you must create a material for that shader. How would this work though if the shader was generating noise values for example? Is it possible to call it just like any other method/class? Thanks for the help.

Not really sure what you want to achieve, but one of the following should help you:

  1. OpenCL (for very generic computations using GPU)
  2. Geometry shader (if you still want to be in normal pipeline, just modify geometry in more ways)
  3. Render to texture with custom pixel shaders (in 99% of the cases, for computation emulation you will want to do things in pixel rather than vertex shaders - because resulting textures can be read back to program or bound to other processing trivially, which vertices are more complicated)
1 Like

Ok I looked into geometry shaders and using them seems like a way to accomplish my goal. Basically I just want to re-write my noise algorithms in glsl.

Last I looked JME only supports vertex and fragment shaders though? Not geometry…