Got the octree data to the GPU and it's traversing it, but it having some corruption issues. Endianness???
This commit is contained in:
@@ -7,10 +7,35 @@
|
||||
#include "CLCaster.h"
|
||||
#include "LightHandle.h"
|
||||
|
||||
|
||||
// Typical light workflow:
|
||||
// 1.) Create light prototype with desired values
|
||||
// 2.) Submit prototype to the LightController
|
||||
/**
|
||||
* Light Handle :
|
||||
* - Contains data relating to movement, and a reference to the rbgi, direction, and position
|
||||
* elements in the LightController.
|
||||
* - Resultant of the use of LightController.create_light(LightPrototype). Cannot be self instantiated.
|
||||
* - On deconstruction, light data is removed from the LightController via a reference and the light disappears
|
||||
*
|
||||
* LightPrototype :
|
||||
* - Contains the desired starting values for the light. The LightHandler object will then be
|
||||
* instantiated using this data
|
||||
*
|
||||
* PackedData :
|
||||
* - We need to single out the data that the GPU needs into a single contiguous
|
||||
* array. PackedData holds the values for position, direction, and rgbi
|
||||
*
|
||||
* LightController :
|
||||
* - Contains the PackedData array in a static sized array.
|
||||
* Empty light slots are set to 0 and still sent over the line
|
||||
* TODO: This introduces light limits and inefficiencies
|
||||
* - Contains a factory that takes LightPrototypes and generates unique ptr LightHandles.
|
||||
* Each light handle is given a light index enabling light removal.
|
||||
*
|
||||
* Typical light workflow:
|
||||
* 1.) Create light prototype with desired values
|
||||
* 2.) Submit prototype to the LightController
|
||||
* 3.) Get a light handle back from the controller
|
||||
* - The handle is unsafe and will break if it exceeds PackedData's lifetime
|
||||
*
|
||||
*/
|
||||
|
||||
struct LightPrototype {
|
||||
|
||||
@@ -56,8 +81,10 @@ public:
|
||||
LightController(std::shared_ptr<CLCaster> raycaster);
|
||||
~LightController();
|
||||
|
||||
// find a free light 'slot' and create
|
||||
// find a free light 'slot' and create the light
|
||||
// LightHandles are single instance single lifetime data structures
|
||||
std::shared_ptr<LightHandle> create_light(LightPrototype light_prototype);
|
||||
|
||||
void remove_light(unsigned int light_index);
|
||||
|
||||
void recieve_event(VrEventPublisher* publisher, std::unique_ptr<vr::Event> event) override;
|
||||
|
||||
Reference in New Issue
Block a user