Skip to content

Conversation

ZhuRuoLing
Copy link
Contributor

@ZhuRuoLing ZhuRuoLing commented Sep 25, 2025

  • 尽可能使用 GL_ARB_buffer_storage 替换Blaze3D的VertexBuffer
    • 添加anvilcraft.enforceLegacyBuffers 以强制使用传统顶点存储
  • 半透明排序
  • 重构CachedBER渲染管线

import dev.dubhe.anvilcraft.api.rendering.foundation.Disposable;
import org.lwjgl.opengl.GL;

import static org.lwjgl.opengl.GL45.*;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] <com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck> reported by reviewdog 🐶
Using the '.' form of import should be avoided - org.lwjgl.opengl.GL45..

import org.lwjgl.opengl.ARBBufferStorage;
import org.lwjgl.system.MemoryUtil;

import static org.lwjgl.opengl.GL45.*;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] <com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck> reported by reviewdog 🐶
Using the '.' form of import should be avoided - org.lwjgl.opengl.GL45..


void unbind();

static GlIndexBuffer forQuad(VertexFormat.IndexType indexType){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck> reported by reviewdog 🐶
WhitespaceAround: '{' is not preceded with whitespace.

import org.joml.Vector3f;

public class QuadSorter {
public static int[] buildSortedIndexByDistance(QuadSortingState state, Vector3f point){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck> reported by reviewdog 🐶
WhitespaceAround: '{' is not preceded with whitespace.

distances[i] = state.quadCenters().get(i).distanceSquared(point);
indexes[i] = i;
}
IntArrays.mergeSort(indexes, (a,b) -> Float.compare(distances[a], distances[b]));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck> reported by reviewdog 🐶
',' is not followed by whitespace.

double weight;
Edge(int u, int v, double weight) { this.u = u; this.v = v; this.weight = weight; }
@Override
public int compareTo(Edge o) { return Double.compare(this.weight, o.weight); }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] reported by reviewdog 🐶
'{' at column 38 should have line break after.

double weight;
Edge(int u, int v, double weight) { this.u = u; this.v = v; this.weight = weight; }
@Override
public int compareTo(Edge o) { return Double.compare(this.weight, o.weight); }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] reported by reviewdog 🐶
'}' at column 86 should be alone on a line.


private static class UnionFind {
int[] parent, rank;
UnionFind(int n) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] <com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck> reported by reviewdog 🐶
'CTOR_DEF' should be separated from previous line.

rank = new int[n];
for (int i = 0; i < n; i++) parent[i] = i;
}
int find(int x) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] <com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck> reported by reviewdog 🐶
'METHOD_DEF' should be separated from previous line.

if (parent[x] != x) parent[x] = find(parent[x]);
return parent[x];
}
void union(int x, int y) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] <com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck> reported by reviewdog 🐶
'METHOD_DEF' should be separated from previous line.

@ZhuRuoLing ZhuRuoLing changed the title 新的电线杆连接算法 更高性能的激光渲染 新的电线杆连接算法 Sep 25, 2025
@ZhuRuoLing ZhuRuoLing marked this pull request as draft September 25, 2025 17:56
import com.mojang.blaze3d.systems.RenderSystem;
import dev.dubhe.anvilcraft.api.rendering.foundation.Disposable;

import static org.lwjgl.opengl.GL45.*;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] <com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck> reported by reviewdog 🐶
Using the '.' form of import should be avoided - org.lwjgl.opengl.GL45..


@Override
public void waitForReady() {
if (!syncSupport.isSyncSet()){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck> reported by reviewdog 🐶
WhitespaceAround: '{' is not preceded with whitespace.

if (!syncSupport.isSyncSet()){
return;
}
if (!syncSupport.isSyncSignaled()){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck> reported by reviewdog 🐶
WhitespaceAround: '{' is not preceded with whitespace.

@@ -0,0 +1,32 @@
package dev.dubhe.anvilcraft.api.rendering.util;

import static org.lwjgl.opengl.GL45.*;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] <com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck> reported by reviewdog 🐶
Using the '.' form of import should be avoided - org.lwjgl.opengl.GL45..


public abstract class GlBufferStorageLegacy<C> extends GlBufferStorage<C> {

protected GlBufferStorageLegacy(int target,C configureContext) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck> reported by reviewdog 🐶
',' is not followed by whitespace.


private long clientPtr;

protected GlBufferStorageModern(int target,C configureContext) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck> reported by reviewdog 🐶
',' is not followed by whitespace.


@Override
public void dispose() {
if (!valid)return;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck> reported by reviewdog 🐶
WhitespaceAround: 'return' is not preceded with whitespace.

import org.lwjgl.opengl.GL45;

public class GlIndexBufferStorage {
public static GlBufferStorage<?> create(){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck> reported by reviewdog 🐶
WhitespaceAround: '{' is not preceded with whitespace.


public class GlIndexBufferStorage {
public static GlBufferStorage<?> create(){
if (GlBufferStorage.BUFFER_STORAGE_SUPPORT){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck> reported by reviewdog 🐶
WhitespaceAround: '{' is not preceded with whitespace.

@ZhuRuoLing ZhuRuoLing changed the title 更高性能的激光渲染 新的电线杆连接算法 更高性能的激光渲染 Oct 1, 2025
import org.jetbrains.annotations.Nullable;
import org.joml.Vector3f;

import static org.lwjgl.opengl.GL45.*;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] <com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck> reported by reviewdog 🐶
Using the '.' form of import should be avoided - org.lwjgl.opengl.GL45..

glBindVertexArray(0);
}

public void upload(long ptr, int size,int vertexCount, int indexCount, Disposable uploadSrc) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck> reported by reviewdog 🐶
',' is not followed by whitespace.

this.upload(ptr, size, vertexCount, indexCount, null, null, uploadSrc);
}

public void upload(long ptr, int size, int vertexCount,int indexCount, @Nullable QuadSortingState sortingState, @Nullable Vector3f origin, Disposable uploadSrc) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [Checkstyle] <com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAfterCheck> reported by reviewdog 🐶
',' is not followed by whitespace.

@Gu-ZT Gu-ZT changed the title 更高性能的激光渲染 Higher-performance laser rendering 更高性能的激光渲染 Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant