jmonkeyengine
jmonkeyengine copied to clipboard
Allow Buffers to be passed as material parameters
Currently, only arrays may be passed as material parameters, even though LWJGL also allows buffers to be used for shader uniforms. I see two ways to address this:
- Add new VarTypes for buffer parameters.
- Allow some array parameters to also accept buffers.
This may need to wait for v4.0. There are a lot of things in the material system I'd like to refactor and I might as well do this at the same time.
This may need to wait for v4.0
So far I'm thinking that (following 3.9) the next version will actually be 3.10 then 3.11 and so on. But I'd also be curious to know what @stephengold and any others think about this and if that's indeed the route we want to go with the next versions.
I'd like to think that a jme 4.0 will happen eventually, but as far as I'm aware there aren't any efforts or plans for that currently.
Last mention of a jme4 was in some threads discussing a future jme using vulkan, but it sounds like the need for that is currently debatable, and it will be at least a few years until a new jme using vulkan makes sense in my opinion. (unless of course anyone takes it upon themselves to fast track the process. But currently I don't forsee it being in the plans for jme community to divert efforts away from jme3 and towards a jme4 anytime soon)
So I suspect there will at least be 2 (likely even more) major version releases in jme3 before 4.
But (versioning aside), I support and agree with your plans to improve the material system for whichever version comes next.
Unless JME undergoes some fundamental change, I expect that the sequence of releases will be 3.9, 3.10, 3.11, ... not 3.9, 4.0, 4.1 .
I expect that the sequence of releases will be 3.9, 3.10, 3.11, ... not 3.9, 4.0, 4.1
I also expect that to happen. The changes I have in mind for the material system will likely involve some sort of breaking change, which is why it may need to wait for the next major version. We'll have to see though.
How much do you expect it to break?
If it doesn't break too much, and if the benefits are worth it, then that is perfecty fine. Obviously less breakage is always preferred, but when it comes to modernizing certain aspects of jme3 and adding new features, breakages are going to be necessary and unavoidable.
I know in the past some jme versions introduced some new breaking changes that required me to change some broken code in my projects when upgrading (such as when light probe blending was added in a new version shortly after the version that originally added PBR)
In cases like these the benefit is so great that it is totally okay to tell people that upgrading to the next release will come at the cost of breaking some of their code.
3.9 is also very early in the alpha stage still, so significant changes would still be acceptable and there's still plenty of time for testing. But if you think its better to wait for a later version or if you are currently busy, then waiting until a later version is perfectly okay too.
I'm not entirely sure at this point, but after a little prototyping I'm afraid the minimal "damage" I can manage while still improving materials is still pretty breaking. I'm essentially ripping the internals out and completely replacing them, so applications that depend on things below Material will probably break.
On top of that, OpenGL can't be interfaced with directly from core, so I'll have to alter the Renderer interface in order to make the appropriate calls.
I'm essentially ripping the internals out and completely replacing them, so applications that depend on things below Material will probably break.
Breaking things in internal classes below material would be much preferrable over changes that break higher level classes. I'd be most worried if there were changes that break classes like material that are widely used by all users. And even in that case, a conversion utility could also be an acceptable solution to allow users to update their old or broken materials to a new version/system in cases where the benefits are great enough to justify it. (I expect that something like this will be necessary and very useful when/if a vulkan jme is made)
I'm not entirely sure at this point
Once you have an idea of how much will break, then I'd suggest making a topic on the jme forums to get feedback on how severe the community thinks the changes would be. To me it doesn't sound like the breakage would be that bad based on what you've mentioned so far, but I'm also not too familiar with the jme material system at a lower level, so others' opinions may be more valuable than mine in this regard.