raytracing fixes
This commit is contained in:
@@ -167,7 +167,7 @@ void main(uint3 DTid : SV_DispatchThreadID, uint3 Gid : SV_GroupID, uint groupIn
|
||||
newRay.Origin = surface.P;
|
||||
newRay.TMin = 0;
|
||||
newRay.TMax = dist;
|
||||
newRay.Direction = L;
|
||||
newRay.Direction = normalize(L);
|
||||
|
||||
#ifdef RTAPI
|
||||
wiRayQuery q;
|
||||
@@ -198,7 +198,7 @@ void main(uint3 DTid : SV_DispatchThreadID, uint3 Gid : SV_GroupID, uint groupIn
|
||||
ray.Origin = probePos;
|
||||
ray.TMin = 0; // don't need TMin because we are not tracing from a surface
|
||||
ray.TMax = FLT_MAX;
|
||||
ray.Direction = raydir;
|
||||
ray.Direction = normalize(raydir);
|
||||
|
||||
#ifdef RTAPI
|
||||
wiRayQuery q;
|
||||
@@ -394,7 +394,7 @@ void main(uint3 DTid : SV_DispatchThreadID, uint3 Gid : SV_GroupID, uint groupIn
|
||||
newRay.Origin = surface.P;
|
||||
newRay.TMin = 0.001;
|
||||
newRay.TMax = dist;
|
||||
newRay.Direction = L + max3(surface.sss);
|
||||
newRay.Direction = normalize(L + max3(surface.sss));
|
||||
|
||||
#ifdef RTAPI
|
||||
q.TraceRayInline(
|
||||
@@ -421,9 +421,9 @@ void main(uint3 DTid : SV_DispatchThreadID, uint3 Gid : SV_GroupID, uint groupIn
|
||||
// Infinite bounces based on previous frame probe sampling:
|
||||
if (push.frameIndex > 0)
|
||||
{
|
||||
half energy_conservation = 0.95;
|
||||
float energy_conservation = 0.95;
|
||||
energy_conservation /= PI; // one more divide by PI is inside the ddgi_sample_irradiance, with that we will have 2 PI divides, which is needed for hemishpere sampling
|
||||
half3 ddgi = ddgi_sample_irradiance(surface.P, surface.facenormal, surface.dominant_lightdir, surface.dominant_lightcolor);
|
||||
float3 ddgi = ddgi_sample_irradiance(surface.P, surface.facenormal, surface.dominant_lightdir, surface.dominant_lightcolor);
|
||||
ddgi *= energy_conservation;
|
||||
hit_result += ddgi;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ float4 main(Input input) : SV_TARGET
|
||||
|
||||
RayDesc ray;
|
||||
ray.Origin = P;
|
||||
ray.Direction = sample_hemisphere_cos(surface.N, rng);
|
||||
ray.Direction = normalize(sample_hemisphere_cos(surface.N, rng));
|
||||
ray.TMin = 0.0001;
|
||||
ray.TMax = FLT_MAX;
|
||||
float3 result = 0;
|
||||
|
||||
@@ -152,7 +152,7 @@ void main(uint3 DTid : SV_DispatchThreadID)
|
||||
newRay.Origin = surface.P;
|
||||
newRay.TMin = 0.001;
|
||||
newRay.TMax = dist;
|
||||
newRay.Direction = L + max3(surface.sss);
|
||||
newRay.Direction = normalize(L + max3(surface.sss));
|
||||
|
||||
#ifdef RTAPI
|
||||
wiRayQuery q;
|
||||
@@ -381,7 +381,7 @@ void main(uint3 DTid : SV_DispatchThreadID)
|
||||
newRay.Origin = surface.P;
|
||||
newRay.TMin = 0.001;
|
||||
newRay.TMax = dist;
|
||||
newRay.Direction = L + max3(surface.sss);
|
||||
newRay.Direction = normalize(L + max3(surface.sss));
|
||||
|
||||
#ifdef RTAPI
|
||||
q.TraceRayInline(
|
||||
@@ -444,7 +444,7 @@ void main(uint3 DTid : SV_DispatchThreadID)
|
||||
}
|
||||
if (surfel_gi.a > 0)
|
||||
{
|
||||
half energy_conservation = 0.95;
|
||||
float energy_conservation = 0.95;
|
||||
energy_conservation /= surfel_gi.a;
|
||||
energy_conservation /= PI;
|
||||
surfel_gi.rgb *= energy_conservation;
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace wi::version
|
||||
// minor features, major updates, breaking compatibility changes
|
||||
const int minor = 71;
|
||||
// minor bug fixes, alterations, refactors, updates
|
||||
const int revision = 700;
|
||||
const int revision = 701;
|
||||
|
||||
const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user