Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CppRaytracer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model 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
Show more breadcrumbs
Yoel
CppRaytracer
Commits
1f6f9ab7
Commit
1f6f9ab7
authored
3 years ago
by
Yoel
Browse files
Options
Downloads
Patches
Plain Diff
EmissionProfile, cleanup
parent
72cad9ff
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
RayTracer/tools/EmissionProfile.cpp
+2
-3
2 additions, 3 deletions
RayTracer/tools/EmissionProfile.cpp
with
2 additions
and
3 deletions
RayTracer/tools/EmissionProfile.cpp
+
2
−
3
View file @
1f6f9ab7
...
...
@@ -25,8 +25,8 @@ EmissionProfile::EmissionProfile(const std::shared_ptr<util::Sampler>& emission,
distribution
(
std
::
make_optional
(
distribution
))
{
// vec: a vector with texel and grey value
std
::
vector
<
std
::
pair
<
std
::
pair
<
float
,
float
>
,
float
>>
vec
;
for
(
int
w
=
0
;
w
<
=
distribution
.
width
;
w
++
)
{
for
(
int
h
=
0
;
h
<
=
distribution
.
height
;
h
++
)
{
for
(
int
w
=
0
;
w
<
distribution
.
width
;
w
++
)
{
for
(
int
h
=
0
;
h
<
distribution
.
height
;
h
++
)
{
auto
xyz
=
distribution
[{
w
,
h
}];
float
grey
=
0.299
f
*
xyz
[
0
]
+
0.587
f
*
xyz
[
1
]
+
0.114
f
*
xyz
[
2
];
vec
.
push_back
({{(
float
)
w
/
(
float
)
distribution
.
width
,
...
...
@@ -45,7 +45,6 @@ EmissionProfile::EmissionProfile(const std::shared_ptr<util::Sampler>& emission,
float
cumm
=
0
;
for
(
auto
x
:
vec
)
{
cumm
+=
x
.
second
;
// std::cout << cumm << std::endl;
cdf
.
push_back
({
x
.
first
,
cumm
});
}
// Transform cdf to cap at 1
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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