small rendering info display
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2024-09-19 15:13:41 -04:00
parent 980d6813c4
commit 991cef322e
5 changed files with 86 additions and 9 deletions

View File

@ -39,6 +39,7 @@
+ bug fixes + bug fixes
Fix light cluster mapping for foliage shader Fix light cluster mapping for foliage shader
Fix ui elements not storing default discrete world size on level editor menu Fix ui elements not storing default discrete world size on level editor menu
Fix static friction coeff causing player to slide on shallow slopes
Fix skeleton right strafe Fix skeleton right strafe
Fix block tree preventing initiating an attack Fix block tree preventing initiating an attack
Fix return to title menu synchronization bug Fix return to title menu synchronization bug

View File

@ -805,6 +805,8 @@ Work on clustered lighting
(09/19/2024) (09/19/2024)
Cluster lighting completed Cluster lighting completed
ClientPointLightComponent
Small rendering info display
# TODO # TODO

View File

@ -31,17 +31,25 @@ public class ImGuiRenderer {
rendererWindow.setCallback(new ImGuiWindowCallback() { rendererWindow.setCallback(new ImGuiWindowCallback() {
@Override @Override
public void exec() { public void exec() {
if(ImGui.collapsingHeader("Shadow Map Pipeline")){ if(ImGui.collapsingHeader("Pipelines")){
ShadowMapPipeline shadowMapPipeline = Globals.renderingEngine.getShadowMapPipeline(); ImGui.indent();
if(ImGui.sliderFloat("Far Plane Distance", farPlaneArr, 1, 100)){ if(ImGui.collapsingHeader("Shadow Map Pipeline")){
shadowMapPipeline.setFarPlane(farPlaneArr[0]); ShadowMapPipeline shadowMapPipeline = Globals.renderingEngine.getShadowMapPipeline();
if(ImGui.sliderFloat("Far Plane Distance", farPlaneArr, 1, 100)){
shadowMapPipeline.setFarPlane(farPlaneArr[0]);
}
} }
if(ImGui.collapsingHeader("Post Processing Pipeline")){
PostProcessingPipeline postProcessingPipeline = Globals.renderingEngine.getPostProcessingPipeline();
if(ImGui.button("Toggle Blur")){
postProcessingPipeline.setApplyBlur(!postProcessingPipeline.isApplyingBlur());
}
}
ImGui.unindent();
} }
if(ImGui.collapsingHeader("Post Processing Pipeline")){ if(ImGui.collapsingHeader("OpenGL Details")){
PostProcessingPipeline postProcessingPipeline = Globals.renderingEngine.getPostProcessingPipeline(); ImGui.text("GL_MAX_TEXTURE_IMAGE_UNITS: " + Globals.renderingEngine.getOpenGLContext().getMaxTextureImageUnits());
if(ImGui.button("Toggle Blur")){ ImGui.text("GL_MAX_TEXTURE_SIZE: " + Globals.renderingEngine.getOpenGLContext().getMaxTextureSize());
postProcessingPipeline.setApplyBlur(!postProcessingPipeline.isApplyingBlur());
}
} }
} }
}); });

View File

@ -0,0 +1,52 @@
package electrosphere.renderer;
import java.nio.IntBuffer;
import org.lwjgl.opengl.GL45;
import org.lwjgl.system.MemoryStack;
/**
* Data about the opengl context (ie, card-defined limits and so on)
*/
public class OpenGLContext {
/**
* The maximum number of textures supported
*/
int maxTextureImageUnits = 0;
/**
* The maximum texture size
*/
int maxTextureSize = 0;
/**
* Constructor
*/
protected OpenGLContext(){
try(MemoryStack stack = MemoryStack.stackPush()){
IntBuffer lookupBuf = stack.ints(1);
GL45.glGetIntegerv(GL45.GL_MAX_TEXTURE_IMAGE_UNITS, lookupBuf);
maxTextureImageUnits = lookupBuf.get(0);
GL45.glGetIntegerv(GL45.GL_MAX_TEXTURE_SIZE,lookupBuf);
maxTextureSize = lookupBuf.get(0);
}
}
/**
* Gets GL_MAX_TEXTURE_IMAGE_UNITS
* @return GL_MAX_TEXTURE_IMAGE_UNITS
*/
public int getMaxTextureImageUnits(){
return maxTextureImageUnits;
}
/**
* Gets the max texture size
* @return The max texture size
*/
public int getMaxTextureSize(){
return maxTextureSize;
}
}

View File

@ -152,6 +152,11 @@ public class RenderingEngine {
//the opengl state //the opengl state
static OpenGLState openGLState = new OpenGLState(); static OpenGLState openGLState = new OpenGLState();
/**
* The opengl context the rendering engine is running within
*/
OpenGLContext openGLContext;
//render pipelines //render pipelines
MainContentPipeline mainContentPipeline = new MainContentPipeline(); MainContentPipeline mainContentPipeline = new MainContentPipeline();
MainContentNoOITPipeline mainContentNoOITPipeline = new MainContentNoOITPipeline(); MainContentNoOITPipeline mainContentNoOITPipeline = new MainContentNoOITPipeline();
@ -273,6 +278,7 @@ public class RenderingEngine {
//get environment constraints //get environment constraints
openGLState.init(); openGLState.init();
openGLContext = new OpenGLContext();
//init imgui pipeline //init imgui pipeline
imGuiPipeline = new ImGuiPipeline(Globals.window, glslVersion); imGuiPipeline = new ImGuiPipeline(Globals.window, glslVersion);
@ -657,6 +663,14 @@ public class RenderingEngine {
return openGLState; return openGLState;
} }
/**
* Gets the opengl context that the rendering engine is running within
* @return The opengl context
*/
public OpenGLContext getOpenGLContext(){
return openGLContext;
}
/** /**
* Tries to recapture the screen * Tries to recapture the screen
*/ */