Implementing SSBO for jME.#822
Conversation
|
Nice.
We should have a java object with the same structure as you expect in the shader set as a materialParam, and the SSBO implem would handle the transformation to byte buffer. Then the Material should have a convenience method setBuffetObject (maybe with an additional param to differentiate SSBO and UBO ...) your example would look like: |
|
@Nehon ok, I will continue to work on this ;) |
|
Also more things. Also UBO and SSBO have a size limit in the spec. 16kb for UBO an 128mb for SSBO, though implems might provide more. There must be a way to query this value, this should be added to the limit enum of the renderer when UBO and SSBO are supported. Maybe you should open this as a thread on the forum so that other devs can chime in and give their opinion on the implementation. |
|
Rha... Sorry, the merge of your other PR introduced conflicts on this one. |
|
@Nehon I will update it later. |
# Conflicts: # jme3-core/src/main/java/com/jme3/renderer/opengl/GL.java # jme3-core/src/main/java/com/jme3/renderer/opengl/GL3.java # jme3-core/src/main/java/com/jme3/renderer/opengl/GL4.java # jme3-lwjgl3/src/main/java/com/jme3/renderer/lwjgl/LwjglGL.java
|
@Nehon I have resolved conflicts. |
|
I rebased the PR to be able to merge it... Somehow I failed to repush to this PR so I created another #863 |
|
|
https://hub.jmonkeyengine.org/t/buffer-objects-in-jme/40054 There has been a long discussion here. Also the Pr stayed open several months... It's somehow too bad your objections comes 2 days after the Pr has been merged. Though nothing is written in stone. We can change how it's done. What do you suggest ? Maybe chime in on the forum thread. |
|
I'm not objecting to the PR per se, I'm just saying that its a good idea to approach this from a different angle. Instead of saying, "Hey let's implement UBOs and SSBOs", you should instead say, "How can we make the engine faster with UBOs / SSBOs?" or "What kind of features can we implement if we had UBOs / SSBOs that otherwise we couldn't have?" |
Implementing Shader Storage Buffer Object for jME.
Example of shader which uses SSBO as a material parameter:
https://github.com/JavaSaBr/jmonkeybuilder/blob/feature/multi_select_in_scene/src/test/resources/MatDefs/Unshaded.frag
Example of working with SSBO.
https://github.com/JavaSaBr/jmonkeybuilder/blob/feature/multi_select_in_scene/src/test/java/com/ss/editor/test/external/SSBOSceneTest.java