Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a few things I would change; mostly the assumption of lights
resources/shaders/path_tracer.hlsl
Outdated
|
||
//prefiltered_color * (kS * sampled_brdf.x + sampled_brdf.y); | ||
return shadow_mult * (light_intensity * (NdotL * spec + NdotL * albedo / M_PI)); | ||
return shadow_mult * (kD * albedo / PI + spec) * light_intensity * NdotL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there two returns here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
resources/shaders/path_tracer.hlsl
Outdated
@@ -96,7 +96,7 @@ float4 TraceColorRay(float3 origin, float3 direction, unsigned int depth, unsign | |||
RayDesc ray; | |||
ray.Origin = origin; | |||
ray.Direction = direction; | |||
ray.TMin = EPSILON; | |||
ray.TMin = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this cause self-intersection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nvm, see you added it to the origin
float exposure = 1; | ||
|
||
float3 color = input[DTid.xy].rgb / (frame_idx); | ||
float3 color = input[DTid.xy].rgb / (frame_idx + 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you divide by frame_idx? Means the color would be divided by 1, then 2, then 3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I guess the var name is correct, but frame_idx is also referenced to as the current render index
resources/shaders/path_tracer.hlsl
Outdated
// #################### GGX ##################### | ||
uint light_count = lights[0].tid >> 2; | ||
int light_to_sample = min(int(nextRand(seed) * light_count), light_count - 1); | ||
Light light = lights[light_to_sample]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if there's no lights available?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Forgot about that case.
Added direct GI from before the vacation.