Is there a way to make Computer Shader work?

Since GL commands class are fully encapsulated within GLRenderer class , it is impossible to active a computer shader without change the source code.
Is there any solution guys?

I think you can by creating a material definition file (.j3md) where you can list the shaders you want to load.

More can be found here:

shall we add getters to Renderer ?
that way , it can be more flexible.

Any example code pls?
I thought we only have TWO shader types.

I learned from this repo. I copied and modified it to fit my game, Depthtris

I know how to use material but I’m talking about the computer shader I haven’t find computer shader in these code. very confused.
any details ?

My bad, a full compute shader that is not rendeing is out of my scope so far.

1 Like

If you want to hack a compute shader support without modifying the engine , you can use LWJGL (or android gl if you are on android) calls directly.

1 Like

Well, this way I may break the engine’s resource management system.
I mean the NativeObjectManager.class

Not necessarily, you will have to free the resources you use for your compute shaders manually since they won’t be registered by jme.

1 Like

Back in 2016, Sebastian Weiss added a support for OpenCL to jme3-core. I’ve never used this feature in a project, but I imagine it includes a mechanism for creating active compute shaders.

A good starting point might be the test apps in jme3-examples/src/main/java/jme3test/opencl.

2 Likes