fix block mesh samplers buffering
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
This commit is contained in:
parent
fcd2f1e0a7
commit
dae678f0c7
@ -1,3 +1,3 @@
|
||||
#maven.buildNumber.plugin properties file
|
||||
#Fri Mar 28 09:59:20 EDT 2025
|
||||
buildNumber=609
|
||||
#Fri Mar 28 12:07:10 EDT 2025
|
||||
buildNumber=611
|
||||
|
||||
@ -1354,6 +1354,9 @@ Fix TextureInstancedActor packing data texture incorrectly (column major instead
|
||||
(03/28/2025)
|
||||
Grass height variance with control from ui + file
|
||||
Fix block mesh ray casting bug due to trimesh overlap
|
||||
Fix block mesh samplers incorrectly buffering
|
||||
|
||||
|
||||
|
||||
|
||||
# TODO
|
||||
|
||||
@ -127,6 +127,7 @@ public class BlockMeshgen {
|
||||
//
|
||||
//face 1
|
||||
//
|
||||
int samplerIndex = Globals.blockTextureAtlas.getVoxelTypeOffset(blockType);
|
||||
|
||||
//verts
|
||||
verts.add(new Vector3f(quad.x, quad.y, quad.z).mul(BlockChunkData.BLOCK_SIZE_MULTIPLIER));
|
||||
@ -150,6 +151,11 @@ public class BlockMeshgen {
|
||||
uvs.add(new Vector2f(quad.w, 0));
|
||||
uvs.add(new Vector2f( 0, quad.h));
|
||||
uvs.add(new Vector2f(quad.w, quad.h));
|
||||
//samplers
|
||||
samplers.add(samplerIndex);
|
||||
samplers.add(samplerIndex);
|
||||
samplers.add(samplerIndex);
|
||||
samplers.add(samplerIndex);
|
||||
|
||||
//
|
||||
//face 2
|
||||
@ -177,6 +183,11 @@ public class BlockMeshgen {
|
||||
uvs.add(new Vector2f(depth, 0));
|
||||
uvs.add(new Vector2f( 0, quad.h));
|
||||
uvs.add(new Vector2f(depth, quad.h));
|
||||
//samplers
|
||||
samplers.add(samplerIndex);
|
||||
samplers.add(samplerIndex);
|
||||
samplers.add(samplerIndex);
|
||||
samplers.add(samplerIndex);
|
||||
|
||||
//
|
||||
//face 3
|
||||
@ -204,6 +215,11 @@ public class BlockMeshgen {
|
||||
uvs.add(new Vector2f(depth, 0));
|
||||
uvs.add(new Vector2f( 0, quad.w));
|
||||
uvs.add(new Vector2f(depth, quad.w));
|
||||
//samplers
|
||||
samplers.add(samplerIndex);
|
||||
samplers.add(samplerIndex);
|
||||
samplers.add(samplerIndex);
|
||||
samplers.add(samplerIndex);
|
||||
|
||||
//
|
||||
//face 4
|
||||
@ -231,6 +247,11 @@ public class BlockMeshgen {
|
||||
uvs.add(new Vector2f(quad.w, 0));
|
||||
uvs.add(new Vector2f( 0, quad.h));
|
||||
uvs.add(new Vector2f(quad.w, quad.h));
|
||||
//samplers
|
||||
samplers.add(samplerIndex);
|
||||
samplers.add(samplerIndex);
|
||||
samplers.add(samplerIndex);
|
||||
samplers.add(samplerIndex);
|
||||
|
||||
|
||||
//
|
||||
@ -259,6 +280,11 @@ public class BlockMeshgen {
|
||||
uvs.add(new Vector2f(depth, 0));
|
||||
uvs.add(new Vector2f( 0, quad.h));
|
||||
uvs.add(new Vector2f(depth, quad.h));
|
||||
//samplers
|
||||
samplers.add(samplerIndex);
|
||||
samplers.add(samplerIndex);
|
||||
samplers.add(samplerIndex);
|
||||
samplers.add(samplerIndex);
|
||||
|
||||
|
||||
//
|
||||
@ -287,6 +313,11 @@ public class BlockMeshgen {
|
||||
uvs.add(new Vector2f(depth, 0));
|
||||
uvs.add(new Vector2f( 0, quad.w));
|
||||
uvs.add(new Vector2f(depth, quad.w));
|
||||
//samplers
|
||||
samplers.add(samplerIndex);
|
||||
samplers.add(samplerIndex);
|
||||
samplers.add(samplerIndex);
|
||||
samplers.add(samplerIndex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -235,7 +235,7 @@ public class Mesh {
|
||||
bufferPointer = glGenBuffers();
|
||||
glBindBuffer(GL_ARRAY_BUFFER, bufferPointer);
|
||||
GL15.glBufferData(GL_ARRAY_BUFFER, buffer, GL_STATIC_DRAW);
|
||||
glVertexAttribPointer(attribIndex, bufferDimension, GL_INT, false, 0, 0);
|
||||
GL40.glVertexAttribIPointer(attribIndex, bufferDimension, GL_INT, 0, 0);
|
||||
glEnableVertexAttribArray(attribIndex);
|
||||
}
|
||||
return bufferPointer;
|
||||
@ -255,7 +255,7 @@ public class Mesh {
|
||||
bufferPointer = glGenBuffers();
|
||||
glBindBuffer(GL_ARRAY_BUFFER, bufferPointer);
|
||||
GL15.glBufferData(GL_ARRAY_BUFFER, buffer, GL_STATIC_DRAW);
|
||||
glVertexAttribPointer(attribIndex, bufferDimension, GL_UNSIGNED_INT, false, 0, 0);
|
||||
GL40.glVertexAttribIPointer(attribIndex, bufferDimension, GL_UNSIGNED_INT, 0, 0);
|
||||
glEnableVertexAttribArray(attribIndex);
|
||||
}
|
||||
return bufferPointer;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user