@divinevoxel/vlox 0.0.7 → 0.0.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Contexts/Base/Main/InitDataGenerator.js +0 -9
- package/Contexts/Base/Remote/DataSync.types.d.ts +0 -5
- package/Contexts/Base/Remote/InitDataSync.js +17 -31
- package/Init/StartConstructor.js +2 -4
- package/Init/StartWorld.js +0 -12
- package/Math/Indexing.d.ts +12 -3
- package/Math/Indexing.js +24 -15
- package/Mesher/Functions/CompactVoxelMesh.d.ts +1 -1
- package/Mesher/Functions/CompactVoxelMesh.js +3 -4
- package/Mesher/Functions/MeshSection.d.ts +1 -1
- package/Mesher/Functions/MeshSection.js +54 -60
- package/Mesher/Functions/MeshVoxel.js +20 -26
- package/Mesher/Geomtry/Buffers.d.ts +9 -8
- package/Mesher/Geomtry/Buffers.js +26 -58
- package/Mesher/Geomtry/Tools/MesherDataTools.d.ts +1 -1
- package/Mesher/Geomtry/Tools/MesherDataTools.js +1 -1
- package/Mesher/Geomtry/VoxelGeometryBuilder.js +107 -124
- package/Mesher/InitMesher.js +1 -10
- package/Mesher/InitTask.js +10 -4
- package/Mesher/Models/Common/BoundsFunctions.d.ts +1 -3
- package/Mesher/Models/Common/BoundsFunctions.js +0 -16
- package/Mesher/Models/Common/Calc/CalcConstants.js +14 -31
- package/Mesher/Models/Common/Calc/FaceDataCalc.d.ts +1 -7
- package/Mesher/Models/Common/Calc/FaceDataCalc.js +41 -50
- package/Mesher/Models/Nodes/Custom/Liquid/LiquidGeomtryNode.d.ts +1 -5
- package/Mesher/Models/Nodes/Custom/Liquid/LiquidGeomtryNode.js +30 -26
- package/Mesher/Models/Nodes/GeometryNode.d.ts +2 -4
- package/Mesher/Models/Nodes/GeometryNode.js +1 -2
- package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.d.ts +2 -6
- package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.js +37 -34
- package/Mesher/Models/Nodes/Ruled/QuadVoxelGeometryNode.d.ts +2 -6
- package/Mesher/Models/Nodes/Ruled/QuadVoxelGeometryNode.js +52 -51
- package/Mesher/Models/Nodes/Ruleless/RulelessBoxVoxelGeometryNode.d.ts +2 -6
- package/Mesher/Models/Nodes/Ruleless/RulelessBoxVoxelGeometryNode.js +18 -19
- package/Mesher/Models/Nodes/Ruleless/RulelessQuadVoxelGeometryNode.d.ts +2 -6
- package/Mesher/Models/Nodes/Ruleless/RulelessQuadVoxelGeometryNode.js +37 -40
- package/Mesher/Models/VoxelConstructor.d.ts +3 -4
- package/Mesher/Models/VoxelConstructor.js +23 -12
- package/Mesher/Models/{VoxelGeometryLookUp.d.ts → VoxelGeometryBuilderCacheSpace.d.ts} +8 -14
- package/Mesher/Models/{VoxelGeometryLookUp.js → VoxelGeometryBuilderCacheSpace.js} +49 -44
- package/Mesher/Models/VoxelModelConstructorRegister.js +3 -3
- package/Mesher/Tools/VoxelMeshBVHBuilder.d.ts +2 -9
- package/Mesher/Tools/VoxelMeshBVHBuilder.js +4 -16
- package/Mesher/Tools/VoxelMeshVertexStructCursor.d.ts +10 -0
- package/Mesher/Tools/VoxelMeshVertexStructCursor.js +10 -0
- package/Mesher/Tools/VoxelMesherDataTool.d.ts +8 -5
- package/Mesher/Tools/VoxelMesherDataTool.js +34 -13
- package/Models/Indexing/VoxelAOResultsIndex.d.ts +4 -4
- package/Models/Indexing/VoxelAOResultsIndex.js +15 -9
- package/Models/Indexing/VoxelFaceCullResultsIndex.d.ts +3 -3
- package/Models/Indexing/VoxelFaceCullResultsIndex.js +14 -9
- package/Models/Indexing/VoxelFaceTransparentResultsIndex.d.ts +1 -1
- package/Models/Indexing/VoxelFaceTransparentResultsIndex.js +1 -1
- package/Models/Rules/Functions/BuildRules.js +2 -2
- package/Tasks/IWG/Internal/Classes/Generator.js +1 -1
- package/Tasks/IWG/Internal/Functions/getSectorState.js +4 -7
- package/Tasks/IWG/Internal/Functions/runWorldUpdate.js +5 -6
- package/Tasks/IWG/Internal/IWGTasks.js +12 -21
- package/Tasks/Propagation/Flow/FlowManager.d.ts +0 -2
- package/Tasks/Propagation/Flow/FlowManager.js +86 -87
- package/Tasks/Propagation/Flow/WorldFlow.js +2 -3
- package/Tasks/Propagation/Illumanation/WorldRGB.js +1 -2
- package/Tasks/Update/InitTasks.d.ts +2 -1
- package/Tasks/Update/InitTasks.js +6 -6
- package/Tasks/Update/VoxelUpdate.js +15 -7
- package/Tasks/WorldGeneration/WorldGenBrush.js +1 -0
- package/Templates/Cursor/TemplateCursor.d.ts +1 -1
- package/Templates/Cursor/TemplateCursor.js +1 -1
- package/Templates/Functions/CreateTemplate.js +1 -1
- package/Templates/VoxelTemplate.js +6 -8
- package/Tools/Brush/Brush.d.ts +0 -2
- package/Tools/Brush/Brush.js +5 -6
- package/{Data/Cursor → Tools}/DataCursor.interface.d.ts +1 -1
- package/Util/Binary/BitArray.d.ts +4 -0
- package/Util/Binary/BitArray.js +16 -0
- package/Util/StringPalette.d.ts +1 -0
- package/Util/StringPalette.js +8 -0
- package/Voxels/Cursor/VoxelCursor.d.ts +6 -6
- package/Voxels/Cursor/VoxelCursor.interface.d.ts +10 -15
- package/Voxels/Cursor/VoxelCursor.interface.js +30 -50
- package/Voxels/Cursor/VoxelCursor.js +13 -12
- package/Voxels/Cursor/VoxelLightData.d.ts +3 -4
- package/Voxels/Cursor/VoxelLightData.js +8 -7
- package/Voxels/Data/VoxelPalettesRegister.d.ts +13 -0
- package/Voxels/Data/VoxelPalettesRegister.js +17 -0
- package/Voxels/Data/VoxelTag.types.d.ts +56 -0
- package/Voxels/Data/VoxelTag.types.js +23 -0
- package/Voxels/{State → Data}/VoxelTagStates.d.ts +2 -2
- package/Voxels/{State → Data}/VoxelTagStates.js +5 -5
- package/Voxels/Data/VoxelTagsRegister.d.ts +9 -0
- package/Voxels/Data/VoxelTagsRegister.js +32 -0
- package/Voxels/Functions/BuildStateData.js +3 -3
- package/Voxels/Functions/BuildTagAndPaletteData.d.ts +13 -0
- package/Voxels/Functions/BuildTagAndPaletteData.js +57 -0
- package/Voxels/Indexes/VoxelIndex.js +3 -3
- package/Voxels/InitVoxelData.js +20 -61
- package/Voxels/State/Schema/StateSchema.d.ts +1 -1
- package/Voxels/Types/Voxel.types.d.ts +2 -42
- package/Voxels/Types/Voxel.types.js +0 -15
- package/Voxels/Types/VoxelModelCompiledData.types.d.ts +11 -13
- package/Voxels/Types/VoxelSubstances.types.d.ts +2 -15
- package/Voxels/Types/VoxelSubstances.types.js +1 -9
- package/World/Archive/Functions/ArchiveArea.js +2 -6
- package/World/Archive/Functions/ArchiveSector.js +14 -28
- package/World/Archive/Functions/ImportSector.js +27 -34
- package/World/Cursor/SectionCursor.d.ts +2 -1
- package/World/Cursor/SectionCursor.js +8 -2
- package/World/Cursor/SectorCursor.d.ts +2 -1
- package/World/Cursor/SectorCursor.js +5 -2
- package/World/Cursor/WorldCursor.d.ts +1 -1
- package/World/Cursor/WorldCursor.js +6 -2
- package/World/Cursor/WorldVoxelCursor.d.ts +7 -7
- package/World/Cursor/WorldVoxelCursor.js +20 -24
- package/World/Section/Section.d.ts +20 -8
- package/World/Section/Section.js +65 -9
- package/World/Sector/Sector.d.ts +13 -6
- package/World/Sector/Sector.js +30 -9
- package/World/Sector/SectorHeightMap.js +1 -3
- package/World/Sector/SectorState.d.ts +13 -0
- package/World/Sector/SectorState.js +15 -0
- package/World/WorldSpaces.d.ts +2 -0
- package/World/WorldSpaces.js +7 -1
- package/package.json +1 -1
- package/Data/Register/MappedDataRegister.d.ts +0 -5
- package/Data/Register/MappedDataRegister.js +0 -9
- package/Data/Register/MappedRegisterBase.d.ts +0 -14
- package/Data/Register/MappedRegisterBase.js +0 -50
- package/Data/Structs/StructBuilder.d.ts +0 -34
- package/Data/Structs/StructBuilder.js +0 -157
- package/Data/Structs/StructBuilder.types.d.ts +0 -30
- package/Data/Structs/StructBuilder.types.js +0 -1
- package/Tools/Data/SubstanceDataTool.d.ts +0 -13
- package/Tools/Data/SubstanceDataTool.js +0 -51
- package/Voxels/Palettes/MaterialPalette.d.ts +0 -9
- package/Voxels/Palettes/MaterialPalette.js +0 -11
- package/Voxels/Palettes/SubstancePalette.d.ts +0 -9
- package/Voxels/Palettes/SubstancePalette.js +0 -11
- package/Voxels/Palettes/VoxelPalette.d.ts +0 -11
- package/Voxels/Palettes/VoxelPalette.js +0 -15
- package/Voxels/Segments/MaterialDataGenerator.d.ts +0 -6
- package/Voxels/Segments/MaterialDataGenerator.js +0 -12
- package/Voxels/Segments/SubstanceDataGenerator.d.ts +0 -6
- package/Voxels/Segments/SubstanceDataGenerator.js +0 -35
- package/Voxels/Segments/VoxelDataGenerator.d.ts +0 -10
- package/Voxels/Segments/VoxelDataGenerator.js +0 -56
- package/Voxels/Structs/Builder/SubstanceStructBuilder.d.ts +0 -2
- package/Voxels/Structs/Builder/SubstanceStructBuilder.js +0 -42
- package/Voxels/Structs/Builder/VoxelStructBuilder.d.ts +0 -2
- package/Voxels/Structs/Builder/VoxelStructBuilder.js +0 -68
- package/Voxels/Structs/SubstanceStruct.d.ts +0 -17
- package/Voxels/Structs/SubstanceStruct.js +0 -17
- package/Voxels/Structs/VoxelStruct.d.ts +0 -27
- package/Voxels/Structs/VoxelStruct.js +0 -29
- package/World/Section/SectionHeightMap.d.ts +0 -10
- package/World/Section/SectionHeightMap.js +0 -39
- package/World/Section/SectionStruct.d.ts +0 -8
- package/World/Section/SectionStruct.js +0 -29
- package/World/Section/SectionStructProperties.d.ts +0 -10
- package/World/Section/SectionStructProperties.js +0 -11
- package/World/Sector/SectorStruct.d.ts +0 -1
- package/World/Sector/SectorStruct.js +0 -46
- package/World/Sector/SectorStructIds.d.ts +0 -13
- package/World/Sector/SectorStructIds.js +0 -14
- /package/{Data/Cursor → Tools}/DataCursor.interface.js +0 -0
- /package/{Data/Functions → Util/Binary}/Palettes.d.ts +0 -0
- /package/{Data/Functions → Util/Binary}/Palettes.js +0 -0
- /package/Voxels/{VoxelLevelReader.d.ts → Cursor/VoxelLevelReader.d.ts} +0 -0
- /package/Voxels/{VoxelLevelReader.js → Cursor/VoxelLevelReader.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VoxelShaderData } from "../VoxelShaderData";
|
|
2
2
|
import { QuadVerticies } from "./Geometry.types";
|
|
3
|
-
import { VoxelMeshVertexStructCursor } from "../../Mesher/Tools/VoxelMeshVertexStructCursor";
|
|
3
|
+
import { VoxelMeshVertexConstants, VoxelMeshVertexStructCursor, } from "../../Mesher/Tools/VoxelMeshVertexStructCursor";
|
|
4
4
|
const empty = [];
|
|
5
5
|
const structCursor = new VoxelMeshVertexStructCursor();
|
|
6
6
|
export class VoxelGeometryBuilder {
|
|
@@ -82,7 +82,6 @@ export class VoxelGeometryBuilder {
|
|
|
82
82
|
static addQuad(tool, origin, quad) {
|
|
83
83
|
if (!tool.mesh)
|
|
84
84
|
return;
|
|
85
|
-
structCursor.data = tool.mesh.buffer;
|
|
86
85
|
const worldLight = tool.vars.light;
|
|
87
86
|
const worldAO = tool.vars.ao;
|
|
88
87
|
const animData = tool.vars.animation;
|
|
@@ -96,6 +95,10 @@ export class VoxelGeometryBuilder {
|
|
|
96
95
|
const topLeftNor = quad.normals.vertices[1];
|
|
97
96
|
const bottomLeftNor = quad.normals.vertices[2];
|
|
98
97
|
const bottomRightNor = quad.normals.vertices[3];
|
|
98
|
+
const topRightVoxelData = VoxelShaderData.createAttribute(worldLight.vertices[QuadVerticies.TopRight], worldAO.vertices[QuadVerticies.TopRight], animData.vertices[QuadVerticies.TopRight]);
|
|
99
|
+
const topLeftVoxelData = VoxelShaderData.createAttribute(worldLight.vertices[QuadVerticies.TopLeft], worldAO.vertices[QuadVerticies.TopLeft], animData.vertices[QuadVerticies.TopLeft]);
|
|
100
|
+
const bottomLeftVoxelData = VoxelShaderData.createAttribute(worldLight.vertices[QuadVerticies.BottomLeft], worldAO.vertices[QuadVerticies.BottomLeft], animData.vertices[QuadVerticies.BottomLeft]);
|
|
101
|
+
const bottomRightVoxelData = VoxelShaderData.createAttribute(worldLight.vertices[QuadVerticies.BottomRight], worldAO.vertices[QuadVerticies.BottomRight], animData.vertices[QuadVerticies.BottomRight]);
|
|
99
102
|
const indices = tool.mesh.indices;
|
|
100
103
|
let indIndex = tool.mesh.indicieCount;
|
|
101
104
|
let sides = quad.doubleSided ? 2 : 1;
|
|
@@ -104,139 +107,119 @@ export class VoxelGeometryBuilder {
|
|
|
104
107
|
while (sides--) {
|
|
105
108
|
const baseIndex = tool.mesh.vertexCount;
|
|
106
109
|
if (!flip) {
|
|
107
|
-
|
|
108
|
-
structCursor.
|
|
109
|
-
structCursor.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
structCursor.
|
|
113
|
-
structCursor.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
structCursor.
|
|
117
|
-
structCursor.
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
structCursor.
|
|
121
|
-
structCursor.
|
|
122
|
-
|
|
123
|
-
//3
|
|
124
|
-
structCursor.index = baseIndex + 2;
|
|
125
|
-
structCursor.positionX = bottomLeftPos.x + origin.x;
|
|
126
|
-
structCursor.positionY = bottomLeftPos.y + origin.y;
|
|
127
|
-
structCursor.positionZ = bottomLeftPos.z + origin.z;
|
|
128
|
-
structCursor.voxelData = VoxelShaderData.createAttribute(worldLight.vertices[QuadVerticies.BottomLeft], worldAO.vertices[QuadVerticies.BottomLeft], animData.vertices[QuadVerticies.BottomLeft]);
|
|
129
|
-
structCursor.uvX = quad.uvs.vertices[QuadVerticies.BottomLeft].x;
|
|
130
|
-
structCursor.uvY = quad.uvs.vertices[QuadVerticies.BottomLeft].y;
|
|
131
|
-
//4
|
|
132
|
-
structCursor.index = baseIndex + 3;
|
|
133
|
-
structCursor.positionX = bottomRightPos.x + origin.x;
|
|
134
|
-
structCursor.positionY = bottomRightPos.y + origin.y;
|
|
135
|
-
structCursor.positionZ = bottomRightPos.z + origin.z;
|
|
136
|
-
structCursor.voxelData = VoxelShaderData.createAttribute(worldLight.vertices[QuadVerticies.BottomRight], worldAO.vertices[QuadVerticies.BottomRight], animData.vertices[QuadVerticies.BottomRight]);
|
|
137
|
-
structCursor.uvX = quad.uvs.vertices[QuadVerticies.BottomRight].x;
|
|
138
|
-
structCursor.uvY = quad.uvs.vertices[QuadVerticies.BottomRight].y;
|
|
110
|
+
tool.mesh.buffer.setIndex(baseIndex);
|
|
111
|
+
structCursor.data = tool.mesh.buffer.currentArray;
|
|
112
|
+
structCursor.index = tool.mesh.buffer.curentIndex;
|
|
113
|
+
addVertex(tool.mesh.buffer.curentIndex, tool.mesh.buffer.currentArray, origin, topRightPos, topRightNor, quad.uvs.vertices[QuadVerticies.TopRight], topRightVoxelData, texture, overlayTextures);
|
|
114
|
+
tool.mesh.buffer.setIndex(baseIndex + 1);
|
|
115
|
+
structCursor.data = tool.mesh.buffer.currentArray;
|
|
116
|
+
structCursor.index = tool.mesh.buffer.curentIndex;
|
|
117
|
+
addVertex(tool.mesh.buffer.curentIndex, tool.mesh.buffer.currentArray, origin, topLeftPos, topLeftNor, quad.uvs.vertices[QuadVerticies.TopLeft], topLeftVoxelData, texture, overlayTextures);
|
|
118
|
+
tool.mesh.buffer.setIndex(baseIndex + 2);
|
|
119
|
+
structCursor.data = tool.mesh.buffer.currentArray;
|
|
120
|
+
structCursor.index = tool.mesh.buffer.curentIndex;
|
|
121
|
+
addVertex(tool.mesh.buffer.curentIndex, tool.mesh.buffer.currentArray, origin, bottomLeftPos, bottomLeftNor, quad.uvs.vertices[QuadVerticies.BottomLeft], bottomLeftVoxelData, texture, overlayTextures);
|
|
122
|
+
tool.mesh.buffer.setIndex(baseIndex + 3);
|
|
123
|
+
structCursor.data = tool.mesh.buffer.currentArray;
|
|
124
|
+
structCursor.index = tool.mesh.buffer.curentIndex;
|
|
125
|
+
addVertex(tool.mesh.buffer.curentIndex, tool.mesh.buffer.currentArray, origin, bottomRightPos, bottomRightNor, quad.uvs.vertices[QuadVerticies.BottomRight], bottomRightVoxelData, texture, overlayTextures);
|
|
139
126
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
structCursor.
|
|
143
|
-
structCursor.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
structCursor.
|
|
147
|
-
structCursor.
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
structCursor.
|
|
151
|
-
structCursor.
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
structCursor.
|
|
155
|
-
structCursor.
|
|
156
|
-
|
|
157
|
-
//3
|
|
158
|
-
structCursor.index = baseIndex + 2;
|
|
159
|
-
structCursor.positionX = bottomRightPos.x + origin.x;
|
|
160
|
-
structCursor.positionY = bottomRightPos.y + origin.y;
|
|
161
|
-
structCursor.positionZ = bottomRightPos.z + origin.z;
|
|
162
|
-
structCursor.voxelData = VoxelShaderData.createAttribute(worldLight.vertices[QuadVerticies.BottomRight], worldAO.vertices[QuadVerticies.BottomRight], animData.vertices[QuadVerticies.BottomRight]);
|
|
163
|
-
structCursor.uvX = quad.uvs.vertices[QuadVerticies.BottomRight].x;
|
|
164
|
-
structCursor.uvY = quad.uvs.vertices[QuadVerticies.BottomRight].y;
|
|
165
|
-
//4
|
|
166
|
-
structCursor.index = baseIndex + 3;
|
|
167
|
-
structCursor.positionX = bottomLeftPos.x + origin.x;
|
|
168
|
-
structCursor.positionY = bottomLeftPos.y + origin.y;
|
|
169
|
-
structCursor.positionZ = bottomLeftPos.z + origin.z;
|
|
170
|
-
structCursor.voxelData = VoxelShaderData.createAttribute(worldLight.vertices[QuadVerticies.BottomLeft], worldAO.vertices[QuadVerticies.BottomLeft], animData.vertices[QuadVerticies.BottomLeft]);
|
|
171
|
-
structCursor.uvX = quad.uvs.vertices[QuadVerticies.BottomLeft].x;
|
|
172
|
-
structCursor.uvY = quad.uvs.vertices[QuadVerticies.BottomLeft].y;
|
|
127
|
+
if (flip) {
|
|
128
|
+
tool.mesh.buffer.setIndex(baseIndex);
|
|
129
|
+
structCursor.data = tool.mesh.buffer.currentArray;
|
|
130
|
+
structCursor.index = tool.mesh.buffer.curentIndex;
|
|
131
|
+
addVertex(tool.mesh.buffer.curentIndex, tool.mesh.buffer.currentArray, origin, topLeftPos, topLeftNor, quad.uvs.vertices[QuadVerticies.TopLeft], topLeftVoxelData, texture, overlayTextures);
|
|
132
|
+
tool.mesh.buffer.setIndex(baseIndex + 1);
|
|
133
|
+
structCursor.data = tool.mesh.buffer.currentArray;
|
|
134
|
+
structCursor.index = tool.mesh.buffer.curentIndex;
|
|
135
|
+
addVertex(tool.mesh.buffer.curentIndex, tool.mesh.buffer.currentArray, origin, topRightPos, topRightNor, quad.uvs.vertices[QuadVerticies.TopRight], topRightVoxelData, texture, overlayTextures);
|
|
136
|
+
tool.mesh.buffer.setIndex(baseIndex + 2);
|
|
137
|
+
structCursor.data = tool.mesh.buffer.currentArray;
|
|
138
|
+
structCursor.index = tool.mesh.buffer.curentIndex;
|
|
139
|
+
addVertex(tool.mesh.buffer.curentIndex, tool.mesh.buffer.currentArray, origin, bottomRightPos, bottomRightNor, quad.uvs.vertices[QuadVerticies.BottomRight], bottomRightVoxelData, texture, overlayTextures);
|
|
140
|
+
tool.mesh.buffer.setIndex(baseIndex + 3);
|
|
141
|
+
structCursor.data = tool.mesh.buffer.currentArray;
|
|
142
|
+
structCursor.index = tool.mesh.buffer.curentIndex;
|
|
143
|
+
addVertex(tool.mesh.buffer.curentIndex, tool.mesh.buffer.currentArray, origin, bottomLeftPos, bottomLeftNor, quad.uvs.vertices[QuadVerticies.BottomLeft], bottomLeftVoxelData, texture, overlayTextures);
|
|
173
144
|
}
|
|
174
|
-
//1
|
|
175
|
-
structCursor.index = baseIndex;
|
|
176
|
-
structCursor.textureIndexX = VoxelShaderData.createTextureIndex(texture, overlayTextures.vertices[QuadVerticies.TopRight]);
|
|
177
|
-
structCursor.textureIndexY = VoxelShaderData.createTextureIndex(overlayTextures.vertices[QuadVerticies.TopLeft], overlayTextures.vertices[QuadVerticies.BottomLeft]);
|
|
178
|
-
structCursor.textureIndexZ = VoxelShaderData.createTextureIndex(overlayTextures.vertices[QuadVerticies.BottomRight], 0);
|
|
179
|
-
structCursor.normalX = topRightNor.x;
|
|
180
|
-
structCursor.normalY = topRightNor.y;
|
|
181
|
-
structCursor.normalZ = topRightNor.z;
|
|
182
|
-
//2
|
|
183
|
-
structCursor.index = baseIndex + 1;
|
|
184
|
-
structCursor.textureIndexX = VoxelShaderData.createTextureIndex(texture, overlayTextures.vertices[QuadVerticies.TopRight]);
|
|
185
|
-
structCursor.textureIndexY = VoxelShaderData.createTextureIndex(overlayTextures.vertices[QuadVerticies.TopLeft], overlayTextures.vertices[QuadVerticies.BottomLeft]);
|
|
186
|
-
structCursor.textureIndexZ = VoxelShaderData.createTextureIndex(overlayTextures.vertices[QuadVerticies.BottomRight], 0);
|
|
187
|
-
structCursor.normalX = topLeftNor.x;
|
|
188
|
-
structCursor.normalY = topLeftNor.y;
|
|
189
|
-
structCursor.normalZ = topLeftNor.z;
|
|
190
|
-
//3
|
|
191
|
-
structCursor.index = baseIndex + 2;
|
|
192
|
-
structCursor.textureIndexX = VoxelShaderData.createTextureIndex(texture, overlayTextures.vertices[QuadVerticies.TopRight]);
|
|
193
|
-
structCursor.textureIndexY = VoxelShaderData.createTextureIndex(overlayTextures.vertices[QuadVerticies.TopLeft], overlayTextures.vertices[QuadVerticies.BottomLeft]);
|
|
194
|
-
structCursor.textureIndexZ = VoxelShaderData.createTextureIndex(overlayTextures.vertices[QuadVerticies.BottomRight], 0);
|
|
195
|
-
structCursor.normalX = bottomLeftNor.x;
|
|
196
|
-
structCursor.normalY = bottomLeftNor.y;
|
|
197
|
-
structCursor.normalZ = bottomLeftNor.z;
|
|
198
|
-
//4
|
|
199
|
-
structCursor.index = baseIndex + 3;
|
|
200
|
-
structCursor.textureIndexX = VoxelShaderData.createTextureIndex(texture, overlayTextures.vertices[QuadVerticies.TopRight]);
|
|
201
|
-
structCursor.textureIndexY = VoxelShaderData.createTextureIndex(overlayTextures.vertices[QuadVerticies.TopLeft], overlayTextures.vertices[QuadVerticies.BottomLeft]);
|
|
202
|
-
structCursor.textureIndexZ = VoxelShaderData.createTextureIndex(overlayTextures.vertices[QuadVerticies.BottomRight], 0);
|
|
203
|
-
structCursor.normalX = bottomRightNor.x;
|
|
204
|
-
structCursor.normalY = bottomRightNor.y;
|
|
205
|
-
structCursor.normalZ = bottomRightNor.z;
|
|
206
145
|
if (!orientation && !flip) {
|
|
207
|
-
indices[
|
|
208
|
-
|
|
209
|
-
indices[
|
|
210
|
-
|
|
211
|
-
indices[
|
|
212
|
-
|
|
146
|
+
indices.setIndex(indIndex).currentArray[indices.curentIndex] =
|
|
147
|
+
baseIndex;
|
|
148
|
+
indices.setIndex(indIndex + 1).currentArray[indices.curentIndex] =
|
|
149
|
+
baseIndex + 1;
|
|
150
|
+
indices.setIndex(indIndex + 2).currentArray[indices.curentIndex] =
|
|
151
|
+
baseIndex + 2;
|
|
152
|
+
indices.setIndex(indIndex + 3).currentArray[indices.curentIndex] =
|
|
153
|
+
baseIndex + 2;
|
|
154
|
+
indices.setIndex(indIndex + 4).currentArray[indices.curentIndex] =
|
|
155
|
+
baseIndex + 3;
|
|
156
|
+
indices.setIndex(indIndex + 5).currentArray[indices.curentIndex] =
|
|
157
|
+
baseIndex;
|
|
213
158
|
}
|
|
214
159
|
else if (!orientation && flip) {
|
|
215
|
-
indices[
|
|
216
|
-
|
|
217
|
-
indices[
|
|
218
|
-
|
|
219
|
-
indices[
|
|
220
|
-
|
|
160
|
+
indices.setIndex(indIndex).currentArray[indices.curentIndex] =
|
|
161
|
+
baseIndex;
|
|
162
|
+
indices.setIndex(indIndex + 1).currentArray[indices.curentIndex] =
|
|
163
|
+
baseIndex + 3;
|
|
164
|
+
indices.setIndex(indIndex + 2).currentArray[indices.curentIndex] =
|
|
165
|
+
baseIndex + 2;
|
|
166
|
+
indices.setIndex(indIndex + 3).currentArray[indices.curentIndex] =
|
|
167
|
+
baseIndex + 2;
|
|
168
|
+
indices.setIndex(indIndex + 4).currentArray[indices.curentIndex] =
|
|
169
|
+
baseIndex + 1;
|
|
170
|
+
indices.setIndex(indIndex + 5).currentArray[indices.curentIndex] =
|
|
171
|
+
baseIndex;
|
|
221
172
|
}
|
|
222
173
|
if (orientation && !flip) {
|
|
223
|
-
indices[
|
|
224
|
-
|
|
225
|
-
indices[
|
|
226
|
-
|
|
227
|
-
indices[
|
|
228
|
-
|
|
174
|
+
indices.setIndex(indIndex).currentArray[indices.curentIndex] =
|
|
175
|
+
baseIndex;
|
|
176
|
+
indices.setIndex(indIndex + 1).currentArray[indices.curentIndex] =
|
|
177
|
+
baseIndex + 3;
|
|
178
|
+
indices.setIndex(indIndex + 2).currentArray[indices.curentIndex] =
|
|
179
|
+
baseIndex + 2;
|
|
180
|
+
indices.setIndex(indIndex + 3).currentArray[indices.curentIndex] =
|
|
181
|
+
baseIndex + 2;
|
|
182
|
+
indices.setIndex(indIndex + 4).currentArray[indices.curentIndex] =
|
|
183
|
+
baseIndex + 1;
|
|
184
|
+
indices.setIndex(indIndex + 5).currentArray[indices.curentIndex] =
|
|
185
|
+
baseIndex;
|
|
229
186
|
}
|
|
230
187
|
else if (orientation && flip) {
|
|
231
|
-
indices[
|
|
232
|
-
|
|
233
|
-
indices[
|
|
234
|
-
|
|
235
|
-
indices[
|
|
236
|
-
|
|
188
|
+
indices.setIndex(indIndex).currentArray[indices.curentIndex] =
|
|
189
|
+
baseIndex;
|
|
190
|
+
indices.setIndex(indIndex + 1).currentArray[indices.curentIndex] =
|
|
191
|
+
baseIndex + 1;
|
|
192
|
+
indices.setIndex(indIndex + 2).currentArray[indices.curentIndex] =
|
|
193
|
+
baseIndex + 2;
|
|
194
|
+
indices.setIndex(indIndex + 3).currentArray[indices.curentIndex] =
|
|
195
|
+
baseIndex + 2;
|
|
196
|
+
indices.setIndex(indIndex + 4).currentArray[indices.curentIndex] =
|
|
197
|
+
baseIndex + 3;
|
|
198
|
+
indices.setIndex(indIndex + 5).currentArray[indices.curentIndex] =
|
|
199
|
+
baseIndex;
|
|
237
200
|
}
|
|
238
201
|
tool.mesh.addVerticies(4, 6);
|
|
239
202
|
}
|
|
240
|
-
structCursor.data = empty;
|
|
241
203
|
}
|
|
242
204
|
}
|
|
205
|
+
const addVertex = (index, array, origin, position, normal, uvs, voxelData, texture, overlayTextures) => {
|
|
206
|
+
index *= VoxelMeshVertexConstants.VertexFloatSize;
|
|
207
|
+
array[VoxelMeshVertexConstants.PositionOffset + index] =
|
|
208
|
+
position.x + origin.x;
|
|
209
|
+
array[VoxelMeshVertexConstants.PositionOffset + index + 1] =
|
|
210
|
+
position.y + origin.y;
|
|
211
|
+
array[VoxelMeshVertexConstants.PositionOffset + index + 2] =
|
|
212
|
+
position.z + origin.z;
|
|
213
|
+
array[VoxelMeshVertexConstants.UVOffset + index] = uvs.x;
|
|
214
|
+
array[VoxelMeshVertexConstants.UVOffset + index + 1] = uvs.y;
|
|
215
|
+
array[VoxelMeshVertexConstants.NormalOffset + index] = normal.x;
|
|
216
|
+
array[VoxelMeshVertexConstants.NormalOffset + index + 1] = normal.y;
|
|
217
|
+
array[VoxelMeshVertexConstants.NormalOffset + index + 2] = normal.z;
|
|
218
|
+
array[VoxelMeshVertexConstants.TextureIndexOffset + index] =
|
|
219
|
+
VoxelShaderData.createTextureIndex(texture, overlayTextures.x);
|
|
220
|
+
array[VoxelMeshVertexConstants.TextureIndexOffset + index + 1] =
|
|
221
|
+
VoxelShaderData.createTextureIndex(overlayTextures.y, overlayTextures.z);
|
|
222
|
+
array[VoxelMeshVertexConstants.TextureIndexOffset + index + 2] =
|
|
223
|
+
VoxelShaderData.createTextureIndex(overlayTextures.w, 0);
|
|
224
|
+
array[VoxelMeshVertexConstants.VoxelDataOFfset + index] = voxelData;
|
|
225
|
+
};
|
package/Mesher/InitMesher.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { RenderedMaterials } from "./RenderedMaterials";
|
|
2
2
|
import { VoxelModelConstructorRegister } from "./Models/VoxelModelConstructorRegister.js";
|
|
3
3
|
import { LiquidGeometryNode } from "./Models/Nodes/Custom/Liquid/LiquidGeomtryNode.js";
|
|
4
|
-
import { SchemaRegister } from "../Voxels/State/SchemaRegister.js";
|
|
5
|
-
import { VoxelTagStates } from "../Voxels/State/VoxelTagStates.js";
|
|
6
4
|
import { VoxelConstructor } from "./Models/VoxelConstructor.js";
|
|
7
5
|
export default function (materials, modelData) {
|
|
8
6
|
RenderedMaterials.register(materials);
|
|
@@ -10,14 +8,7 @@ export default function (materials, modelData) {
|
|
|
10
8
|
VoxelModelConstructorRegister.setGeometryPalette(modelData.geometryPalette);
|
|
11
9
|
VoxelModelConstructorRegister.registerGeometry(modelData.geometry);
|
|
12
10
|
VoxelModelConstructorRegister.registerModels(modelData.models);
|
|
13
|
-
for (const model of modelData.models) {
|
|
14
|
-
SchemaRegister.registerModel(model.id, model.schema);
|
|
15
|
-
}
|
|
16
|
-
for (const voxel of modelData.voxels) {
|
|
17
|
-
SchemaRegister.registerVoxel(voxel.id, voxel.modelId, voxel.modSchema);
|
|
18
|
-
}
|
|
19
|
-
VoxelTagStates.load(modelData.tagState);
|
|
20
11
|
for (const voxel of modelData.voxels) {
|
|
21
|
-
VoxelModelConstructorRegister.registerVoxel(new VoxelConstructor(voxel.id, VoxelModelConstructorRegister.modelData.get(voxel.modelId), voxel));
|
|
12
|
+
VoxelModelConstructorRegister.registerVoxel(new VoxelConstructor(voxel.id, RenderedMaterials.meshersMap.get(voxel.materialId), VoxelModelConstructorRegister.modelData.get(voxel.modelId), voxel));
|
|
22
13
|
}
|
|
23
14
|
}
|
package/Mesher/InitTask.js
CHANGED
|
@@ -5,10 +5,11 @@ import { MeshSection } from "./Functions/MeshSection";
|
|
|
5
5
|
import { TasksIds } from "../Tasks/TasksIds";
|
|
6
6
|
export default function (rendererThread) {
|
|
7
7
|
Threads.registerTask(TasksIds.BuildSection, (location) => {
|
|
8
|
-
const
|
|
8
|
+
const transfers = [];
|
|
9
|
+
const section = MeshSection(location, transfers);
|
|
9
10
|
if (!section)
|
|
10
11
|
return;
|
|
11
|
-
rendererThread.runTask("set-section", section
|
|
12
|
+
rendererThread.runTask("set-section", section, transfers);
|
|
12
13
|
});
|
|
13
14
|
Threads.registerTask(TasksIds.BuildSector, (location) => {
|
|
14
15
|
const sectorPosition = WorldSpaces.sector.getPosition(location[1], location[2], location[3]);
|
|
@@ -25,19 +26,24 @@ export default function (rendererThread) {
|
|
|
25
26
|
console.warn("Tried building a sector with no sections.", sector.position);
|
|
26
27
|
return;
|
|
27
28
|
}
|
|
29
|
+
const transfers = [];
|
|
28
30
|
for (let i = 0; i < sector.sections.length; i++) {
|
|
29
31
|
const section = sector.sections[i];
|
|
30
32
|
if (!section)
|
|
31
33
|
continue;
|
|
34
|
+
let [minY, maxY] = section.getMinMax();
|
|
35
|
+
if (Math.abs(minY) == Infinity && Math.abs(maxY) == Infinity)
|
|
36
|
+
continue;
|
|
37
|
+
transfers.length = 0;
|
|
32
38
|
const sectionMesh = MeshSection([
|
|
33
39
|
location[0],
|
|
34
40
|
sector.position[0],
|
|
35
41
|
sector.position[1] + i * WorldSpaces.section.bounds.y,
|
|
36
42
|
sector.position[2],
|
|
37
|
-
]);
|
|
43
|
+
], transfers);
|
|
38
44
|
if (!sectionMesh)
|
|
39
45
|
continue;
|
|
40
|
-
rendererThread.runTask("set-section", sectionMesh
|
|
46
|
+
rendererThread.runTask("set-section", sectionMesh, transfers);
|
|
41
47
|
}
|
|
42
48
|
});
|
|
43
49
|
}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import { Vec3Array
|
|
2
|
-
import { VoxelMesherDataTool } from "../../../Mesher/Tools/VoxelMesherDataTool";
|
|
3
|
-
export declare function UpdateBounds(tool: VoxelMesherDataTool, origin: Vector3Like, bounds: [Vec3Array, Vec3Array]): void;
|
|
1
|
+
import { Vec3Array } from "@amodx/math";
|
|
4
2
|
export declare function GetBounds(vectors: Vec3Array[]): [Vec3Array, Vec3Array];
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
export function UpdateBounds(tool, origin, bounds) {
|
|
2
|
-
//min
|
|
3
|
-
if (origin.x + bounds[0][0] < tool.bounds.min[0])
|
|
4
|
-
tool.bounds.min[0] = origin.x + bounds[0][0];
|
|
5
|
-
if (origin.y + bounds[0][1] < tool.bounds.min[1])
|
|
6
|
-
tool.bounds.min[1] = origin.y + bounds[0][1];
|
|
7
|
-
if (origin.z + bounds[0][2] < tool.bounds.min[2])
|
|
8
|
-
tool.bounds.min[2] = origin.z + bounds[0][2];
|
|
9
|
-
//max
|
|
10
|
-
if (origin.x + bounds[1][0] > tool.bounds.max[0])
|
|
11
|
-
tool.bounds.max[0] = origin.x + bounds[1][0];
|
|
12
|
-
if (origin.y + bounds[1][1] > tool.bounds.max[1])
|
|
13
|
-
tool.bounds.max[1] = origin.y + bounds[1][1];
|
|
14
|
-
if (origin.z + bounds[1][2] > tool.bounds.max[2])
|
|
15
|
-
tool.bounds.max[2] = origin.z + bounds[1][2];
|
|
16
|
-
}
|
|
17
1
|
export function GetBounds(vectors) {
|
|
18
2
|
let minX = Infinity;
|
|
19
3
|
let minY = Infinity;
|
|
@@ -2,7 +2,6 @@ import { QuadVerticies, QuadVerticiesArray, } from "../../../Geomtry/Geometry.ty
|
|
|
2
2
|
import { VoxelFaces, VoxelFacesArray } from "../../../../Math";
|
|
3
3
|
import { VoxelRelativeCubeIndex } from "../../../../Models/Indexing/VoxelRelativeCubeIndex";
|
|
4
4
|
import { VoxelLightData } from "../../../../Voxels/Cursor/VoxelLightData";
|
|
5
|
-
const lightData = new VoxelLightData();
|
|
6
5
|
export const GradientCheckSets = [];
|
|
7
6
|
GradientCheckSets[VoxelFaces.Up] = [];
|
|
8
7
|
GradientCheckSets[VoxelFaces.Up][QuadVerticies.TopRight] = [
|
|
@@ -311,37 +310,21 @@ export function getVertexWeights(face, x, y, z) {
|
|
|
311
310
|
}
|
|
312
311
|
return getInterpolationWeights(u, v, flip);
|
|
313
312
|
}
|
|
314
|
-
const
|
|
315
|
-
const lightValues2 = [0, 0, 0, 0];
|
|
316
|
-
const lightValues3 = [0, 0, 0, 0];
|
|
317
|
-
const lightValues4 = [0, 0, 0, 0];
|
|
318
|
-
const lightValues5 = [0, 0, 0, 0];
|
|
313
|
+
const lightData = new VoxelLightData();
|
|
319
314
|
export function getInterpolationValue(value, weights) {
|
|
320
|
-
lightData.
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
lightValues4[1] * weights[3];
|
|
334
|
-
lightValues5[2] =
|
|
335
|
-
lightValues1[2] * weights[0] +
|
|
336
|
-
lightValues2[2] * weights[1] +
|
|
337
|
-
lightValues3[2] * weights[2] +
|
|
338
|
-
lightValues4[2] * weights[3];
|
|
339
|
-
lightValues5[3] =
|
|
340
|
-
lightValues1[3] * weights[0] +
|
|
341
|
-
lightValues2[3] * weights[1] +
|
|
342
|
-
lightValues3[3] * weights[2] +
|
|
343
|
-
lightValues4[3] * weights[3];
|
|
344
|
-
return lightData.setLightValues(lightValues5);
|
|
315
|
+
return lightData.createLightValue(lightData.getS(value[0]) * weights[0] +
|
|
316
|
+
lightData.getS(value[1]) * weights[1] +
|
|
317
|
+
lightData.getS(value[2]) * weights[2] +
|
|
318
|
+
lightData.getS(value[3]) * weights[3], lightData.getR(value[0]) * weights[0] +
|
|
319
|
+
lightData.getR(value[1]) * weights[1] +
|
|
320
|
+
lightData.getR(value[2]) * weights[2] +
|
|
321
|
+
lightData.getR(value[3]) * weights[3], lightData.getG(value[0]) * weights[0] +
|
|
322
|
+
lightData.getG(value[1]) * weights[1] +
|
|
323
|
+
lightData.getG(value[2]) * weights[2] +
|
|
324
|
+
lightData.getG(value[3]) * weights[3], lightData.getB(value[0]) * weights[0] +
|
|
325
|
+
lightData.getB(value[1]) * weights[1] +
|
|
326
|
+
lightData.getB(value[2]) * weights[2] +
|
|
327
|
+
lightData.getB(value[3]) * weights[3]);
|
|
345
328
|
}
|
|
346
329
|
export const addQuadWeights = (quad, direction) => {
|
|
347
330
|
const returnArray = [];
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import type { VoxelMesherDataTool } from "../../../../Mesher/Tools/VoxelMesherDataTool.js";
|
|
2
2
|
import { VoxelFaces } from "../../../../Math/index.js";
|
|
3
|
-
export
|
|
4
|
-
settings: {
|
|
5
|
-
doAO: boolean;
|
|
6
|
-
doLight: boolean;
|
|
7
|
-
};
|
|
8
|
-
calculate(face: VoxelFaces, tool: VoxelMesherDataTool): void;
|
|
9
|
-
};
|
|
3
|
+
export default function calculateFaceData(face: VoxelFaces, builder: VoxelMesherDataTool): void;
|
|
@@ -4,54 +4,45 @@ import { VoxelLightData } from "../../../../Voxels/Cursor/VoxelLightData.js";
|
|
|
4
4
|
const lightData = new VoxelLightData();
|
|
5
5
|
const currentLightValues = new Uint16Array([0, 0, 0, 0]);
|
|
6
6
|
const loadedLightValues = new Uint16Array([0, 0, 0, 0]);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
currentLightValues[2] < loadedLightValues[2]
|
|
46
|
-
? loadedLightValues[2]
|
|
47
|
-
: currentLightValues[2];
|
|
48
|
-
currentLightValues[3] =
|
|
49
|
-
currentLightValues[3] < loadedLightValues[3]
|
|
50
|
-
? loadedLightValues[3]
|
|
51
|
-
: currentLightValues[3];
|
|
52
|
-
}
|
|
53
|
-
tool.lightData[face][vertex] =
|
|
54
|
-
lightData.setLightValues(currentLightValues);
|
|
7
|
+
export default function calculateFaceData(face, builder) {
|
|
8
|
+
let light = builder.voxel.getLight();
|
|
9
|
+
const faceNormal = VoxelFaceDirections[face];
|
|
10
|
+
const x = builder.position.x;
|
|
11
|
+
const y = builder.position.y;
|
|
12
|
+
const z = builder.position.z;
|
|
13
|
+
const vertexData = builder.lightData[face];
|
|
14
|
+
const nVoxel = builder.nVoxel;
|
|
15
|
+
const checkSet = GradientCheckSets[face];
|
|
16
|
+
const otherLight = builder.space.getLight(builder.nVoxel, x + faceNormal[0], y + faceNormal[1], z + faceNormal[2]) || 0;
|
|
17
|
+
light = otherLight >= 0 ? otherLight : light >= 0 ? light : 0;
|
|
18
|
+
for (let vertex = 0; vertex < 4; vertex++) {
|
|
19
|
+
vertexData[vertex] = light;
|
|
20
|
+
lightData.getLightValuesArrayToRef(light, currentLightValues);
|
|
21
|
+
for (let i = 0; i < 9; i += 3) {
|
|
22
|
+
const nl = builder.space.getLight(nVoxel, checkSet[vertex][i] + x, checkSet[vertex][i + 1] + y, checkSet[vertex][i + 2] + z);
|
|
23
|
+
if (nl <= 0)
|
|
24
|
+
continue;
|
|
25
|
+
/*
|
|
26
|
+
Do Light
|
|
27
|
+
*/
|
|
28
|
+
lightData.getLightValuesArrayToRef(nl, loadedLightValues);
|
|
29
|
+
currentLightValues[0] =
|
|
30
|
+
currentLightValues[0] < loadedLightValues[0]
|
|
31
|
+
? loadedLightValues[0]
|
|
32
|
+
: currentLightValues[0];
|
|
33
|
+
currentLightValues[1] =
|
|
34
|
+
currentLightValues[1] < loadedLightValues[1]
|
|
35
|
+
? loadedLightValues[1]
|
|
36
|
+
: currentLightValues[1];
|
|
37
|
+
currentLightValues[2] =
|
|
38
|
+
currentLightValues[2] < loadedLightValues[2]
|
|
39
|
+
? loadedLightValues[2]
|
|
40
|
+
: currentLightValues[2];
|
|
41
|
+
currentLightValues[3] =
|
|
42
|
+
currentLightValues[3] < loadedLightValues[3]
|
|
43
|
+
? loadedLightValues[3]
|
|
44
|
+
: currentLightValues[3];
|
|
55
45
|
}
|
|
56
|
-
|
|
57
|
-
}
|
|
46
|
+
vertexData[vertex] = lightData.setLightValues(currentLightValues);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import { Vector3Like } from "@amodx/math";
|
|
2
|
-
import { VoxelMesherDataTool } from "Mesher/Tools/VoxelMesherDataTool";
|
|
3
1
|
import { GeoemtryNode } from "../../GeometryNode";
|
|
4
2
|
import { VoxelCustomGeomtryNode } from "../../../../../Models/VoxelModel.types";
|
|
5
|
-
import { QuadScalarVertexData } from "../../../../Geomtry/Primitives/QuadVertexData";
|
|
6
3
|
import { VoxelFaces } from "../../../../../Math";
|
|
7
4
|
import type { LiquidVoxelModelArgs } from "../../../../../Models/Defaults/LiquidVoxelModel";
|
|
8
5
|
export declare class LiquidGeometryNode extends GeoemtryNode<VoxelCustomGeomtryNode, LiquidVoxelModelArgs> {
|
|
9
|
-
worldLight: QuadScalarVertexData;
|
|
10
6
|
init(): void;
|
|
11
7
|
isExposed(face: VoxelFaces): boolean;
|
|
12
8
|
determineShading(face: VoxelFaces): void;
|
|
13
9
|
shouldFlip(): boolean;
|
|
14
|
-
add(
|
|
10
|
+
add(args: LiquidVoxelModelArgs): boolean;
|
|
15
11
|
}
|