-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
935 additions
and
803 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
### Changes | ||
- Added bricks. Variable sized storage containers for wake nodes which should provide faster node retrievals and reduce drawing times as there are fewer quads rendered. This may fix issue #41. | ||
- One quad rendered per brick, was originally one quad per node. | ||
- As the nodes are no longer rendered per block the correct light information while rendering can't be provided. The light color is, therefore, baked into the actual pixel colors which are calculated once per tick. | ||
- Every brick now has its texture storage which does use up a bit more memory than just having one texture. But this enables per tick coloring as opposed to per frame coloring which is much faster. | ||
- Also removed memory leak caused by texture pointers being allocated but not deallocated. #89 This was when the textures was stored in each node (0.2.5) | ||
- Removed LODs as the implementation didn't provide any performance benefits. | ||
- Improved splashes at the front of the boat. The planes are now static for boats, have fixed splash clouds at the front and stationary clouds at paddle splashes. | ||
- Shader compatibilty has probably been changed due to the new lighting method. A slider in the wake appearance config tab allowing the user to manually fine tune the look has been added. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/main/java/com/goby56/wakes/debug/WakeDebugRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.goby56.wakes.debug; | ||
|
||
import com.goby56.wakes.WakesClient; | ||
import com.goby56.wakes.simulation.Brick; | ||
import com.goby56.wakes.simulation.WakeHandler; | ||
import com.goby56.wakes.simulation.WakeNode; | ||
import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; | ||
import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents; | ||
import net.minecraft.client.render.debug.DebugRenderer; | ||
import net.minecraft.util.math.Box; | ||
import net.minecraft.util.math.Vec3d; | ||
|
||
import java.awt.*; | ||
import java.util.Random; | ||
|
||
public class WakeDebugRenderer implements WorldRenderEvents.DebugRender { | ||
|
||
@Override | ||
public void beforeDebugRender(WorldRenderContext context) { | ||
WakeHandler wakeHandler = WakeHandler.getInstance(); | ||
if (WakesClient.CONFIG_INSTANCE.drawDebugBoxes) { | ||
for (var node : wakeHandler.getVisible(context.frustum(), WakeNode.class)) { | ||
Box box = new Box(node.x, node.height - 0.1f, node.z, node.x + 1, node.height - 0.2f, node.z + 1); | ||
DebugRenderer.drawBox(context.matrixStack(), context.consumers(), | ||
box.offset(context.camera().getPos().negate()), | ||
1, 0, 1, 0.5f); | ||
} | ||
for (var brick : wakeHandler.getVisible(context.frustum(), Brick.class)) { | ||
Vec3d pos = brick.pos; | ||
Box box = new Box(pos.x, pos.y - 0.2f, pos.z, pos.x + brick.dim, pos.y - 0.3f, pos.z + brick.dim); | ||
var col = Color.getHSBColor(new Random(pos.hashCode()).nextFloat(), 1f, 1f).getRGBColorComponents(null); | ||
DebugRenderer.drawBox(context.matrixStack(), context.consumers(), | ||
box.offset(context.camera().getPos().negate()), | ||
col[0], col[1], col[2], 0.5f); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package com.goby56.wakes.debug; | ||
|
||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class WakesDebugInfo { | ||
public static double nodeLogicTime = 0; | ||
public static double insertionTime = 0; | ||
public static double texturingTime = 0; | ||
public static ArrayList<Long> cullingTime = new ArrayList<>(); | ||
public static ArrayList<Long> renderingTime = new ArrayList<>(); // Frames averaged each tick | ||
public static int quadsRendered = 0; | ||
public static int nodeCount = 0; | ||
|
||
public static void reset() { | ||
nodeCount = 0; | ||
nodeLogicTime = 0; | ||
insertionTime = 0; | ||
texturingTime = 0; | ||
cullingTime = new ArrayList<>(); | ||
renderingTime = new ArrayList<>(); | ||
} | ||
|
||
public static void show(CallbackInfoReturnable<List<String>> info) { | ||
int q = WakesDebugInfo.quadsRendered; | ||
info.getReturnValue().add(String.format("[Wakes] Rendering %d quads for %d wake nodes", q, WakesDebugInfo.nodeCount)); | ||
info.getReturnValue().add(String.format("[Wakes] Node logic: %.2fms/t", 10e-6 * WakesDebugInfo.nodeLogicTime)); | ||
info.getReturnValue().add(String.format("[Wakes] Insertion: %.2fms/t", 10e-6 * WakesDebugInfo.insertionTime)); | ||
info.getReturnValue().add(String.format("[Wakes] Texturing: %.2fms/t", 10e-6 * WakesDebugInfo.texturingTime)); | ||
info.getReturnValue().add(String.format("[Wakes] Culling: %.3fms/f", 10e-6 * WakesDebugInfo.cullingTime.stream().reduce(0L, Long::sum) / WakesDebugInfo.cullingTime.size())); | ||
info.getReturnValue().add(String.format("[Wakes] Rendering: %.3fms/f", 10e-6 * WakesDebugInfo.renderingTime.stream().reduce(0L, Long::sum) / WakesDebugInfo.renderingTime.size())); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,6 @@ public interface ProducesWake { | |
|
||
void setRecentlyTeleported(boolean b); | ||
|
||
SplashPlaneParticle getSplashPlane(); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
src/main/java/com/goby56/wakes/mixin/TameableTeleportMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.