Skip to content

Commit

Permalink
Add new performance option dynamicRenderFullChunksOnly, defaults to t…
Browse files Browse the repository at this point in the history
…rue.

This alters behavior slightly, disabling dynamic renderer subdivision, this should result in better performance in general, video cards tend to stall at times making it subdivide otherwise normally detailed chunks, which causes performance to degrade.
  • Loading branch information
AlgorithmX2 committed Dec 10, 2016
1 parent 95eb277 commit 2f3ae65
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/main/java/mod/chiselsandbits/config/ModConfig.java
Expand Up @@ -171,6 +171,9 @@ public class ModConfig extends Configuration
@Configured( category = "Client Performance Settings" )
public boolean defaultToDynamicRenderer;

@Configured( category = "Client Performance Settings" )
public boolean dynamicRenderFullChunksOnly;

@Configured( category = "Balance Settings" )
public boolean damageTools;

Expand Down Expand Up @@ -343,6 +346,7 @@ private void setDefaults()
dynamicMaxConcurrentTessalators = 32; // in low memory this acts as 2.
forceDynamicRenderer = false;
defaultToDynamicRenderer = false;
dynamicRenderFullChunksOnly = true;
useVBO = UseVBO.AUTOMATIC;

showUsage = true;
Expand Down
Expand Up @@ -243,6 +243,7 @@ private void uploadDisplaylists()
}

final Stopwatch w = Stopwatch.createStarted();
final boolean dynamicRenderFullChunksOnly = ChiselsAndBits.getConfig().dynamicRenderFullChunksOnly;
final int maxMillisecondsPerBlock = ChiselsAndBits.getConfig().maxMillisecondsPerBlock;
final int maxMillisecondsUploadingPerFrame = ChiselsAndBits.getConfig().maxMillisecondsUploadingPerFrame;

Expand All @@ -260,7 +261,7 @@ private void uploadDisplaylists()
final Stopwatch sw = Stopwatch.createStarted();
uploadDisplayList( t );

if ( sw.elapsed( TimeUnit.MILLISECONDS ) > maxMillisecondsPerBlock )
if ( !dynamicRenderFullChunksOnly && sw.elapsed( TimeUnit.MILLISECONDS ) > maxMillisecondsPerBlock )
{
( (TileRenderChunk) t.trc ).singleInstanceMode = true;
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/chiselsandbits/lang/en_us.lang
Expand Up @@ -244,3 +244,5 @@ mod.chiselsandbits.config.useVBO.tooltip=By Default uses the same setting as MC,
mod.chiselsandbits.config.radialMenuVolume='Click' volume for radial menu.
mod.chiselsandbits.config.radialMenuVolume.tooltip=Setting to Zero will disable it.
mod.chiselsandbits.config.enableChiselCrafting=Enable Chiseling Blocks in Crafting Table
mod.chiselsandbits.config.dynamicRenderFullChunksOnly=Dynamic Renderer Full Chunks Only
mod.chiselsandbits.config.dynamicRenderFullChunksOnly.tooltip=Prevents Subdividing of dynamically rendered chunks into single blocks. This increases performance for most common cases ( chunks with a handful of complicated blocks ), but decreases performance for the worst cases ( chunks full of super complicated designs ).

0 comments on commit 2f3ae65

Please sign in to comment.