Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

Direct GI #272

Merged
merged 2 commits into from May 7, 2019
Merged

Direct GI #272

merged 2 commits into from May 7, 2019

Conversation

VZout
Copy link
Contributor

@VZout VZout commented May 7, 2019

Added direct GI from before the vacation.

Copy link
Contributor

@Nielsbishere Nielsbishere left a 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


//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;
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

@@ -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;
Copy link
Contributor

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?

Copy link
Contributor

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);
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Contributor

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

// #################### 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];
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@VZout VZout merged commit eef058a into master May 7, 2019
@VZout VZout deleted the feature_gi branch May 9, 2019 11:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants