mirror of
https://github.com/overte-org/overte.git
synced 2025-08-17 03:26:48 +02:00
Merge pull request #251 from ZappoMan/render_voxels_optimization
Fix Ryan's render problem (hopefully) and don't crash with too many voxels
This commit is contained in:
commit
b9781c2191
3 changed files with 7 additions and 2 deletions
|
@ -220,6 +220,11 @@ int VoxelSystem::newTreeToArrays(VoxelNode* node) {
|
|||
}
|
||||
|
||||
int VoxelSystem::newway__updateNodeInArray(VoxelNode* node) {
|
||||
// If we've run out of room, then just bail...
|
||||
if (_voxelsInWriteArrays >= MAX_VOXELS_PER_SYSTEM) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (node->getShouldRender()) {
|
||||
glm::vec3 startVertex = node->getCorner();
|
||||
float voxelScale = node->getScale();
|
||||
|
|
|
@ -19,7 +19,7 @@ const int TREE_SCALE = 128;
|
|||
const int NUMBER_OF_CHILDREN = 8;
|
||||
const int MAX_VOXEL_PACKET_SIZE = 1492;
|
||||
const int MAX_TREE_SLICE_BYTES = 26;
|
||||
const int MAX_VOXELS_PER_SYSTEM = 500000;
|
||||
const int MAX_VOXELS_PER_SYSTEM = 200000;
|
||||
const int VERTICES_PER_VOXEL = 24;
|
||||
const int VERTEX_POINTS_PER_VOXEL = 3 * VERTICES_PER_VOXEL;
|
||||
const int INDICES_PER_VOXEL = 3 * 12;
|
||||
|
|
|
@ -24,7 +24,7 @@ void addLandscape(VoxelTree * tree) {
|
|||
printf("Adding Landscape...\n");
|
||||
}
|
||||
|
||||
void addScene(VoxelTree * tree) {
|
||||
void voxelTutorial(VoxelTree * tree) {
|
||||
printf("adding scene...\n");
|
||||
|
||||
// We want our corner voxels to be about 1/2 meter high, and our TREE_SCALE is in meters, so...
|
||||
|
|
Loading…
Reference in a new issue