mirror of
https://github.com/JonasunderscoreJones/nicer-skies.git
synced 2025-10-23 19:49:21 +02:00
change: cleanup + perf experiments
This commit is contained in:
parent
78acaa90af
commit
49386dd851
5 changed files with 21 additions and 6 deletions
|
@ -8,7 +8,5 @@ public class ExampleMod implements ModInitializer {
|
|||
public static SkyManager skyManager = new SkyManager();
|
||||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
// skyManager.generateSky(123L);
|
||||
}
|
||||
public void onInitialize() {}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ public abstract class MixinStarRendering {
|
|||
|
||||
@Inject(at = @At("HEAD"), method = "createStars", cancellable = true)
|
||||
private void generateStars(CallbackInfo ci) {
|
||||
ExampleMod.skyManager.generateSky(123L);
|
||||
ExampleMod.skyManager.generateSky(321L);
|
||||
starBuffer = new VertexBuffer();
|
||||
ExampleMod.skyManager.tick(ticks, starBuffer);
|
||||
ci.cancel();
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.awt.*;
|
|||
|
||||
public class NebulaSkyboxPainter extends SkyboxPainter {
|
||||
private static final float SCALING_FACTOR = 1f;
|
||||
private static final float BASE_NOISE_AMOUNT = 0.7f; // the amount of base noise to keep
|
||||
private static final float BASE_NOISE_AMOUNT = 0.56f; // the amount of base noise to keep
|
||||
|
||||
private final Gradient nebulaGradient;
|
||||
|
||||
|
|
|
@ -101,17 +101,34 @@ public class Star {
|
|||
float ae3 = firstVertexDistance * latitudeCos;
|
||||
float ae4 = secondVertexDistance * latitudeCos;
|
||||
|
||||
// 0
|
||||
bufferBuilder.vertex(xCoord + ae1 * longitudeSin - secondVertexDistance * longitudeCos, yCoord + firstVertexDistance * latitudeSin, zCoord + secondVertexDistance * longitudeSin + ae1 * longitudeCos)
|
||||
.color(r, g, b, 255)
|
||||
.endVertex();
|
||||
// 1
|
||||
bufferBuilder.vertex(xCoord + ae2 * longitudeSin - thirdVertexDistance * longitudeCos, yCoord + secondVertexDistance * latitudeSin, zCoord + thirdVertexDistance * longitudeSin + ae2 * longitudeCos)
|
||||
.color(r, g, b, 255)
|
||||
.endVertex();
|
||||
|
||||
bufferBuilder.vertex(xCoord + ae3 * longitudeSin - fourthVertexDistance * longitudeCos, yCoord + thirdVertexDistance * latitudeSin, zCoord + fourthVertexDistance * longitudeSin + ae3 * longitudeCos)
|
||||
.color(r, g, b, 255)
|
||||
.endVertex();
|
||||
|
||||
// 3
|
||||
bufferBuilder.vertex(xCoord + ae4 * longitudeSin - firstVertexDistance * longitudeCos, yCoord + fourthVertexDistance * latitudeSin, zCoord + firstVertexDistance * longitudeSin + ae4 * longitudeCos)
|
||||
.color(r, g, b, 255)
|
||||
.endVertex();
|
||||
// // 1
|
||||
// bufferBuilder.vertex(xCoord + ae2 * longitudeSin - thirdVertexDistance * longitudeCos, yCoord + secondVertexDistance * latitudeSin, zCoord + thirdVertexDistance * longitudeSin + ae2 * longitudeCos)
|
||||
// .color(r, g, b, 255)
|
||||
// .endVertex();
|
||||
// // 2
|
||||
// bufferBuilder.vertex(xCoord + ae3 * longitudeSin - fourthVertexDistance * longitudeCos, yCoord + thirdVertexDistance * latitudeSin, zCoord + fourthVertexDistance * longitudeSin + ae3 * longitudeCos)
|
||||
// .color(r, g, b, 255)
|
||||
// .endVertex();
|
||||
// // 3
|
||||
// bufferBuilder.vertex(xCoord + ae4 * longitudeSin - firstVertexDistance * longitudeCos, yCoord + fourthVertexDistance * latitudeSin, zCoord + firstVertexDistance * longitudeSin + ae4 * longitudeCos)
|
||||
// .color(r, g, b, 255)
|
||||
// .endVertex();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ public class Starbox {
|
|||
generateStars(randomSource);
|
||||
}
|
||||
|
||||
public void generateStars(RandomSource randomSource) {
|
||||
private void generateStars(RandomSource randomSource) {
|
||||
ImprovedNoise noise = new ImprovedNoise(randomSource);
|
||||
|
||||
for (int i = 0; i < this.stars; ++i) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue