remove geometry shader support
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2024-09-18 16:03:26 -04:00
parent 6088080257
commit ab17254a02
10 changed files with 24 additions and 60 deletions

View File

@ -800,6 +800,7 @@ Initial hitstun implementation
Migrate documentation
Netcode generator qol fixes
Combat Stances Component
Remove geometry shader support
# TODO

View File

@ -636,7 +636,7 @@ public class Globals {
assetManager.addModelPathToQueue("Models/basic/geometry/unitplane.fbx");
assetManager.addModelPathToQueue("Models/basic/geometry/unitcube.fbx");
imagePlaneModelID = assetManager.registerModel(RenderUtils.createPlaneModel("Shaders/core/plane/plane.vs", "Shaders/core/plane/plane.fs"));
assetManager.addShaderToQueue("Shaders/core/plane/plane.vs", null, "Shaders/core/plane/plane.fs");
assetManager.addShaderToQueue("Shaders/core/plane/plane.vs", "Shaders/core/plane/plane.fs");
solidPlaneModelID = assetManager.registerModel(RenderUtils.createInWindowPanel("Shaders/ui/plainBox/plainBox.vs", "Shaders/ui/plainBox/plainBox.fs"));
//image panel
@ -645,11 +645,11 @@ public class Globals {
Globals.assetManager.addShaderToQueue("Shaders/ui/plainBox/plainBox.vs", "Shaders/ui/plainBox/plainBox.fs");
//window content shader
assetManager.addShaderToQueue("Shaders/ui/windowContent/windowContent.vs", null, "Shaders/ui/windowContent/windowContent.fs");
assetManager.addShaderToQueue("Shaders/ui/windowContent/windowContent.vs", "Shaders/ui/windowContent/windowContent.fs");
//debug shaders
assetManager.addShaderToQueue("Shaders/ui/debug/windowBorder/windowBound.vs", null, "Shaders/ui/debug/windowBorder/windowBound.fs");
assetManager.addShaderToQueue("Shaders/ui/debug/windowContentBorder/windowContentBound.vs", null, "Shaders/ui/debug/windowContentBorder/windowContentBound.fs");
assetManager.addShaderToQueue("Shaders/ui/debug/windowBorder/windowBound.vs", "Shaders/ui/debug/windowBorder/windowBound.fs");
assetManager.addShaderToQueue("Shaders/ui/debug/windowContentBorder/windowContentBound.vs", "Shaders/ui/debug/windowContentBorder/windowContentBound.fs");
//as these assets are required for the renderer to work, we go ahead and
//load them into memory now. The loading time penalty is worth it I think.

View File

@ -120,18 +120,11 @@ public class AssetManager {
LoggerInterface.loggerEngine.DEBUG_LOOP("AssetManager - Load shaders");
for(ActorShaderMask currentShader : shadersInQueue){
shadersInQueue.remove(currentShader);
String key = getShaderKey(currentShader.getVertexShaderPath(),currentShader.getGeometryShaderPath(),currentShader.getFragmentShaderPath());
if(currentShader.getGeometryShaderPath() == null){
shadersLoadedIntoMemory.put(
key,
ShaderProgram.loadSpecificShader(currentShader.getVertexShaderPath(),currentShader.getFragmentShaderPath())
);
} else {
shadersLoadedIntoMemory.put(
key,
ShaderProgram.loadSpecificShader(currentShader.getVertexShaderPath(),currentShader.getGeometryShaderPath(),currentShader.getFragmentShaderPath())
);
}
String key = getShaderKey(currentShader.getVertexShaderPath(),currentShader.getFragmentShaderPath());
shadersLoadedIntoMemory.put(
key,
ShaderProgram.loadSpecificShader(currentShader.getVertexShaderPath(),currentShader.getFragmentShaderPath())
);
}
//pose models
LoggerInterface.loggerEngine.DEBUG_LOOP("AssetManager - Load pose models");
@ -396,15 +389,11 @@ public class AssetManager {
//SHADERS
//
public void addShaderToQueue(String vertexShader, String fragmentShader){
shadersInQueue.add(new ActorShaderMask("","",vertexShader,null,fragmentShader));
shadersInQueue.add(new ActorShaderMask("","",vertexShader,fragmentShader));
}
public void addShaderToQueue(String vertexShader, String geometryShader, String fragmentShader){
shadersInQueue.add(new ActorShaderMask("","",vertexShader,geometryShader,fragmentShader));
}
public ShaderProgram fetchShader(String vertexPath, String geometryShader, String fragmentPath){
String path = getShaderKey(vertexPath,geometryShader,fragmentPath);
public ShaderProgram fetchShader(String vertexPath, String fragmentPath){
String path = getShaderKey(vertexPath,fragmentPath);
ShaderProgram rVal = null;
if(shadersLoadedIntoMemory.containsKey(path)){
rVal = shadersLoadedIntoMemory.get(path);
@ -412,8 +401,8 @@ public class AssetManager {
return rVal;
}
static String getShaderKey(String vertexPath, String geometryPath, String fragmentPath){
return vertexPath + "-" + geometryPath + "-" + fragmentPath;
static String getShaderKey(String vertexPath, String fragmentPath){
return vertexPath + "-" + fragmentPath;
}
/**
@ -422,10 +411,7 @@ public class AssetManager {
public void forceReloadAllShaders(){
for(String shaderKey : shadersLoadedIntoMemory.keySet()){
String shaderPaths[] = shaderKey.split("-");
if(shaderPaths[1].equals("null")){
shaderPaths[1] = null;
}
shadersInQueue.add(new ActorShaderMask("","",shaderPaths[0],shaderPaths[1],shaderPaths[2]));
shadersInQueue.add(new ActorShaderMask("","",shaderPaths[0],shaderPaths[1]));
}
shadersLoadedIntoMemory.clear();
}

View File

@ -613,18 +613,7 @@ public class Actor {
* @param fragmentShader the fragment shader to apply
*/
public void maskShader(String mesh, String vertexShader, String fragmentShader){
shaderMasks.add(new ActorShaderMask(this.modelPath, mesh, vertexShader, null, fragmentShader));
}
/**
* Masks a shader with another shader
* @param mesh the mesh to apply the mask on
* @param vertexShader the vertex shader to apply
* @param geometryShader the geometry shader to apply
* @param fragmentShader the fragment shader to apply
*/
public void maskShader(String mesh, String vertexShader, String geometryShader, String fragmentShader){
shaderMasks.add(new ActorShaderMask(this.modelPath, mesh, vertexShader, geometryShader, fragmentShader));
shaderMasks.add(new ActorShaderMask(this.modelPath, mesh, vertexShader, fragmentShader));
}
/**

View File

@ -11,8 +11,6 @@ public class ActorShaderMask {
String meshName;
//the vertex shader
String vertexShaderPath;
//the geometry shader
String geometryShaderPath;
//the fragment shader
String fragmentShaderPath;
@ -21,14 +19,12 @@ public class ActorShaderMask {
* @param modelName
* @param meshName
* @param vertexShaderPath
* @param geometryShaderPath
* @param fragmentShaderPath
*/
public ActorShaderMask(String modelName, String meshName, String vertexShaderPath, String geometryShaderPath, String fragmentShaderPath){
public ActorShaderMask(String modelName, String meshName, String vertexShaderPath, String fragmentShaderPath){
this.modelName = modelName;
this.meshName = meshName;
this.vertexShaderPath = vertexShaderPath;
this.geometryShaderPath = geometryShaderPath;
this.fragmentShaderPath = fragmentShaderPath;
}
@ -56,14 +52,6 @@ public class ActorShaderMask {
return vertexShaderPath;
}
/**
* Gets the geometry shader path
* @return the geometry shader path
*/
public String getGeometryShaderPath(){
return geometryShaderPath;
}
/**
* Gets the fragment shader path
* @return the fragment shader path

View File

@ -84,7 +84,7 @@ public class InstanceManager {
data.fillBuffers();
//fetch model/shader and draw if both available
ShaderProgram shader = Globals.assetManager.fetchShader(data.getVertexShader(), null, data.getFragmentShader());
ShaderProgram shader = Globals.assetManager.fetchShader(data.getVertexShader(), data.getFragmentShader());
Model model = Globals.assetManager.fetchModel(modelPath);
if(model != null && shader != null){
openGLState.setActiveShader(renderPipelineState, shader);

View File

@ -62,7 +62,7 @@ public class TextureInstancedActor {
*/
public void draw(RenderPipelineState renderPipelineState, OpenGLState openGLState){
Model model = Globals.assetManager.fetchModel(modelPath);
ShaderProgram shader = Globals.assetManager.fetchShader(vertexShaderPath, null, fragmentShaderPath);
ShaderProgram shader = Globals.assetManager.fetchShader(vertexShaderPath, fragmentShaderPath);
if(model != null && shader != null){
//setup render pipeline
boolean instancedState = renderPipelineState.getInstanced();

View File

@ -65,7 +65,7 @@ public class DebugRendering {
planeModel = Globals.assetManager.fetchModel(Globals.imagePlaneModelID);
}
if(elementDrawDebugProgram == null){
elementDrawDebugProgram = Globals.assetManager.fetchShader("Shaders/ui/debug/windowContentBorder/windowContentBound.vs", null, "Shaders/ui/debug/windowContentBorder/windowContentBound.fs");
elementDrawDebugProgram = Globals.assetManager.fetchShader("Shaders/ui/debug/windowContentBorder/windowContentBound.vs", "Shaders/ui/debug/windowContentBorder/windowContentBound.fs");
}
if(elementDrawDebugProgram != null && planeModel != null){
parentFramebuffer.bind(Globals.renderingEngine.getOpenGLState());
@ -89,7 +89,7 @@ public class DebugRendering {
planeModel = Globals.assetManager.fetchModel(Globals.imagePlaneModelID);
}
if(windowDrawDebugProgram == null){
windowDrawDebugProgram = Globals.assetManager.fetchShader("Shaders/ui/debug/windowBorder/windowBound.vs", null, "Shaders/ui/debug/windowBorder/windowBound.fs");
windowDrawDebugProgram = Globals.assetManager.fetchShader("Shaders/ui/debug/windowBorder/windowBound.vs", "Shaders/ui/debug/windowBorder/windowBound.fs");
}
if(windowDrawDebugProgram != null && planeModel != null){
parentFramebuffer.bind(Globals.renderingEngine.getOpenGLState());

View File

@ -259,7 +259,7 @@ public class Model {
if(shaderMask.containsKey(mesh.getMeshName())){
ActorShaderMask specificMask = shaderMask.get(mesh.getMeshName());
ShaderProgram overwriteShader = null;
if((overwriteShader = Globals.assetManager.fetchShader(specificMask.getVertexShaderPath(), specificMask.getGeometryShaderPath(), specificMask.getFragmentShaderPath())) != null){
if((overwriteShader = Globals.assetManager.fetchShader(specificMask.getVertexShaderPath(), specificMask.getFragmentShaderPath())) != null){
rVal = overwriteShader;
}
}

View File

@ -21,7 +21,7 @@ public class OutlineNormalsPipeline implements RenderPipeline {
//
RenderingEngine.normalsOutlineFrambuffer.bind(openGLState);
ShaderProgram program = Globals.assetManager.fetchShader("Shaders/core/anime/outlineNormals.vs", null, "Shaders/core/anime/outlineNormals.fs");
ShaderProgram program = Globals.assetManager.fetchShader("Shaders/core/anime/outlineNormals.vs", "Shaders/core/anime/outlineNormals.fs");
if(program != null){
openGLState.setActiveShader(renderPipelineState, program);