Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
Scotty3D
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Courses
Scotty3D
Commits
e05795b6
Commit
e05795b6
authored
4 years ago
by
TheNumbat
Browse files
Options
Downloads
Patches
Plain Diff
accidental revert
parent
df0c511b
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/student/pathtracer.cpp
+8
-6
8 additions, 6 deletions
src/student/pathtracer.cpp
with
8 additions
and
6 deletions
src/student/pathtracer.cpp
+
8
−
6
View file @
e05795b6
...
...
@@ -50,18 +50,20 @@ Spectrum Pathtracer::trace_ray(const Ray &ray) {
Mat4
world_to_object
=
object_to_world
.
T
();
Vec3
out_dir
=
world_to_object
.
rotate
(
ray
.
point
-
hit
.
position
).
unit
();
// Debugging: if the normal colors flag is set, return the normal color
if
(
debug_data
.
normal_colors
)
return
Spectrum
::
direction
(
hit
.
normal
);
// Now we can compute the rendering equation at this point.
// We split it into two stages: sampling lighting (i.e. directly connecting
// the current path to each light in the scene), then sampling the BSDF
// to create a new path segment.
// TODO (PathTracer): Task 5
// Instead of initializing this value to a constant color, use the direct,
// indirect lighting components calculated in the code below. The starter
// code sets radiance_out to (0.5,0.5,0.5) so that you can test your geometry
// queries before you implement path tracing.
Spectrum
radiance_out
=
debug_data
.
normal_colors
?
Spectrum
::
direction
(
hit
.
normal
)
:
Spectrum
(
0.5
f
);
// The starter code sets radiance_out to (0.5,0.5,0.5) so that you can test your geometry
// queries before you implement path tracing. You should change this to (0,0,0) and accumulate
// the direct and indirect lighting computed below.
Spectrum
radiance_out
=
Spectrum
(
0.5
f
);
{
auto
sample_light
=
[
&
](
const
auto
&
light
)
{
// If the light is discrete (e.g. a point light), then we only need
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment