small rendering info display
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
This commit is contained in:
parent
980d6813c4
commit
991cef322e
@ -39,6 +39,7 @@
|
||||
+ bug fixes
|
||||
Fix light cluster mapping for foliage shader
|
||||
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 block tree preventing initiating an attack
|
||||
Fix return to title menu synchronization bug
|
||||
|
||||
@ -805,6 +805,8 @@ Work on clustered lighting
|
||||
|
||||
(09/19/2024)
|
||||
Cluster lighting completed
|
||||
ClientPointLightComponent
|
||||
Small rendering info display
|
||||
|
||||
|
||||
# TODO
|
||||
|
||||
@ -31,17 +31,25 @@ public class ImGuiRenderer {
|
||||
rendererWindow.setCallback(new ImGuiWindowCallback() {
|
||||
@Override
|
||||
public void exec() {
|
||||
if(ImGui.collapsingHeader("Shadow Map Pipeline")){
|
||||
ShadowMapPipeline shadowMapPipeline = Globals.renderingEngine.getShadowMapPipeline();
|
||||
if(ImGui.sliderFloat("Far Plane Distance", farPlaneArr, 1, 100)){
|
||||
shadowMapPipeline.setFarPlane(farPlaneArr[0]);
|
||||
if(ImGui.collapsingHeader("Pipelines")){
|
||||
ImGui.indent();
|
||||
if(ImGui.collapsingHeader("Shadow Map Pipeline")){
|
||||
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")){
|
||||
PostProcessingPipeline postProcessingPipeline = Globals.renderingEngine.getPostProcessingPipeline();
|
||||
if(ImGui.button("Toggle Blur")){
|
||||
postProcessingPipeline.setApplyBlur(!postProcessingPipeline.isApplyingBlur());
|
||||
}
|
||||
if(ImGui.collapsingHeader("OpenGL Details")){
|
||||
ImGui.text("GL_MAX_TEXTURE_IMAGE_UNITS: " + Globals.renderingEngine.getOpenGLContext().getMaxTextureImageUnits());
|
||||
ImGui.text("GL_MAX_TEXTURE_SIZE: " + Globals.renderingEngine.getOpenGLContext().getMaxTextureSize());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
52
src/main/java/electrosphere/renderer/OpenGLContext.java
Normal file
52
src/main/java/electrosphere/renderer/OpenGLContext.java
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
@ -152,6 +152,11 @@ public class RenderingEngine {
|
||||
//the opengl state
|
||||
static OpenGLState openGLState = new OpenGLState();
|
||||
|
||||
/**
|
||||
* The opengl context the rendering engine is running within
|
||||
*/
|
||||
OpenGLContext openGLContext;
|
||||
|
||||
//render pipelines
|
||||
MainContentPipeline mainContentPipeline = new MainContentPipeline();
|
||||
MainContentNoOITPipeline mainContentNoOITPipeline = new MainContentNoOITPipeline();
|
||||
@ -273,6 +278,7 @@ public class RenderingEngine {
|
||||
|
||||
//get environment constraints
|
||||
openGLState.init();
|
||||
openGLContext = new OpenGLContext();
|
||||
|
||||
//init imgui pipeline
|
||||
imGuiPipeline = new ImGuiPipeline(Globals.window, glslVersion);
|
||||
@ -657,6 +663,14 @@ public class RenderingEngine {
|
||||
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
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user