Enhancements to the JME3 Rendering Engine

Hi, I just created a temporary repository here(https://github.com/JohnLKkk/jme3.4-temp.git), which is jme3.4 and contains my modifications, but it is not complete. I currently don’t have time to gradually migrate the code to jme3.6. So I think this temporary repository might be useful for people who are interested.

5 Likes

I will find some time later to gradually port the code from jme3.4 to jme3.6.

5 Likes


image
These two folders are the main places for code modifications.

4 Likes

Thanks! Yes, as you said it will be needed port into 3.6.1 to have clean pull request into JME current version. Probably it would not work from 3.4, but im unsure.

I wish to see your work on main branch in JME :slight_smile:

5 Likes

I initially ported the Framegraph, rendering paths from jme3.4 to jme3.6.1. The first picture is Forward (SinglePass SinglePassLightBatchSize=30), the second is standard DeferredShading (there are bugs in porting TileBasedDeferredShading, fixing…), rendering 1000 point lights at 1600x900 resolution.


11 Likes

Hi @oxplay2 @sgold, I have a question. I’m currently developing on the jme3 3.6 branch. Is this the latest dev branch? Should I submit PRs on this branch?

3 Likes

Hello @JhonKkk

It seems Riccardo is absent for now and Darkchaos as i recall had some different work.

So i belive it should be fine if you want make new JME release yourself, like Sgold suggested.

I think this topic might be very usefull resource: 3.6 release and 3.6.1 release topic:

Ofc every project have different ways to make pull requests. Some ways were to create release branch first and later merge to master.

But in JME i think you create pull request directly into Master, and later create release TAG and branch from master for a release.

I see there are branches for 3.6 but i guess its related for a Fixes/subversions like 3.6.1.
@sgold or @Ali_RS if you could help clarify here would be cool :slight_smile:

example pull request:

There is also contribution mega-thread:

But for a new release, as can notice, some fixes/features are picked to merge and then create release.
Your work itself IMO might be enough for new release itself.

1 Like

Thank you for your guidance. I misunderstood previously. Now I know that I should adjust the code from the local 3.6 branch to the master branch. After fixing the bug in TileBasedDeferredShading, I may try to make a PR.

3 Likes

Very nice, i hope this BUG will be easy to fix for you.

Idk, if you got probe changes ready, but anyway no worry about probe changes that require SDK changes.
As i recall, it was same for new animation system / etc. First change were in jme-core and later in SDK.(but there were ofc way to manage/convert it via code first, i belive you can leave SDK changes for some of SDK folks)

1 Like

No. Pull request should be based on the “master” branch.

For further guidance on pull requests, please read our guidelines:

4 Likes

It took 2 days to fix bugs, this is “tile based deferred shading”(Tiled Deferred Shading – Leif Node):


However, for now, I have not fully optimized DeferredShading and TileBasedDeferredShading, they may not be very efficient, but should be compatible with existing system modules.

8 Likes
7 Likes

5000 PointLights(800x600),
Forward:


Deferred:

11 Likes

I am fixing the remaining bugs, it may take some time. Afterwards, I may port the lightProbeVolume to jme3.7. :slightly_smiling_face:

3 Likes

Perhaps I should synchronize and update the JME Wiki afterwards, so that the details of related graphics techniques can be fully explained. :wink:

5 Likes

Amazing work! fully optimized or not, having 5000 PointLights at 21 fps or 60+ fps (we dont even know how much if not unlock vsync) is crazy difference :slight_smile:

Tho i still see a lot of “todo” and unfinished code there, i understand its just first pull request and LightProbeVolume gonna be added in another one. LightProbeVolume indeed its big separate topic.
Myself im always against adding any todo into core, but i understand everything will be filled with next pull request.(or changes in this one)

Were looking through commits, as i understand Forward pass will be default until we change into Deferred one.

Also seen tested with FilterPostProcessor using ToneMapFilter, but i understand other filters will work fine too.

LightProbes need Forward pass as i understand? (i could only guess based on comment in code)
I hope i understand correctly.
So i can switch like:

renderManager.setRenderPath(RenderManager.RenderPath.Forward);

Some LightProbe generation / etc code / render
and later:

renderManager.setRenderPath(RenderManager.RenderPath.Deferred);

and repeat for every probe generation?

Or is it possible to do it in some another viewport having Forward just for lightprobe generation?

But anyway if you gonna change LightProbes into LightProbeVolume then i understand its just temporary way and there it would no need switch to Forward.

There are still some chineese comments to change as noticed.

while Shader code is often black magic for me, i see LightingGBufferPack.frag or PBRLightingGBufferPack.frag are replacers for old PBRLighting.frag and Lighting.frag

what will happen with older PBRLighting.frag and Lighting.frag and verts? This older ones will still work in SinglePass Forward old way and new ones in new Passes Pipeline like Deferred one?

Shaders were always not my speciality, so someone else might also want check it out if they see anything that might break.

In my summary:

  • looks like TON of work, first pull request preparing Framebuffer and related passes, while leaving space/todos to finish LightProbeVolume work mostly.
    From user side it is not invasive(except if anything can break in shader/etc for someone)
    all need to do from user side is to change pass to deferred for example.

I hope there will be more specialist to add some opinions if they catch something important. For example @Ali_RS or anyone please also share opinions :slight_smile:

And ofc @JhonKkk thanks for your pull request, and hope to see this todos finished fully later :slight_smile:

5 Likes

Im not sure if @mitm is still here, but if i remember correctly he did nice work with wiki before. Would just probably need explain, or you can edit wiki yourself too, since you already know what to write :slight_smile:
As i guess based on what i remember, to edit wiki, just needed re-generate wiki pages after page changes related to JME version. (wiki support wiki per JME version)

1 Like

Currently, some existing logic has to execute under the forward rendering path, such as the old LightProbe data baking process, which I have not yet modified to run under the deferred rendering path. Therefore, when baking LightProbe data, one can “temporarily” only switch back to the Forward rendering path, and after baking is complete, switch to any rendering path (Forward/Deferred/Tile-based Deferred).

There are still some chineese comments to change as noticed.
Yes, I will delete and unify the use of English comments in subsequent work, as well as improve the existing code comments and explanations…

Actually, “xxxxPack.vert/xxxxPack.frag” are used to pack the GBufferData data, they only do packing instead of shading. So PBRLightingGBufferPack.frag and PBRLighting.frag are not the same, although they share some reused code. PBRLighting.frag contains complex PBR lighting shading logic, while PBRLightingGBufferPack.frag only reads related textures and packs them into the 4 RTs of the GBuffer. Similarly, if you want a custom MaterialDef to run under the deferred rendering path, you may provide a GBufferPass Tech{}, then provide vs and fs to pack the GBufferData.
However, why don’t I extract the related code to reuse, such as letting PBRLightingGBufferPack.frag and PBRLighting.frag share the logic to read textures by encapsulating it in XXX.glsllib? This is likely an improvement to do next, but let’s first improve step-by-step for this 1.0 version.

Yes!

2 Likes

All known bugs in tile-based DeferredShading have been fixed. Currently, its performance is far higher than deferred shading, even when running full screen.

7 Likes

This is the core part:
image
and my implementation:
image

4 Likes