we are doing stuff
This commit is contained in:
@@ -25,11 +25,11 @@ inline bool AABBIntersection(glm::vec3 min, glm::vec3 max, const Ray* r)
|
||||
}
|
||||
|
||||
bool hit = (tmin <= tmax);
|
||||
if (hit) {
|
||||
std::cout << "Ray hits AABB: " << tmin << ", " << tmax << std::endl;
|
||||
} else {
|
||||
std::cout << "Ray misses AABB" << std::endl;
|
||||
}
|
||||
//if (hit) {
|
||||
//std::cout << "Ray hits AABB: " << tmin << ", " << tmax << std::endl;
|
||||
//} else {
|
||||
//std::cout << "Ray misses AABB" << std::endl;
|
||||
//}
|
||||
return hit;
|
||||
}
|
||||
|
||||
@@ -146,24 +146,24 @@ class KDTree {
|
||||
return;
|
||||
}
|
||||
|
||||
std::cout << "Checking node bounds: " << glm::to_string(node->MinBounds) << " " << glm::to_string(node->MaxBounds) << std::endl;
|
||||
//std::cout << "Checking node bounds: " << glm::to_string(node->MinBounds) << " " << glm::to_string(node->MaxBounds) << std::endl;
|
||||
|
||||
if (AABBIntersection(node->MinBounds, node->MaxBounds, ray)) {
|
||||
std::cout << "Ray intersects node, num tris: " << (node->LeftChild || node->RightChild ? -1 : 1) << std::endl;
|
||||
//std::cout << "Ray intersects node, num tris: " << (node->LeftChild || node->RightChild ? -1 : 1) << std::endl;
|
||||
if (node->LeftChild || node->RightChild) {
|
||||
intersect(node->LeftChild, ray, outIndices);
|
||||
intersect(node->RightChild, ray, outIndices);
|
||||
}
|
||||
else {
|
||||
std::cout << "Ray hit leaf node with triangle index: " << node->TriIdx << std::endl;
|
||||
//std::cout << "Ray hit leaf node with triangle index: " << node->TriIdx << std::endl;
|
||||
outIndices.push_back(node->TriIdx);
|
||||
}
|
||||
}
|
||||
else {
|
||||
std::cout << "Ray does not intersect node" << std::endl;
|
||||
//std::cout << "Ray does not intersect node" << std::endl;
|
||||
}
|
||||
std::cout << std::endl;
|
||||
exit(0);
|
||||
//std::cout << std::endl;
|
||||
//exit(0);
|
||||
}
|
||||
|
||||
glm::vec3 getVertexBounds(uint32_t index) const {
|
||||
|
||||
@@ -110,7 +110,6 @@ public:
|
||||
// Traverse the K-D tree to identify the set of triangles that may intersect the ray.
|
||||
std::vector<uint32_t> candidateIndices;
|
||||
mKdTree->intersect(ray, candidateIndices);
|
||||
//std::cout << "Ray Candidates Available: " << candidateIndices.size() << std::endl;
|
||||
|
||||
for (uint32_t idx : candidateIndices)
|
||||
{
|
||||
|
||||
29
libhart/hart.md
Normal file
29
libhart/hart.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# inferno HART modules
|
||||
|
||||
Modules are registered at load time - instantiated when selected
|
||||
_GET, _DESTROY & _CREDIT must be defined and return valid context's
|
||||
|
||||
Inferno will first initialise the module and then wait for the Ready state.
|
||||
|
||||
The possible states a module can be in are:
|
||||
- Bad (Not ready)
|
||||
- Idle (Ready for rays)
|
||||
- Build (Scene is submitted and being processed)
|
||||
- Trace (Tracing!)
|
||||
|
||||
Once the HHM dispatches a new scene to the module, it will wait until
|
||||
the state is Done to dispatch work during scene building the modules
|
||||
state must be Build.
|
||||
|
||||
Once the scene is ready and so is the trace, the HHM will start the tracing
|
||||
state by calling the start function of the module, the module must go
|
||||
through the rays added to it before start was called and then
|
||||
for each ray, call Hit and pass the current context, this may result
|
||||
in Inferno to push another ray to the queue, the module will go until
|
||||
empty or signaled to stop.
|
||||
|
||||
Once empty the module will switch to the Ready state again, so Inferno
|
||||
can get the next frame ready and repeat.
|
||||
|
||||
The HART Module also has the option to
|
||||
|
||||
@@ -10,37 +10,6 @@
|
||||
|
||||
// TODO: C-ify the HART interface
|
||||
|
||||
/**
|
||||
* infero HART modules
|
||||
* Modules are registered at load time - instantiated when selected
|
||||
* _GET, _DESTROY & _CREDIT must be defined and return valid context's
|
||||
*
|
||||
* Inferno will first initialise the module and then wait for the Ready state.
|
||||
*
|
||||
* The possible states a module can be in are:
|
||||
* - Bad (Not ready)
|
||||
* - Idle (Ready for rays)
|
||||
* - Build (Scene is submitted and being processed)
|
||||
* - Trace (Tracing!)
|
||||
*
|
||||
* Once the HHM dispatches a new scene to the module, it will wait until
|
||||
* the state is Done to dispatch work during scene building the modules
|
||||
* state must be Build.
|
||||
*
|
||||
* Once the scene is ready and so is the trace, the HHM will start the tracing
|
||||
* state by calling the start function of the module, the module must go
|
||||
* through the rays added to it before start was called and then
|
||||
* for each ray, call Hit and pass the current context, this may result
|
||||
* in Inferno to push another ray to the queue, the module will go until
|
||||
* empty or signaled to stop.
|
||||
*
|
||||
* Once empty the module will switch to the Ready state again, so Inferno
|
||||
* can get the next frame ready and repeat.
|
||||
*
|
||||
* The HART Module also has the option to
|
||||
*
|
||||
*/
|
||||
|
||||
namespace inferno {
|
||||
|
||||
#ifdef _WIN32
|
||||
@@ -53,14 +22,12 @@ namespace inferno {
|
||||
#define HART_INTERFACE extern "C"
|
||||
#endif
|
||||
|
||||
//#define REGISTER_MODULE
|
||||
|
||||
HART_INTERFACE typedef void* (*HART_INIT_F)(void);
|
||||
HART_INTERFACE typedef void (*HART_DESTROY_F)(void*);
|
||||
HART_INTERFACE typedef void* (*HART_CREDIT_F)(void);
|
||||
|
||||
class HARTViz
|
||||
{
|
||||
};
|
||||
|
||||
class Ray;
|
||||
class HitInfo;
|
||||
|
||||
@@ -69,6 +36,11 @@ typedef void (*HART_HIT_CALLBACK)(void* context, HitInfo* hit);
|
||||
class HARTModule
|
||||
{
|
||||
public:
|
||||
class HARTViz
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
enum class EModuleState : uint8_t
|
||||
{
|
||||
Bad, // Not ready!
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
|
||||
private:
|
||||
glm::vec2 mViewport = { 100.0f, 100.0f };
|
||||
glm::vec2 mRayViewport = { 3.0f, 3.0f };
|
||||
glm::vec2 mRayViewport = { 200.0f, 200.0f };
|
||||
glm::mat4 mViewMatrix = {};
|
||||
glm::mat4 mProjMatrix = {};
|
||||
glm::mat4 mCameraLook = {};
|
||||
|
||||
7845
profile.log
7845
profile.log
File diff suppressed because it is too large
Load Diff
@@ -28,7 +28,7 @@ HARTModuleDirectory* HHM::getModuleDirectory()
|
||||
return &mDirectory;
|
||||
}
|
||||
|
||||
EModuleState HHM::getModuleState()
|
||||
HARTModule::EModuleState HHM::getModuleState()
|
||||
{
|
||||
HARTModule* mod = mDirectory.getActiveModule();
|
||||
return mod->getState();
|
||||
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
~HHM();
|
||||
|
||||
HARTModuleDirectory* getModuleDirectory();
|
||||
EModuleState getModuleState();
|
||||
HARTModule::EModuleState getModuleState();
|
||||
|
||||
void newScene(Scene* scene);
|
||||
void notifySceneUpdate();
|
||||
|
||||
@@ -46,7 +46,7 @@ private:
|
||||
std::mutex _RenderData;
|
||||
std::condition_variable _RenderPause;
|
||||
|
||||
glm::ivec2 mRenderTargetSize = {3, 3};
|
||||
glm::ivec2 mRenderTargetSize = {200, 200};
|
||||
|
||||
Scene* mCurrentScene = nullptr;
|
||||
RaySource* mRaySource = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user