Skip to content

Commit

Permalink
remove enums
Browse files Browse the repository at this point in the history
  • Loading branch information
codex128 committed May 8, 2024
1 parent f68d0ea commit 1e0af25
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 115 deletions.
55 changes: 0 additions & 55 deletions jme3-core/src/main/java/com/jme3/material/TechniqueDef.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,47 +62,6 @@ 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 @@ -215,7 +174,6 @@ 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 @@ -299,19 +257,6 @@ 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
23 changes: 0 additions & 23 deletions jme3-core/src/main/java/com/jme3/renderer/RenderManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,29 +82,6 @@
*/
public class RenderManager {

// RenderPath
public enum RenderPath {
None(-1, "None"),
Forward(0, "Forward"),
ForwardPlus(1, "ForwardPlus"),
Deferred(2, "Deferred"),
TiledDeferred(3, "TiledDeferred")
;
private int id;
private String info;
RenderPath(int id, String info){
this.id = id;
this.info = info;
}

public int getId() {
return id;
}
public String getInfo(){
return info;
}
}

private final Renderer renderer;
private final UniformBindingManager uniformBindingManager = new UniformBindingManager();
private final ArrayList<ViewPort> preViewPorts = new ArrayList<>();
Expand Down
14 changes: 0 additions & 14 deletions jme3-core/src/main/java/com/jme3/renderer/ViewPort.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ public class ViewPort {
protected boolean clearStencil = false;
private boolean enabled = true;

private RenderManager.RenderPath renderPath = RenderManager.RenderPath.None;

/**
* Creates a new viewport. User code should generally use these methods instead:<br>
* <ul>
Expand All @@ -131,18 +129,6 @@ public ViewPort(String name, Camera cam) {
this.cam = cam;
}

/**
* forceRenderPath,if None use GlobalRenderPath
* @param renderPath
*/
public void setRenderPath(RenderManager.RenderPath renderPath) {
this.renderPath = renderPath;
}

public RenderManager.RenderPath getRenderPath() {
return renderPath;
}

/**
* Returns the name of the viewport as set in the constructor.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ MaterialDef Phong Lighting {

}

Technique GBufferPass{
Pipeline Deferred
Technique GBufferPass {

VertexShader GLSL310 GLSL300 GLSL100 GLSL150: Common/MatDefs/Light/LightingGBufferPack.vert
FragmentShader GLSL310 GLSL300 GLSL100 GLSL150: Common/MatDefs/Light/LightingGBufferPack.frag

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ MaterialDef PBR Lighting {

}

Technique GBufferPass{
Pipeline Deferred
Technique GBufferPass {

VertexShader GLSL310 GLSL300 GLSL100 GLSL150: Common/MatDefs/Light/PBRLightingGBufferPack.vert
FragmentShader GLSL310 GLSL300 GLSL100 GLSL150: Common/MatDefs/Light/PBRLightingGBufferPack.frag

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ MaterialDef Unshaded {
}
}

Technique GBufferPass{
Pipeline Deferred
VertexShader GLSL310 GLSL300 GLSL150 GLSL100 : Common/MatDefs/Misc/Unshaded.vert
Technique GBufferPass {

VertexShader GLSL310 GLSL300 GLSL150 GLSL100 : Common/MatDefs/Misc/Unshaded.vert
FragmentShader GLSL310 GLSL300 GLSL150 GLSL100 : Common/MatDefs/Misc/UnshadedGBufferPack.frag

WorldParameters {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ MaterialDef DeferredShading {
}

Technique DeferredPass {

Pipeline Deferred

VertexShader GLSL310 GLSL300 GLSL100 GLSL150: Common/MatDefs/ShadingCommon/DeferredShading.vert
FragmentShader GLSL310 GLSL300 GLSL100 GLSL150: Common/MatDefs/ShadingCommon/DeferredShading.frag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ MaterialDef DeferredShading {
}

Technique TileBasedDeferredPass {

Pipeline Deferred

VertexShader GLSL310 GLSL300 GLSL100 GLSL150: Common/MatDefs/ShadingCommon/DeferredShading.vert
FragmentShader GLSL310 GLSL300 GLSL100 GLSL150: Common/MatDefs/ShadingCommon/TileBasedDeferredShading.frag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,6 @@ private void readShaderDefinition(Shader.ShaderType shaderType, String name, Str
}
}

// Pipeline <MODE>
private void readPipeline(String statement) throws IOException{
String[] split = statement.split(whitespacePattern);
if (split.length != 2){
throw new IOException("Pipeline statement syntax incorrect");
}

TechniqueDef.Pipeline pl = TechniqueDef.Pipeline.valueOf(split[1]);
technique.setPipeline(pl);
}

// LightMode <MODE>
private void readLightMode(String statement) throws IOException{
String[] split = statement.split(whitespacePattern);
Expand Down Expand Up @@ -578,7 +567,7 @@ private void readTechniqueStatement(Statement statement) throws IOException{
split[0].equals("TessellationEvaluationShader")) {
readShaderStatement(statement.getLine());
}else if(split[0].equals("Pipeline")){
readPipeline(statement.getLine());
throw new UnsupportedOperationException("Pipeline statement is not supported.");
}else if (split[0].equals("LightMode")){
readLightMode(statement.getLine());
}else if (split[0].equals("LightSpace")){
Expand Down

0 comments on commit 1e0af25

Please sign in to comment.