Skip to content

Commit

Permalink
Well, it looks like the debug flags don't hurt.
Browse files Browse the repository at this point in the history
The `-g` flag and `debug` option mentioned in  gdx-liftoff issue 157 don't seem to measurably hurt performance in this app. The Northern shader gets about 2400 FPS, and the radially-symmetric one gets about 800-950 FPS, regardless of debug settings.
  • Loading branch information
tommyettinger committed May 17, 2024
1 parent 7253176 commit e280c70
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ public ShaderNoise(Clipboard clippy) {
Gdx.app.exit();
return;
}
shaderRidged = new ShaderProgram(Gdx.files.internal("foam_vertex.glsl"), Gdx.files.internal("ana_fragment.glsl"));
// shaderRidged = new ShaderProgram(Gdx.files.internal("foam_vertex.glsl"), Gdx.files.internal("sonorant_fragment_ridged.glsl"));
// shaderRidged = new ShaderProgram(Gdx.files.internal("foam_vertex.glsl"), Gdx.files.internal("ana_fragment.glsl"));
shaderRidged = new ShaderProgram(Gdx.files.internal("foam_vertex.glsl"), Gdx.files.internal("sonorant_fragment_ridged.glsl"));
if (!shaderRidged.isCompiled()) {
Gdx.app.error("Shader", "error compiling shaderRidged:\n" + shaderRidged.getLog());
Gdx.app.exit();
return;
}
shader = shaderRidged;
shader = shaderStandard;
batch.setShader(shader);

// System.nanoTime() is supported by GWT 2.10.0 .
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ gdxVersion=1.12.1
graalHelperVersion=2.0.1
enableGraalNative=true
graalvmVersion=22.3.1
enableDebug=true
7 changes: 7 additions & 0 deletions lwjgl3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ run {
doNotTrackState("no changey changey")
}

if(enableDebug == 'true') {
tasks.withType(JavaCompile).configureEach {
options.debug = true
options.compilerArgs += ["-g"]
}
}

jar {
// sets the name of the .jar file this produces to the name of the game or app.
archiveFileName.set("${appName}-${version}.jar")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ public static void main(String[] args) {
private static Lwjgl3ApplicationConfiguration getDefaultConfiguration() {
Lwjgl3ApplicationConfiguration configuration = new Lwjgl3ApplicationConfiguration();
configuration.setTitle("Noise");
configuration.useVsync(true);
//// Limits FPS to the refresh rate of the currently active monitor.
configuration.setForegroundFPS(Lwjgl3ApplicationConfiguration.getDisplayMode().refreshRate);
//// If you remove the above line and set Vsync to false, you can get unlimited FPS, which can be
//// useful for testing performance, but can also be very stressful to some hardware.
//// You may also need to configure GPU drivers to fully disable Vsync; this can cause screen tearing.
configuration.useVsync(false);
configuration.setForegroundFPS(0);
// configuration.useVsync(true);
// configuration.setForegroundFPS(Lwjgl3ApplicationConfiguration.getDisplayMode().refreshRate);
configuration.setWindowedMode(width, height);
configuration.setWindowIcon("libgdx128.png", "libgdx64.png", "libgdx32.png", "libgdx16.png");
return configuration;
Expand Down

0 comments on commit e280c70

Please sign in to comment.