Add custom shaders to jmp

How would I add custom shaders to jmp so artists could use them like the existing ones? Would it be possible by adding a plugin, or would I have to create a custom jme3 jar? I would like to keep it as non intrusive as possible to be able to update from the original jmp.

Just add them to the assets folder, theres already folders created for this purpose. You can copy&paste the existing shaders from the “Library” node - “jMonkeyEngine3.jar” to the “Project Assets” node, change the name and adapt the paths and names inside the shader, then go ahead. You can also install the “GLSL Editor” plugin via Tools->Plugins to get code highlighting and syntax checking for .frag and .vert files.

Thnx normen! I’ll give it a try.

It worked. Though I have problems with assigned shaders, if the materialdefinition has problems, once saved with an error errors keep appearing even though fixed. Have to restart jmp to have the error removed. But the rest worked like a charm, even editing was possible out of the box.

Hm, ok, the assetManager cache is probably not reset, as a workaround you can just open a model once, that clears the projects assetManager cache.

Workaround didn’t work. Closed composer, opened a different model (no material so far). Error still keeps comming no matter how often I close the window and view a new model.



I my case I just changed the name of the vertex shader in the material definition to test it. It comes up with com.jme3.asset.AssetNotFoundException: wrongshader.vert

Hm, maybe @Momoko_Fan can tell why the assetManager doesn’t reload the matdef files? Afaik many people coded shaders this way w/o problems.