Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A framegraph framework that supports 3 render paths #2090

Draft
wants to merge 30 commits into
base: master
Choose a base branch
from

Conversation

JohnLKkk
Copy link
Contributor

@JohnLKkk JohnLKkk commented Oct 10, 2023

see:https://hub.jmonkeyengine.org/t/enhancements-to-the-jme3-rendering-engine/47145/27

Enhance the capabilities of the JME3.7 renderer, mainly including:

  1. Introduce a basic framegraph framework for managing renderPasses, while modularizing the existing rendering modules into several core Passes for reuse;
  2. Added support for render paths, including Forward (default render path), Deferred (a standard DeferredShading), and TileBasedDeferred (Tile-optimized DeferredShading). They should be compatible with most existing modules.
  3. Added some code demos for RenderPath.

Regarding render paths, please refer to: https://docs.unity3d.com/Manual/RenderingPaths.html

Performance considerations

The rendering overhead of real-time lights in deferred shading is proportional to the number of pixels illuminated by the light and not dependent on Scene complexity. So small Point Lights or Spot Lights are very cheap to render and if they are fully or partially occluded by Scene GameObjects then they are even cheaper.
Of course, lights with shadows are much more expensive than lights without shadows. In deferred shading, shadow-casting GameObjects still need to be rendered once or more for each shadow-casting light. Furthermore, the lighting shader that applies shadows has a higher rendering overhead than the one used when shadows are disabled.

GBuffer format:

RT0, RGBA16F: Pack DiffuseColor, Ao, Alpha
RT1, RGBA16F: Pack SpecularColor, FZero, Roughness
RT2, RGBA16F: Pack ShadingModelId, emissiveColor
RT3, RGBA32F: Pack Normal (contains Normal with TBN transform and modelNormal, using cubemap mapping)
RT4, depth: Pack depth

LightPack:

There are two ways to package lightData, one of which is to use a uniform array, which should be faster, but its quantity is limited, and a large number of light sources will be drawn and accumulated through several passes to complete all light sources;
Another way is to package all light source information through three texture1D, which may have some performance overhead, but supports a large amount of light source data;

Tile-Based DeferredShading:

TileLightDecode: Packs tile information, x indicates the first light source offset used by the tile (for lookup in TileLightIndex), y indicates how many lights are associated with the tile (currently no limit, i.e. unlimited number of lights), z indicates the uv coordinate offset when sampling TileLightIndex for the tile;
TileLightIndex: Packs light source ids for each tile

UseRenderPath:

Enable the corresponding renderPath in the following ways:
renderManager.setCurMaxDeferredShadingLightNum(1000);// Pre-allocate a maximum value for light sources to ensure the maximum number of light sources in the scene does not exceed this value. renderManager.setRenderPath(RenderManager.RenderPath.Deferred);

UseFramegraph(Still in development...):

Includes a set of FG public APIs (current internal implementation details may not be perfect, but usable interfaces will be finalized in this PR)
Enable the corresponding framegraph in the following ways:
renderManager.enableFramegraph(true);

@stephengold
Copy link
Member

How about we mark this PR as a draft until it's ready for final review?

@riccardobl riccardobl added the hacktoberfest-accepted PRs that are Hacktoberfest valid (Optional if PR is merged or approved during the month of october) label Oct 16, 2023
@JohnLKkk
Copy link
Contributor Author

How about we mark this PR as a draft until it's ready for final review?

I think it's possible, however advancing this might require some extra work:

  1. Should testing be done and related bugs reported and fixed (although I personally tested my local examples code, others' situations might differ)?
  2. Should this PR be a "1.0 version to enhance renderer capabilities" instead of a one-step perfect version? (I think this PR is not perfect now because the render path is not thoroughly optimized, however, theoretically when adding a new feature, it should first be made compatible with existing architecture and run stably, then do 2.0 or 3.0 iteration and optimization work afterwards)
  3. I may not include global illumination content in this PR, because I think the subject deserves its own new PR created specifically for it.

@stephengold
Copy link
Member

I think this PR should be marked as a draft. Marking in-progress PRs as a drafts reduces the mental load on integrators and prevents premature integration.

Should testing be done and related bugs reported and fixed (although I personally tested my local examples code, others' situations might differ)?

Testing and bug reporting can and should continue while the PR is a draft.

Should this PR be a "1.0 version to enhance renderer capabilities" instead of a one-step perfect version?

Your decision; we can go either way.

I may not include global illumination content in this PR, because I think the subject deserves its own new PR created specifically for it.

I'm fine with that.

chenliming added 2 commits October 17, 2023 20:59
Added two renderPath sample codes.
Added terrain unlit shading model test code;
Added terrain lighting shading model test code;
@stephengold
Copy link
Member

Each Java sourcefile you add to the repo should have the full JME license at the top of the file, with the current year for the copyright date.

@JohnLKkk
Copy link
Contributor Author

Each Java sourcefile you add to the repo should have the full JME license at the top of the file, with the current year for the copyright date.

I think I will make time to modify each Java file according to the engine source code conventions.

Copy link
Contributor

@codex128 codex128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand a lot about rendering, so I probably won't catch any major issues. Hopefully this review will be helpful anyway. 😉
I've refrained from mentioning javadoc and basic style issues, since it sounds like you'll be working on that soon.

}
}

private void prepaLightData(int lightNum){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"prepaLightData" is slightly confusing.
Should this method be named "prepLightData" or "prepareLightData" instead?

if (l instanceof AmbientLight) {
ambientLightColor.addLocal(l.getColor());
if(removeLights){
lightList.remove(l);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Faster to remove by index instead of by object.

if (l instanceof LightProbe) {
skyLightAndReflectionProbes.add((LightProbe) l);
if(removeLights){
lightList.remove(l);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Faster to remove by index instead of by object.

* <tt>max</tt> (inclusive).
*/
public static float nextRandomFloat(float min, float max) {
return (nextRandomFloat() * (max - min + 1.0f)) + min;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can return outside specified range.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing out the issue, it has now been fixed.

}
}

private void prepaLightData(int lightNum){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confusing name "prepaLightData".
I think it would be better if it were "prepLightData" or "prepareLightData".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing out the issue, it has now been fixed.

Node tank = (Node) assetManager.loadModel("Models/HoverTank/Tank2.mesh.xml");
rootNode.attachChild(tank);

ColorRGBA colors[] = new ColorRGBA[]{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replica of another array.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is from some early temporary testing I did, so I don't think it impacts any functionality. I won't adjust the TestSimpleDeferredLighting.java code for now.

key.setTextureTypeHint(Texture.Type.CubeMap);
final Texture tex = assetManager.loadTexture(key);

for (Spatial geom : buggy.getChildren()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to use Spatial#depthFirstTraversal here, so that this test does not depend on the model's internal layout.

if (nb > 60) {
n.removeLight(light);
} else {
int rand = FastMath.nextRandomInt(0, 3);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add method to return a randomly selected color?

uniform sampler2D m_SplatEmissiveMap;
#endif

uniform int m_AfflictionSplatScale;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest removing "Affliction" from uniform names, since that could become confusing in the future.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I discussed renaming this in the past when I submitted the pr for the terrain shaders, and we ultimately decided to keep the naming because I don't think another better name could be used to describe the functionality since it does more than 1 thing.

The "affliction" feature and all related code could all be removed if really needed, it mostly was just left because it doesn't hurt anything and is a bonus feature if anyone ever wants to use it. It essentially is just an extra alpha map that uses the R channel for a desaturation effect (to simulate things like grass textures turning brown/gray) and in the G channel it does texture splatting with suppor for noise to look natural with a low-res alpha map.

So I uiltimately called this unique alpha-mapping "affliction" since that encompassed the 2 features based on how they are used in my game to "afflict" the terrain with desaturation and slime effects dynamically. (and in the future I plan to add things like dynamic wetness and dynamic snowy-ness to the remaining 2 texture channels of the affliction alpha map.

So I would ultimately advise not removing the word "affliction" from anything since its an optional feature and shouldn't be confused with other normal terrain textures in the shader. Or if the affliction feature causes any issues with this PR, then it would also be okay to just remove all of the affliction related params and gut the features entirely.

Edit: I just looked through the shader and it appears all the changes are related to the lighting calculations, whereas the affliction splatting stuff is all texture-read related. So it shouldn't break anything, but of course feel free to remove it if I'm wrong and it causes any issues or confusion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file looks like a nightmare to maintain. Is there a way to combine all the tasks in a #for, since most of this code looks copy/pasted?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant to refactor to use the #for loops in the original TerrainLighting.frag shader (which TerrainLightingGBufferPack.frag appears to be based on) however I unfortunately forgot after doing it for the PBR shaders, but I still plan to do that.

It would be a good addition to this PR, however I do notice that the #for loops are related to the shader's texture reads (and not the lighting calculations which this pr seems to be focused on) and the texture reading code all appears to be identical to the original shader its derrived from (which is great for maintainability) and the shaders only deviate in the lighting calculation. So if @JohnLKkk doesn't manage to refactor the texture reads in this shader to use the for loops in this PR, I will add it to my to-do list when I refactor the other original TerrainLighting.frag to do the same.

@JohnLKkk
Copy link
Contributor Author

I don't understand a lot about rendering, so I probably won't catch any major issues. Hopefully this review will be helpful anyway. 😉 I've refrained from mentioning javadoc and basic style issues, since it sounds like you'll be working on that soon.

Thank you for your valuable suggestions. I will refer to most of the suggestions and only need to make corresponding modifications and adjustments.

@JohnLKkk
Copy link
Contributor Author

Each Java sourcefile you add to the repo should have the full JME license at the top of the file, with the current year for the copyright date.

I have just supplemented a large number of core comments as well as complete JME license information in each file.

@zzuegg
Copy link
Member

zzuegg commented Nov 1, 2023

I would prefer a nice, clean, easy to use framegraph api in this PR. That is the foundation of all following, and that should be implemented first. And like John provided, an example how to use it but from user space, not by modifying the core again.

This is the point where tests can be made on various scenarios to see if the framegraph api offers enough flexibility without running into configuration hell.
Minimal api footprint as a start. It is always easy to add stuff later on. Removing things breaks things.

@JohnLKkk
Copy link
Contributor Author

JohnLKkk commented Nov 1, 2023

I would prefer a nice, clean, easy to use framegraph api in this PR. That is the foundation of all following, and that should be implemented first. And like John provided, an example how to use it but from user space, not by modifying the core again.

This is the point where tests can be made on various scenarios to see if the framegraph api offers enough flexibility without running into configuration hell. Minimal api footprint as a start. It is always easy to add stuff later on. Removing things breaks things.

Perhaps we can decide the usage of frameGraph in the SimpleApplication application layer in this PR? I will reference the user-facing usage interface you provided, but I'm not sure if this PR should add that part (because this PR is mainly about the rendering path). Also, if we decide to add a frameGraph interface in this PR that won't eventually change the usage flow in the SimpleApplication layer, I still need to keep the fallbackFrameGraph member variable in RenderManager in this PR to address some issues I haven't sorted out yet. Would it be okay to have some intermediates in this PR and future versions, but no breaking changes to the SimpleApplication layer interface?

@pspeed42
Copy link
Contributor

pspeed42 commented Nov 1, 2023

To me it feels logical to have a separate PR for the framegraph changes and then this PR can depend on that one.

I don't know if that causes issues, though... because we already suggested it and there was some problem doing it.

@JohnLKkk
Copy link
Contributor Author

JohnLKkk commented Nov 1, 2023

I would prefer a nice, clean, easy to use framegraph api in this PR. That is the foundation of all following, and that should be implemented first. And like John provided, an example how to use it but from user space, not by modifying the core again.

This is the point where tests can be made on various scenarios to see if the framegraph api offers enough flexibility without running into configuration hell. Minimal api footprint as a start. It is always easy to add stuff later on. Removing things breaks things.

  • The integration is not done at all. See all stuff hardcoded into RenderManager.java
  • This PR add methods/types that are not used in any code
  • Everything in the FrameGraph package is poorly documented
  • Naming inside the shaders (If i have to look up a java file and a project desription to see whats inside a texture it is bad to maintain)
  • It offers no more flexibility than the current backend. (Only moar lights)
  • The api is far from stable and v2 in his repository is quite different than this
  • The public api added trough this PR it will break code once it hopefully gets integrated cleanly.
  • The current implementations skips still important topics (shadows/post processing)
  • The usual formatting issues

Hi zuuegg, Thanks for the summary. If I understand correctly your points are: we have some hard-coded stuff in RenderManager we have new methods that are not used anywhere else - is it an issue? it doesn't break anything. it's a new foundation and likely to add new stuff that will be used later on FrameGraph is poorly documented - fixable Naming in shaders can be better We only get more lights - I guess more features will add much more code to this already huge PR The API is not stable - johnLkkk is handling it in V2 The public API added will introduce breaking changes to the current version - is it avoidable? Shandows / post processing is not improved in this PR - again, more features will add much more code to this already huge PR general formatting - I see several reviewers commented and johnLkkk fixed in all concrete comments

so, in general I think we have 2 major points here: hard-coded stuff in RenderManager new API introduces breaking changes

regarding the hard-coded stuff I need to go back and see johnLkkk's response and how sever it is regarding the breaking changes - @JohnLKkk - can you elaborate what us (the end users) need to change in current code?

Thanks again!

Perhaps I haven't considered all cases. I assumed most jme3 users are using the JME3 engine based on SimpleApplication, so even if I adjust RenderManager and other internal module code in the future, as long as it doesn't invasively impact the interfaces and usage of the upper layer SimpleApplication, it could work (because I assume most JME3 users won't look at and develop based on engine code like RenderManager, so I can have some intermediate code in these codes, and refactor slowly later)?
For post-processing, I currently haven't encapsulated them well, because they are irrelevant to this PR, but I tried to first make them work with the current rendering path and FG, and have no impact on SimpleApplication.
Maybe @zzuegg is worried that after I leave halfway in the future, no one will refactor this part of the code, so the best I can do is create a RenderManager2, SceneProcessor2 etc, keep the modifications in these new java duplicates, and then in SimpleApplication, specify to use RenderManager or RenderManager2? This will retain all old RenderManager code, and RenderManager2 will only need my own maintenance, or I don't need to care about that RenderManager2 after I leave?
To prevent people from worrying that I might leave halfway through, I will set enableFlags on all these new features and put them in separate module duplicates (e.g. RenderManager2 and RenderManager both inherit from AbsRenderManager), this seems to be able to alleviate people's concerns about the future to some extent?
If this approach is best, I think I can adjust the code and re-push over the weekend.
Sorry, I'm trying to find some balance in future PRs and current JME3 code to facilitate me developing new technologies (of course, I proposed creating a lab branch for real-time new tech experiments without PRs, but that approach also has obvious disadvantages).

@JohnLKkk
Copy link
Contributor Author

JohnLKkk commented Nov 1, 2023

To me it feels logical to have a separate PR for the framegraph changes and then this PR can depend on that one.

I don't know if that causes issues, though... because we already suggested it and there was some problem doing it.

My original idea was to improve FG in subsequent multi-pass PRs. In this current PR, I tried to first make the rendering path, FG compatible with existing JME3 code (meaning this PR only first embeds FG in engine code without providing external interfaces). However, if people hope that this PR can provide external usage interfaces for FG and ensure that the usage will not change in the future, I will consider adding external FG interfaces on top of this PR (but I probably won't have time to adjust internal FG interfaces for now).

@JohnLKkk
Copy link
Contributor Author

JohnLKkk commented Nov 1, 2023

This is the point where tests can be made on various scenarios to see if the framegraph api offers enough flexibility without running into configuration hell.
Minimal api footprint as a start. It is always easy to add stuff later on. Removing things breaks things.

The current FG is not flexible enough yet and still requires many features to be added, but can we first discuss the final external usage interfaces and provide implementation details for the minimal code currently available, to ensure SimpleApplication can use "a little bit" of FG functionality in its current state, and allow me to implement FG internal logic in subsequent multi-pass PRs?

@JohnLKkk
Copy link
Contributor Author

JohnLKkk commented Nov 1, 2023

To me it feels logical to have a separate PR for the framegraph changes and then this PR can depend on that one.

I don't know if that causes issues, though... because we already suggested it and there was some problem doing it.

What you mentioned is an approach. To be honest, I scattered the "features" across multiple PRs (PR1->PR2->PR3). Perhaps like what I or others have said, there should be a "development" branch or "lab" branch to implement new technologies. Maybe I misunderstood something, I'm currently using the master branch as the "development" branch, so I scattered features across multiple PRs for implementation.

@JohnLKkk
Copy link
Contributor Author

JohnLKkk commented Nov 1, 2023

I did it once for my PBR terrains before they got merged to core, and it was not fun and took a lot of my time trying to overcome minor bugs and issues learning and using the interface for the place I was instructed to upload my library to. Time I'd have rather spent working on the actual shaders but instead was getting frustrated trying to learn a new websites interface. I'd say it was a valuable learning experience, but I completely forget the process because it was so long ago and the Jfrog place I was uploading to was apparently getting shut down shortly after I started using it, so that was discouraging lol. Needless to say I do not look forward to relearning this all again when I make another 3rd party library.

You spoke my inner thoughts, thank you.

@pspeed42
Copy link
Contributor

pspeed42 commented Nov 1, 2023

No one is talking about third party libraries anymore. You guys already shot and killed that horse then buried it, dug it back up, burned it, smashed it into bits and buried it again. We get it. Spending 2 hours to learn maven publish is 2 hours better spent on something else... even when we were ready to make that process part of the engine infrastructure. We give up on that. So we are in "make the branch perfect" mode.

Anyway, what we have is a PR. PRs are just fancy branches. They don't have to be based on master.

PR to make the engine more flexible can be the basis of other PRs. It's quite common to work this way.

But if the existing engine cannot be easily converted to run framegraphs then maybe that hasn't finished cooking yet. That's fine too. Once you get it all perfect then we can look at ways to make it more reviewable.

@oxplay2
Copy link

oxplay2 commented Nov 1, 2023

i think Paul you misunderstand general thought what he meant.

Anyway if there is so much problem for single person, it seems like experimental branch in JME would be way to go. (and i guess John is fine with this way too). I still remember as new JME user i were using Nightly builds to see new incoming things.

Its still in core, it can be tested by "normal-user" people - so all would seem fine like this too.

I would not care about naming here, it can be lab or experimental or nightly, but general idea would be to make it accessible for everyone and integrated with core. Were both of this are required. So for example if there will be time to implement multiple render backends, it would be easy to integrate with core-code + test by normal users.

While JME versions could be of non-experimental(default) branch, when experimental one can be used and tested, it could be merged when time comes.

@yaRnMcDonuts
Copy link
Contributor

yaRnMcDonuts commented Nov 1, 2023

even when we were ready to make that process part of the engine infrastructure. We give up on that. So we are in "make the branch perfect" mode.

This is still a good idea, and it would be useful to still do in in case we end up in a similar scenario in the future. Some type of engine infrastructure to easily upload and post new versions of libraries or even just some documentation or tutorial video to show how exactly to do it would probably make contributors much less averse to the idea in the future.

@zzuegg
Copy link
Member

zzuegg commented Nov 2, 2023

Maybe @zzuegg is worried that after I leave halfway in the future

No, i am worried that you take shortcuts instead of a clean api.

Lets take the RenderPath as example. For what do you need that variable? As far i see, it is used only to choose from the different framegraph definitions you choose to hard code inside rendermanager. (ShortCut #1)

Now, when implementing the TileBased version you needed some variables. Instead of adjusting the FG api to be able to work on some kind of settings, you choose to hardcode them in rendermanagers. (ShortCut #2)

Now, at this stage, in the very very beginning you took two shortcuts that makes it impossible for engine users to customize the Framegraph api. You will see in future iterations that you have limited yourself.

Now, to keep yourself of those short cuts, you should make rendermanager/viewport able to render using a framegraph, thats it!
All your features should be developed the same way any user can write features. No special access privileges.

I do not have time to write a more detailed explanation where i already see issues. I am still open for a collaboration, but i would prefer a quieter place where we can discuss technical aspects without other topics dropping in.

@JohnLKkk
Copy link
Contributor Author

JohnLKkk commented Nov 2, 2023

No, i am worried that you take shortcuts instead of a clean api.

I did take shortcuts in this PR, as I have explained several times (I need some intermediate artifacts during the transition period to facilitate my feature development), as you said, you don't recommend having intermediate artifact code exist in master, then, I suggest marking this PR as a "Dev PR"(@stephengold ) until I complete FG (which may take some time). Alternatively, I will remove FG entirely from this PR and implement the three rendering paths in the old pipeline way.

These days, I have been thinking about an issue,
Regarding new technologies (as well as future global illumination, VRS, PRT and other new technologies), such as the FG system here, my thinking is: the final application layer interface of the JME FG system, and which scheme to choose, should not be decided by me, or you, or any one person, but should be decided by the JME community through voting, although not everyone is familiar with or understands, but I think it is fair for everyone in the community to participate in discussing the final suitable solution for new technologies.
I am familiar with UE5's RDG (FG), also familiar with U3D's FG, and I have also touched some other FGs, their implementation and external interfaces are slightly different.
I will find some time to create a separate topic, and provide the usage and external interfaces of FGs in different engines, so that everyone in the JME community can participate in the discussion and vote on which scheme we should choose as the final FG system for JME3.
Does anyone have any better suggestions on this? This is what I think is the fairest way for new technologies to be incorporated into JME with which solution, because JME belongs to everyone, not decided by you or me or any one person.

@stephengold
Copy link
Member

I suggest marking this PR as a "Dev PR"(@stephengold ) until I complete FG

I don't know what you mean by that. Are you suggesting I re-title this PR? Or are referring to some mechanism build into GitHub? Please elaborate.

@stephengold
Copy link
Member

the final application layer interface of the JME FG system, and which scheme to choose, should not be decided by me, or you, or any one person, but should be decided by the JME community through voting, although not everyone is familiar with or understands, but I think it is fair for everyone in the community to participate in discussing the final suitable solution for new technologies.

I love having technical discussions that anyone can participate in, and I find straw polls cute and amusing. However, I'm opposed to making technical decisions via an open poll. Such decisions should be made by responsible, informed individuals with a deep understanding of the issues. Open polls risk uninformed participants and sockpuppetry.

In this instance, I'm not well informed on the subject matter, so I'm waiting for a consensus to emerge.

@oxplay2
Copy link

oxplay2 commented Nov 2, 2023

@stephengold
there is no consensus since zzuegg want "FG flexibility feature" at this first PR and this first one to be already ideal, while John plan was to prepare everything step by step in next PRs.

While i would agree about missing docs/one-unused-variable, other things are just like feature requests for first pr.

So i still think my earlier idea would be consensus here.

I think John meant he just will add next features into this PR(like finished all FG code), thats what he meant probably.
John please explain if im wrong. But i think its already possible, Sgold would just wait, its not like release is on rush.

@pspeed42
Copy link
Contributor

pspeed42 commented Nov 2, 2023

We should also avoid adding things to the public API that will just get ripped out again in the immediate next version.

If the code needs time to bake then give it time to bake. There is no reason to rush adding it to core. People can already try it out if they like and will recognize that the API is in flux.

Once something goes into a real public release, it's a minimum of two more dot versions before it can be removed again. If it's not ready yet then it's not ready yet.

jme3 took a long time, too, and that popped out almost fully baked.

@stephengold
Copy link
Member

I understand it's not easy to break down a big feature into steps that make sense by themselves.
Currently JME 3.7 has no release manager and no schedule, so I see no rush to integrate this PR.
@JohnLKkk are you willing and able to add more features to your JohnLKkk:master branch?

@zzuegg
Copy link
Member

zzuegg commented Nov 2, 2023

I was not expecting a full featured UE RDG in this first pull request. I was expecting that the features you use in this first pull request are available to the end user. And as far as this pull request is considered, cleaning up those hard codes is doable.

You are probably correct that we need to settle for a public api first. Maybe that should have been the very first step. At least it would be clear to everyone what featureset the api offers, and what parts of the engine have to be changed to support it.
Then you could probably add feature by feature. If that has to be the jme master branch, or if features should be collected in a jme framegraph branch is open for discussion i think

@JohnLKkk
Copy link
Contributor Author

JohnLKkk commented Nov 4, 2023

I suggest marking this PR as a "Dev PR"(@stephengold ) until I complete FG

I don't know what you mean by that. Are you suggesting I re-title this PR? Or are referring to some mechanism build into GitHub? Please elaborate.

Currently, I'm looking for a consensus on what this PR should contain. My original plan was as @oxplay2 described, but @zzuegg felt that this PR should not contain these temporary shortcut codes. To that end, I proposed a solution: Could we decide in this PR what the public API for FG should look like? I will later explain the API forms of UE RDG and U3D FG. Then we decide on a final form of the FG public API in this PR, and we won't change these public APIs in subsequent development.

the final application layer interface of the JME FG system, and which scheme to choose, should not be decided by me, or you, or any one person, but should be decided by the JME community through voting, although not everyone is familiar with or understands, but I think it is fair for everyone in the community to participate in discussing the final suitable solution for new technologies.

I love having technical discussions that anyone can participate in, and I find straw polls cute and amusing. However, I'm opposed to making technical decisions via an open poll. Such decisions should be made by responsible, informed individuals with a deep understanding of the issues. Open polls risk uninformed participants and sockpuppetry.

In this instance, I'm not well informed on the subject matter, so I'm waiting for a consensus to emerge.

As for whether to create a topic for everyone to vote, you may be right, people unfamiliar with it should not participate in voting to decide the result, but at least let the JME community know the API forms of the new technology, and which FG public API we ultimately choose.

@JohnLKkk
Copy link
Contributor Author

JohnLKkk commented Nov 4, 2023

I understand it's not easy to break down a big feature into steps that make sense by themselves. Currently JME 3.7 has no release manager and no schedule, so I see no rush to integrate this PR. @JohnLKkk are you willing and able to add more features to your JohnLKkk:master branch?

Ultimately, once we finalize the FG public API, I will continue to develop the code for this PR, so the PR remains open (I don't know if there is a Dev tag or something, if not, just keep this PR open, and I will modify the functional content of the PR afterwards).

@JohnLKkk
Copy link
Contributor Author

JohnLKkk commented Nov 4, 2023

@stephengold there is no consensus since zzuegg want "FG flexibility feature" at this first PR and this first one to be already ideal, while John plan was to prepare everything step by step in next PRs.

While i would agree about missing docs/one-unused-variable, other things are just like feature requests for first pr.

So i still think my earlier idea would be consensus here.

I think John meant he just will add next features into this PR(like finished all FG code), thats what he meant probably. John please explain if im wrong. But i think its already possible, Sgold would just wait, its not like release is on rush.

Yes, so we need to reach a consensus here.

@JohnLKkk
Copy link
Contributor Author

JohnLKkk commented Nov 4, 2023

You are probably correct that we need to settle for a public api first. Maybe that should have been the very first step. At least it would be clear to everyone what featureset the api offers, and what parts of the engine have to be changed to support it.

Yes, I think this is feasible, to finalize the FG Public API, then I continue adding these codes to this PR, and won't break the FG public API in the future unless absolutely necessary.

@JohnLKkk
Copy link
Contributor Author

JohnLKkk commented Nov 4, 2023

UseFramegraph(Still in development...)

@stephengold I have modified the content until this PR completes the FG Public API. For now, just keep the PR open.

@JohnLKkk
Copy link
Contributor Author

JohnLKkk commented Nov 4, 2023

Do others have anything to add? If not for now, then I will organize some related content a bit later (probably tomorrow), then we can discuss in the community what the JME FG public API should look like.
@oxplay2 @stephengold @capdevon @yaRnMcDonuts @zzuegg @pspeed42 (If I missed others, please let me know. Thank you.)

@stephengold
Copy link
Member

There's no rush to close this PR, just like there's no rush to integrate it.

@JohnLKkk as creator of this PR, you can mark it as a "draft", to indicate it's a work in progress and/or not ready for review.
https://stackoverflow.com/questions/55070723/how-do-i-change-from-a-pr-to-a-draft-pr-at-github

@JohnLKkk JohnLKkk marked this pull request as draft November 5, 2023 07:55
@JohnLKkk
Copy link
Contributor Author

JohnLKkk commented Nov 5, 2023

There's no rush to close this PR, just like there's no rush to integrate it.

@JohnLKkk as creator of this PR, you can mark it as a "draft", to indicate it's a work in progress and/or not ready for review. https://stackoverflow.com/questions/55070723/how-do-i-change-from-a-pr-to-a-draft-pr-at-github

I have changed it to "Draft" status until we finalize the public API in this post and complete the public API(https://hub.jmonkeyengine.org/t/on-framegraph-in-the-future-of-jme/47240?u=jhonkkk), then re-enter review.
Thank you for your guidance.

@capdevon
Copy link
Contributor

capdevon commented Jan 22, 2024

Hi @JohnLKkk , is this PR complete and integrable for testing in the next alpha version of the engine? We are all excited about these changes that should improve the graphical performance of the engine. Please let us know if you are still working on it.

@codex128 codex128 mentioned this pull request May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement hacktoberfest-accepted PRs that are Hacktoberfest valid (Optional if PR is merged or approved during the month of october)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants