fix rendering size on nonstandard monitor
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2024-12-24 16:45:15 -05:00
parent a44d04ed6c
commit bc74b91066
6 changed files with 14 additions and 13 deletions

View File

@ -1,3 +1,3 @@
#maven.buildNumber.plugin properties file #maven.buildNumber.plugin properties file
#Fri Dec 06 21:26:11 EST 2024 #Tue Dec 24 16:29:47 EST 2024
buildNumber=600 buildNumber=603

View File

@ -8,9 +8,9 @@
extern "C" { extern "C" {
#endif #endif
#undef electrosphere_server_fluid_simulator_FluidAcceleratedSimulator_SIMULATE_TIMESTEP #undef electrosphere_server_fluid_simulator_FluidAcceleratedSimulator_SIMULATE_TIMESTEP
#define electrosphere_server_fluid_simulator_FluidAcceleratedSimulator_SIMULATE_TIMESTEP 0.01f #define electrosphere_server_fluid_simulator_FluidAcceleratedSimulator_SIMULATE_TIMESTEP 0.1f
#undef electrosphere_server_fluid_simulator_FluidAcceleratedSimulator_GRAVITY_CONST #undef electrosphere_server_fluid_simulator_FluidAcceleratedSimulator_GRAVITY_CONST
#define electrosphere_server_fluid_simulator_FluidAcceleratedSimulator_GRAVITY_CONST -1000.0f #define electrosphere_server_fluid_simulator_FluidAcceleratedSimulator_GRAVITY_CONST -100.0f
/* /*
* Class: electrosphere_server_fluid_simulator_FluidAcceleratedSimulator * Class: electrosphere_server_fluid_simulator_FluidAcceleratedSimulator
* Method: init * Method: init

View File

@ -170,7 +170,7 @@ public class Globals {
public static boolean RUN_DEMO = false; public static boolean RUN_DEMO = false;
public static boolean RUN_CLIENT = true; public static boolean RUN_CLIENT = true;
public static boolean RUN_HIDDEN = false; //glfw session will be created with hidden window public static boolean RUN_HIDDEN = false; //glfw session will be created with hidden window
public static boolean RUN_AUDIO = true; public static boolean RUN_AUDIO = false;
public static boolean RUN_SCRIPTS = true; public static boolean RUN_SCRIPTS = true;
public static boolean RUN_PHYSICS = true; //toggles whether physics is run or not public static boolean RUN_PHYSICS = true; //toggles whether physics is run or not
public static int clientCharacterID; public static int clientCharacterID;

View File

@ -41,7 +41,8 @@ public class UserSettings {
*/ */
boolean graphicsPerformanceEnableFoliageManager; boolean graphicsPerformanceEnableFoliageManager;
//resolution //resolution to render at
//this will be scaled to displayWidth/displayHeight after rendering
int renderResolutionX; int renderResolutionX;
int renderResolutionY; int renderResolutionY;
//debug //debug

View File

@ -314,12 +314,12 @@ public class RenderingEngine {
defaultFramebuffer = new Framebuffer(GL_DEFAULT_FRAMEBUFFER); defaultFramebuffer = new Framebuffer(GL_DEFAULT_FRAMEBUFFER);
//generate framebuffers //generate framebuffers
Texture screenTextureColor = FramebufferUtils.generateScreenTextureColorAlpha(openGLState, Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT); Texture screenTextureColor = FramebufferUtils.generateScreenTextureColorAlpha(openGLState, Globals.userSettings.getRenderResolutionX(), Globals.userSettings.getRenderResolutionY());
RenderingEngine.screenTextureColor = screenTextureColor; RenderingEngine.screenTextureColor = screenTextureColor;
Texture screenTextureDepth = FramebufferUtils.generateScreenTextureDepth(openGLState, Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT); Texture screenTextureDepth = FramebufferUtils.generateScreenTextureDepth(openGLState, Globals.userSettings.getRenderResolutionX(), Globals.userSettings.getRenderResolutionY());
RenderingEngine.screenTextureDepth = screenTextureDepth; RenderingEngine.screenTextureDepth = screenTextureDepth;
try { try {
Framebuffer screenFramebuffer = FramebufferUtils.generateScreenTextureFramebuffer(openGLState, Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT, screenTextureColor, screenTextureDepth); Framebuffer screenFramebuffer = FramebufferUtils.generateScreenTextureFramebuffer(openGLState, Globals.userSettings.getRenderResolutionX(), Globals.userSettings.getRenderResolutionY(), screenTextureColor, screenTextureDepth);
RenderingEngine.screenFramebuffer = screenFramebuffer; RenderingEngine.screenFramebuffer = screenFramebuffer;
} catch (Exception e){ } catch (Exception e){
LoggerInterface.loggerRenderer.ERROR(e); LoggerInterface.loggerRenderer.ERROR(e);

View File

@ -37,10 +37,10 @@ public class PostProcessingPipeline implements RenderPipeline {
*/ */
public void init(OpenGLState openGLState){ public void init(OpenGLState openGLState){
postProcessingShader = VisualShader.loadSpecificShader("Shaders/core/postprocessing/postprocessing.vs", "Shaders/core/postprocessing/postprocessing.fs"); postProcessingShader = VisualShader.loadSpecificShader("Shaders/core/postprocessing/postprocessing.vs", "Shaders/core/postprocessing/postprocessing.fs");
Texture screenTextureColor = FramebufferUtils.generateScreenTextureColorAlpha(openGLState, Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT); Texture screenTextureColor = FramebufferUtils.generateScreenTextureColorAlpha(openGLState, Globals.userSettings.getRenderResolutionX(), Globals.userSettings.getRenderResolutionY());
Texture screenTextureDepth = FramebufferUtils.generateScreenTextureDepth(openGLState, Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT); Texture screenTextureDepth = FramebufferUtils.generateScreenTextureDepth(openGLState, Globals.userSettings.getRenderResolutionX(), Globals.userSettings.getRenderResolutionY());
try { try {
postProcessBuffer = FramebufferUtils.generateScreenTextureFramebuffer(openGLState, Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT, screenTextureColor, screenTextureDepth); postProcessBuffer = FramebufferUtils.generateScreenTextureFramebuffer(openGLState, Globals.userSettings.getRenderResolutionX(), Globals.userSettings.getRenderResolutionY(), screenTextureColor, screenTextureDepth);
} catch (Exception e){ } catch (Exception e){
LoggerInterface.loggerRenderer.ERROR(e); LoggerInterface.loggerRenderer.ERROR(e);
} }
@ -54,7 +54,7 @@ public class PostProcessingPipeline implements RenderPipeline {
// //
openGLState.glDepthTest(false); openGLState.glDepthTest(false);
openGLState.glBlend(false); openGLState.glBlend(false);
openGLState.glViewport(Globals.WINDOW_WIDTH, Globals.WINDOW_HEIGHT); openGLState.glViewport(Globals.userSettings.getRenderResolutionX(), Globals.userSettings.getRenderResolutionY());
postProcessBuffer.bind(openGLState); postProcessBuffer.bind(openGLState);