Browse Source

updated info with notes. Committed some testing changes

master
dirkson 6 months ago
parent
commit
48ebcb0f50
3 changed files with 42 additions and 30 deletions
  1. +40
    -28
      doc/info
  2. +1
    -1
      src/voxen_vulkan.c
  3. +1
    -1
      src/voxen_vulkan_pick_gpu.c

+ 40
- 28
doc/info View File

@@ -10,35 +10,35 @@ Core concepts
Voxject
A voxject is a separate, self-contained clump of voxels.
A voxject has
XYZ Location
XYZW Rotation (Quaternion)
XYZ*2 BoundingBox (Derived)
octree octree
ptr AnimationInfo
uint16 LightsNum
XYZLocation
XYZW Rotation (Quaternion)
XYZ*2BoundingBox (Derived)
octree octree
ptrAnimationInfo
uint16 LightsNum
Light[v] Lights
uint16 ChildrenNum
ptr[v] Children
uint16 ChildrenNum
ptr[v] Children
Array of sub-voxjects.
Their Location is relative to this thing's location
Light
A light has:
XYZ Location
XYZ Color
float Brightness
XYZLocation
XYZColor
floatBrightness
Octree
Each level has:
uint16 Material (Derived)
//uint8 Info
bool Solid
xyz Offset
ptr[4] Lights, brightest(Distance/brightness)
ptr ParentNode
uint16 Material (Derived)
//uint8Info
bool Solid
xyzOffset
ptr[4] Lights, brightest(Distance/brightness)
ptrParentNode
union {
ptr[8] Zero to eight sub-nodes (if not solid)
ptr Texture (if solid)
ptr[8] Zero to eight sub-nodes (if not solid)
ptrTexture (if solid)
}
ptr Location in bookkeeping list (if any)
ptrLocation in bookkeeping list (if any)
If a level has no sub-nodes, it will be rendered as a single voxel
Voxel
Volumetric pixel, untextured, but may be shaped
@@ -50,24 +50,24 @@ Core concepts
Ok, so what do we actually hand the GPU?
A giant list of potentially-renderable voxels. (2^32 should be enough)
A smaller list of currently-rendering voxels, uploaded solely as offsets into the larger list
A list of voxjects (2^16 should be enough)
A list of lights (2^16 should be enough)
A list of voxjects(2^16 should be enough)
A list of lights(2^16 should be enough)
A list of materials (2^16 should be enough)

Bookkeeping lists
We need to keep the GPU voxel lists in system ram as well, in the following format:
Voxel Bookkeeping List
If a voxel is item X in this list, it's also item X in the Potentially Renderable list
ptr Voxel System location
ptr Voxel System location
float CameraDistance
Bool UpdatedThisRound
BoolUpdatedThisRound
Voxel Potentially Renderable List
uint16 Material
XYZ Location
ptr Voxject
ptr octreeNode
XYZLocation
ptrVoxject
ptroctreeNode
Voxel ToBeAdded List
ptr Voxel System Location
ptr Voxel System Location
float CameraDistance
Voxel CurrentlyRendering List
uint32 PositionInPotentiallyRenderable
@@ -88,3 +88,15 @@ Bookkeeping lists
Optimizations
Occasionally taking the time to order the Bookkeeping/Potentially Renderable lists by distance may help ordering speed



octreeNodeBranch
bool IsObject
int material //Usually stores either material of a leaf, or average material. For an object,stores the main material of that object
int rotation //defines rotation for ObjectInfo. Can use space via union for caching something?
union
Object* ObjectInfo
octreeNode* ParentObject
bool ChildrenAreLoaded //if children have been loaded, then damage and display info is in the childrenarray. Otherwise, its in the ObjectInfo
octreeNode* Children[8]
lightingInfo...

+ 1
- 1
src/voxen_vulkan.c View File

@@ -5,7 +5,7 @@
#include "graphene.h"
//#include "vtl.h"

#include "vk_enum_string_helper.h"
#include "vulkan/vk_enum_string_helper.h"

//***Constants***



+ 1
- 1
src/voxen_vulkan_pick_gpu.c View File

@@ -5,7 +5,7 @@
#include <string.h> //for memcmp. Because memory is a string!

//#include "vtl.h"
#include "vk_enum_string_helper.h"
#include "vulkan/vk_enum_string_helper.h"

void voxen_vulkan_free_physical_devices(VoxenVulkanPhysicalInfo **devices, int32_t deviceCount, int32_t skip)
{


Loading…
Cancel
Save