Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added path tracing renderer #393

Merged
merged 5 commits into from
Jun 1, 2018
Merged

Conversation

favreau
Copy link
Member

@favreau favreau commented May 24, 2018

No description provided.

@@ -49,11 +49,11 @@ void LoadDataFunctor::operator()(Blob&& blob)
{
struct Scope
{
Scope(Blob&& blob, LoadDataFunctor& parent)
Scope(Blob&& b, LoadDataFunctor& parent)
Copy link
Contributor

Choose a reason for hiding this comment

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

why this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

Clang complains about variable shadowing the other one line 62. Gcc is happy though. I had this issue when compiling on MacOSX

Copy link
Contributor

Choose a reason for hiding this comment

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

ah ok

@favreau favreau force-pushed the pathtracing branch 2 times, most recently from ca120af to dacc288 Compare May 24, 2018 12:51
@favreau favreau requested a review from straaljager May 24, 2018 12:58
const vec3f hitpoint = dg.P + self->abstract.super.epsilon * dg.Ns;
setRay(localray, hitpoint, raydir);
localray.t0 = self->abstract.super.epsilon;
localray.t = self->abstract.ambientOcclusionDistance;

Choose a reason for hiding this comment

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

I'm not sure if limiting t (the maximum allowed hit distance along ray) to the ambientOcclusionDistance will work the same as setting it to a very large number. This may or may not result in some weird lighting, but may also be faster.

Copy link
Member Author

Choose a reason for hiding this comment

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

I understand, but the ambient occlusion distance can be set to a very large value anyway. And this way, we can change it at runtime.

Kd = Kd * (1.f - self->abstract.shadows);
}
else
Kd = Kd * (1.f - self->abstract.shadows);

Choose a reason for hiding this comment

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

This doesn't seem right, the if/else statement has the same outcome for both the if and else branch (if the surface faces the light source and is not occluded from it, then the hitpoint should receive additional light).

Copy link
Member Author

Choose a reason for hiding this comment

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

Hum, you're right, I am not 100% sure either of the current implementation. Let's talk tomorrow.

Copy link

@straaljager straaljager left a comment

Choose a reason for hiding this comment

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

Thanks for this PR, great to finally see path tracing in Brayns!

const vec3f sunSampleDirection =
getConeSample(lightDirection, rng,
self->abstract.softShadows);
const float sunLight =

Choose a reason for hiding this comment

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

I would rename sunLight to sunAngle to avoid confusion and reflect better what it's doing (that was a bad naming choice on my part, sorry)

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, I usually use cosNL for diffuse and cosLR for specular. In this case, only diffuse shading is processed. And Sun is probably a specific case too since we can have many lights. I'll change it to cosNL then, unless you have an objection.


// CHECK THIS!!! WITH OR WITHOUT * MASK
// results are very different. Color bleeding is much stronger with mask
color = accucolor * mask;

Choose a reason for hiding this comment

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

After some digging into path tracing theory, it would be more correct to not multiply the final color by the mask colour again, as it has already been taken into account. Otherwise this will result into too much colour bleeding.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok. Fixed! :)

@favreau favreau force-pushed the pathtracing branch 7 times, most recently from 78017a7 to aed7a75 Compare May 30, 2018 11:56
@favreau favreau merged commit 8174041 into BlueBrain:master Jun 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants