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

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3b6f7b8
jme3-core:
JohnLKkk Oct 9, 2023
8479dd3
jme3-examples:Added a set of test cases for renderPath.
JohnLKkk Oct 9, 2023
e5737df
jme3-core:Improve deferred shading issues;
JohnLKkk Oct 10, 2023
d69de2d
jme3-examples:Adjust deferred rendering test code
JohnLKkk Oct 10, 2023
6e75f0b
jme3-core:Adjust GBuffer format, RT0(16F), RT1(16F), RT2(16F), RT3(32…
Oct 10, 2023
0290dcd
jme3-core:Delete test code
JohnLKkk Oct 10, 2023
6a64da6
jme3-core:Fixed all known bugs in Tile-based DeferredShading.
JohnLKkk Oct 10, 2023
c8e7426
jme3-examples:update TestTileBasedDeferredShading
JohnLKkk Oct 10, 2023
e540601
jme3-core:update GLSLCompat.glsllib
JohnLKkk Oct 10, 2023
fdea4cc
jme3-core:Fix frameGraph assertion error
JohnLKkk Oct 11, 2023
f60a03b
jme3-core:Add some core code comments, delete Chinese code comments
JohnLKkk Oct 11, 2023
b7f0b58
jme3-core:Fix bugs existed in shadingModel
JohnLKkk Oct 12, 2023
e4862a6
jme3-examples:Add test case "TestShadingModel.java,TestRenderPathPoin…
JohnLKkk Oct 12, 2023
2475337
jme3-core:GBuffer data packing for terrain rendering compatibility (u…
Oct 17, 2023
81c1362
jme3-examples:
Oct 17, 2023
05eb006
jme3-core:Add rendering path support for AdvancedPBRTerrain
JohnLKkk Oct 18, 2023
e327316
jme3-examples:Add a test code
JohnLKkk Oct 18, 2023
63222d6
jme3-core:Supplement core code comments, add full JME license to each…
JohnLKkk Oct 19, 2023
82c6dc2
jme3-terrain:Implement PBRTerrain compatibility code
JohnLKkk Oct 19, 2023
0359a8e
jme3-core:Fixed Tile-basedDeferred light culling issue, fixed some fl…
JohnLKkk Oct 20, 2023
98e0ae4
jme3-examples:update TestCode
JohnLKkk Oct 20, 2023
000fb0e
jme3-examples:update TestPBRTerrainRenderPath.java
JohnLKkk Oct 20, 2023
09a22a6
jme3-core:Fix TestTexture3D/TestTexture3DLoading
JohnLKkk Oct 20, 2023
83ac2b5
jme3-core:fix lightTexSizeInv undefined
JohnLKkk Oct 20, 2023
65fd3de
Merge branch 'master' into master
JohnLKkk Oct 20, 2023
3521b2a
jme3-core:
JohnLKkk Oct 21, 2023
224eecd
jme3-core:use g_ViewProjectionMatrixInverse
JohnLKkk Oct 22, 2023
db4f0ac
jme3-core:use logger
JohnLKkk Oct 22, 2023
dc3a50b
jme3-core:update javadoc(FastMath.nextRandomFlot)
JohnLKkk Oct 27, 2023
9e977c6
Merge branch 'master' of https://github.com/JohnLKkk/jmonkeyengine in…
JohnLKkk Oct 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 80 additions & 9 deletions jme3-core/src/main/java/com/jme3/material/TechniqueDef.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,47 @@ public class TechniqueDef implements Savable, Cloneable {
*/
public static final String DEFAULT_TECHNIQUE_NAME = "Default";

/**
* RenderPipeline.
*/
public enum Pipeline{
/**
* Default, most basic rendering
*/
Forward("Forward"),

/**
* Forward based on Cluster
*/
ForwardPlus("ForwardPlus"),

/**
* Standard Deferred Rendering
*/
Deferred("Deferred"),

/**
* Tiled Based Deferred Rendering
*/
TiledBasedDeferred("TiledBasedDeferred"),

/**
* Clustered Based Deferred Rendering
*/
ClusteredBasedDeferred("ClusteredBasedDeferred"),
;

private String text;
Pipeline(String t){
text = t;
}

@Override
public String toString() {
return text;
}
}

/**
* Describes light rendering mode.
*/
Expand Down Expand Up @@ -100,6 +141,22 @@ public enum LightMode {
*/
SinglePassAndImageBased,

/**
* Enable light rendering by using deferred single pass.
* <p>
* An array of light positions and light colors is passed to the shader
* containing the world light list for the geometry being rendered.
*/
DeferredSinglePass,

/**
* Enable light rendering by using tile-based deferred single pass.
* <p>
* An array of light positions and light colors is passed to the shader
* containing the world light list for the geometry being rendered.
*/
TileBasedDeferredSinglePass,

/**
* @deprecated OpenGL1 is not supported anymore
*/
Expand Down Expand Up @@ -156,6 +213,7 @@ public enum LightSpace {

private LightMode lightMode = LightMode.Disable;
private ShadowMode shadowMode = ShadowMode.Disable;
private Pipeline pipeline = Pipeline.Forward;
private TechniqueDefLogic logic;

private ArrayList<UniformBinding> worldBinds;
Expand Down Expand Up @@ -239,6 +297,19 @@ public void setLightMode(LightMode lightMode) {
}
}

public Pipeline getPipeline() {
return pipeline;
}

/**
* Set the pipeline
* @param pipeline the render pipeline
* @see Pipeline
*/
public void setPipeline(Pipeline pipeline){
this.pipeline = pipeline;
}

public void setLogic(TechniqueDefLogic logic) {
this.logic = logic;
}
Expand Down Expand Up @@ -514,13 +585,13 @@ private Shader loadShader(AssetManager assetManager, EnumSet<Caps> rendererCaps,
}

public Shader getShader(AssetManager assetManager, EnumSet<Caps> rendererCaps, DefineList defines) {
Shader shader = definesToShaderMap.get(defines);
if (shader == null) {
shader = loadShader(assetManager, rendererCaps, defines);
definesToShaderMap.put(defines.deepClone(), shader);
}
return shader;
}
Shader shader = definesToShaderMap.get(defines);
if (shader == null) {
shader = loadShader(assetManager, rendererCaps, defines);
definesToShaderMap.put(defines.deepClone(), shader);
}
return shader;
}

/**
* Sets the shaders that this technique definition will use.
Expand All @@ -529,7 +600,7 @@ public Shader getShader(AssetManager assetManager, EnumSet<Caps> rendererCaps, D
* @param shaderLanguages EnumMap containing all shader languages for this stage
*/
public void setShaderFile(EnumMap<Shader.ShaderType, String> shaderNames,
EnumMap<Shader.ShaderType, String> shaderLanguages) {
EnumMap<Shader.ShaderType, String> shaderLanguages) {
requiredCaps.clear();

weight = 0;
Expand Down Expand Up @@ -815,7 +886,7 @@ public TechniqueDef clone() throws CloneNotSupportedException {
try {
clone.logic = logic.getClass().getConstructor(TechniqueDef.class).newInstance(clone);
} catch (InstantiationException | IllegalAccessException
| NoSuchMethodException | InvocationTargetException e) {
| NoSuchMethodException | InvocationTargetException e) {
e.printStackTrace();
}

Expand Down
Loading