work debugging shader issue
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
This commit is contained in:
parent
8d857f9027
commit
bd297df672
@ -1,3 +1,3 @@
|
||||
#maven.buildNumber.plugin properties file
|
||||
#Tue Aug 13 17:01:10 EDT 2024
|
||||
buildNumber=201
|
||||
#Tue Aug 13 19:04:49 EDT 2024
|
||||
buildNumber=202
|
||||
|
||||
@ -14,6 +14,9 @@
|
||||
|
||||
+ fix the vibes
|
||||
Stability
|
||||
Movement penalty while swinging weapon
|
||||
Transition animation for blocking with two hands
|
||||
Strafing walking animation
|
||||
|
||||
+ bug fixes
|
||||
Rendering pipelines are broken when the katana is not drawn
|
||||
|
||||
@ -73,6 +73,7 @@ public class CompositePipeline implements RenderPipeline {
|
||||
//Close down pipeline
|
||||
//
|
||||
GL40.glBindVertexArray(0);
|
||||
RenderingEngine.defaultFramebuffer.bind(openGLState);
|
||||
|
||||
|
||||
Globals.profiler.endCpuSample();
|
||||
|
||||
@ -126,8 +126,8 @@ public class MainContentPipeline implements RenderPipeline {
|
||||
// glDisable(GL_DEPTH_TEST);
|
||||
GL40.glDepthMask(false);
|
||||
openGLState.glBlend(true);
|
||||
GL40.glBlendFunci(0, GL40.GL_ONE, GL40.GL_ONE);
|
||||
GL40.glBlendFunci(1, GL40.GL_ZERO, GL40.GL_ONE_MINUS_SRC_COLOR);
|
||||
openGLState.glBlendFunci(0, GL40.GL_ONE, GL40.GL_ONE);
|
||||
openGLState.glBlendFunci(1, GL40.GL_ZERO, GL40.GL_ONE_MINUS_SRC_COLOR);
|
||||
GL40.glBlendEquation(GL40.GL_FUNC_ADD);
|
||||
|
||||
RenderingEngine.transparencyBuffer.bind(openGLState);
|
||||
|
||||
@ -81,6 +81,8 @@ public class NormalsForOutlinePipeline implements RenderPipeline {
|
||||
}
|
||||
}
|
||||
|
||||
RenderingEngine.defaultFramebuffer.bind(openGLState);
|
||||
|
||||
Globals.profiler.endCpuSample();
|
||||
}
|
||||
|
||||
|
||||
@ -42,6 +42,7 @@ public class PostProcessingPipeline implements RenderPipeline {
|
||||
GL40.glBindVertexArray(0);
|
||||
}
|
||||
|
||||
RenderingEngine.defaultFramebuffer.bind(openGLState);
|
||||
Globals.profiler.endCpuSample();
|
||||
}
|
||||
|
||||
|
||||
@ -36,27 +36,19 @@ public class VolumeBufferPipeline implements RenderPipeline {
|
||||
GL40.glEnable(GL40.GL_CULL_FACE);
|
||||
GL40.glCullFace(GL40.GL_FRONT);
|
||||
|
||||
//setup rendering for back faces
|
||||
openGLState.setActiveShader(renderPipelineState, RenderingEngine.volumeDepthShaderProgram);
|
||||
|
||||
RenderingEngine.volumeDepthBackfaceFramebuffer.bind(openGLState);
|
||||
GL40.glClear(GL40.GL_DEPTH_BUFFER_BIT);
|
||||
openGLState.glActiveTexture(GL40.GL_TEXTURE0);
|
||||
// glBindTexture(GL_TEXTURE_2D, woodTexture);
|
||||
// renderScene(simpleDepthShader);
|
||||
|
||||
GL40.glUniformMatrix4fv(GL40.glGetUniformLocation(openGLState.getActiveShader().getShaderId(), "view"), false, Globals.viewMatrix.get(new float[16]));
|
||||
// glUniformMatrix4fv(glGetUniformLocation(Globals.renderingEngine.getActiveShader().shaderProgram, "projection"), false, Globals.projectionMatrix.get(new float[16]));
|
||||
|
||||
|
||||
|
||||
GL40.glUniformMatrix4fv(GL40.glGetUniformLocation(openGLState.getActiveShader().getShaderId(), "projection"), false, RenderingEngine.nearVolumeProjectionMatrix.get(new float[16]));
|
||||
GL40.glUniform1f(GL40.glGetUniformLocation(openGLState.getActiveShader().getShaderId(), "linearCoef"), RenderingEngine.volumeDepthLinearCoef);
|
||||
GL40.glUniform1f(GL40.glGetUniformLocation(openGLState.getActiveShader().getShaderId(), "quadCoef"), RenderingEngine.volumeDepthQuadCoef);
|
||||
|
||||
GL40.glUniform1f(GL40.glGetUniformLocation(openGLState.getActiveShader().getShaderId(), "near"), 0.1f);
|
||||
GL40.glUniform1f(GL40.glGetUniformLocation(openGLState.getActiveShader().getShaderId(), "far"), 100f);
|
||||
|
||||
// glCullFace(GL_FRONT);
|
||||
|
||||
//
|
||||
// Set render pipeline state
|
||||
//
|
||||
@ -82,26 +74,12 @@ public class VolumeBufferPipeline implements RenderPipeline {
|
||||
Actor currentActor = EntityUtils.getActor(currentEntity);
|
||||
//calculate camera-modified vector3f
|
||||
Vector3f cameraModifiedPosition = new Vector3f((float)position.x,(float)position.y,(float)position.z).sub(CameraEntityUtils.getCameraCenter(Globals.playerCamera));
|
||||
//set projection matrix
|
||||
// if(cameraModifiedPosition.length() > 2f){
|
||||
// glUniformMatrix4fv(glGetUniformLocation(Globals.renderingEngine.getActiveShader().shaderProgram, "projection"), false, farVolumeProjectionMatrix.get(new float[16]));
|
||||
// } else if(cameraModifiedPosition.length() > 0.5f){
|
||||
// glUniformMatrix4fv(glGetUniformLocation(Globals.renderingEngine.getActiveShader().shaderProgram, "projection"), false, midVolumeProjectionMatrix.get(new float[16]));
|
||||
// } else {
|
||||
GL40.glUniformMatrix4fv(GL40.glGetUniformLocation(openGLState.getActiveShader().getShaderId(), "projection"), false, RenderingEngine.nearVolumeProjectionMatrix.get(new float[16]));
|
||||
// }
|
||||
// glUniformMatrix4fv(glGetUniformLocation(Globals.renderingEngine.getActiveShader().shaderProgram, "projection"), false, Globals.projectionMatrix.get(new float[16]));
|
||||
//calculate and apply model transform
|
||||
modelTransformMatrix = modelTransformMatrix.identity();
|
||||
modelTransformMatrix.translate(cameraModifiedPosition);
|
||||
modelTransformMatrix.rotate(EntityUtils.getRotation(currentEntity));
|
||||
modelTransformMatrix.scale(new Vector3d(EntityUtils.getScale(currentEntity)));
|
||||
currentActor.applySpatialData(modelTransformMatrix,position);
|
||||
//draw
|
||||
// if(!currentEntity.getDataKeys().contains(EntityDataStrings.TERRAIN_IS_TERRAIN) && !currentEntity.getDataKeys().contains(EntityDataStrings.DATA_STRING_CREATURE_IS_CREATURE)){
|
||||
currentActor.draw(renderPipelineState,openGLState);
|
||||
// System.out.println(currentActor.modelPath);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,7 +97,6 @@ public class VolumeBufferPipeline implements RenderPipeline {
|
||||
//calculate camera-modified vector3f
|
||||
Vector3f cameraModifiedPosition = new Vector3f((float)position.x,(float)position.y,(float)position.z).sub(CameraEntityUtils.getCameraCenter(Globals.playerCamera));
|
||||
//set projection matrix
|
||||
GL40.glUniformMatrix4fv(GL40.glGetUniformLocation(openGLState.getActiveShader().getShaderId(), "projection"), false, RenderingEngine.nearVolumeProjectionMatrix.get(new float[16]));
|
||||
modelTransformMatrix = modelTransformMatrix.identity();
|
||||
modelTransformMatrix.translate(cameraModifiedPosition);
|
||||
modelTransformMatrix.rotate(EntityUtils.getRotation(currentEntity));
|
||||
@ -135,23 +112,13 @@ public class VolumeBufferPipeline implements RenderPipeline {
|
||||
GL40.glEnable(GL40.GL_CULL_FACE);
|
||||
GL40.glCullFace(GL40.GL_BACK);
|
||||
|
||||
//setup state for depth testing front faces
|
||||
openGLState.setActiveShader(renderPipelineState, RenderingEngine.volumeDepthShaderProgram);
|
||||
|
||||
RenderingEngine.volumeDepthFrontfaceFramebuffer.bind(openGLState);
|
||||
GL40.glClear(GL40.GL_DEPTH_BUFFER_BIT);
|
||||
openGLState.glActiveTexture(GL40.GL_TEXTURE0);
|
||||
// glBindTexture(GL_TEXTURE_2D, woodTexture);
|
||||
// renderScene(simpleDepthShader);
|
||||
|
||||
// glUniformMatrix4fv(glGetUniformLocation(Globals.renderingEngine.getActiveShader().shaderProgram, "view"), false, Globals.viewMatrix.get(new float[16]));
|
||||
// glUniformMatrix4fv(glGetUniformLocation(Globals.renderingEngine.getActiveShader().shaderProgram, "projection"), false, Globals.projectionMatrix.get(new float[16]));
|
||||
|
||||
|
||||
|
||||
// GL20.glUniform1f(glGetUniformLocation(Globals.renderingEngine.getActiveShader().shaderProgram, "linearCoef"), volumeDepthLinearCoef);
|
||||
// GL20.glUniform1f(glGetUniformLocation(Globals.renderingEngine.getActiveShader().shaderProgram, "quadCoef"), volumeDepthQuadCoef);
|
||||
|
||||
// glCullFace(GL_FRONT);
|
||||
|
||||
//
|
||||
// D R A W A L L E N T I T I E S
|
||||
@ -173,10 +140,7 @@ public class VolumeBufferPipeline implements RenderPipeline {
|
||||
modelTransformMatrix.scale(new Vector3d(EntityUtils.getScale(currentEntity)));
|
||||
currentActor.applySpatialData(modelTransformMatrix,position);
|
||||
//draw
|
||||
// if(!currentEntity.getDataKeys().contains(EntityDataStrings.TERRAIN_IS_TERRAIN) && !currentEntity.getDataKeys().contains(EntityDataStrings.DATA_STRING_CREATURE_IS_CREATURE)){
|
||||
currentActor.draw(renderPipelineState,openGLState);
|
||||
// System.out.println(currentActor.modelPath);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user