Skip to content

Commit

Permalink
No instance or group when light was hit
Browse files Browse the repository at this point in the history
We should probably retrieve that but don't have that information
at this time
  • Loading branch information
szellmann committed Sep 28, 2024
1 parent 7fbea32 commit 18bbf57
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions renderer/DirectLight_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,20 @@ bool shade(ScreenSample &ss, Ray &ray, unsigned worldID,
float4 color{1.f};
float2 uv{hr.u,hr.v};

int instID = hitRec.volumeHit ? hrv.instID : hr.inst_id;
const dco::Instance &inst = onDevice.instances[instID];
const dco::Group &group = onDevice.groups[inst.groupID];

if (hitRec.lightHit) {
hitPos = ray.ori + hrl.t * ray.dir;
const dco::Light &light = onDevice.lights[world.allLights[hrl.lightID]];
if (light.type == dco::Light::Quad)
throughput = light.asQuad.intensity(hitPos);
hdriMiss = true; // TODO?!
return false;
} else if (hitRec.volumeHit) {
}

int instID = hitRec.volumeHit ? hrv.instID : hr.inst_id;
const dco::Instance &inst = onDevice.instances[instID];
const dco::Group &group = onDevice.groups[inst.groupID];

if (hitRec.volumeHit) {
hitPos = ray.ori + hrv.t * ray.dir;
eps = epsilonFrom(hitPos, ray.dir, hrv.t);
viewDir = -ray.dir;
Expand Down

0 comments on commit 18bbf57

Please sign in to comment.