Skip to content

Commit

Permalink
コメント修正
Browse files Browse the repository at this point in the history
  • Loading branch information
githole committed Nov 13, 2013
1 parent cbdec84 commit 5300ad7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lighttracing.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ LighttracingResult generate_vertices_by_lighttracing(const Camera &camera, Rando
vertices.push_back(Vertex(position_on_light, normal_on_light, normal_on_light, LightID, Vertex::OBJECT_TYPE_LIGHT, total_pdf_A, Color(0, 0, 0)));

// 現在の放射輝度(モンテカルロ積分のスループット)
// 本当は次の頂点(y1)が決まらないと光源からその方向への放射輝度値は決まらないが、今回は
// 完全拡散光源を仮定しているので、方向に依らずに一定の値(spheres[LightID].emission)になる。
Color MC_throughput = spheres[LightID].emission;

// 完全拡散光源を仮定しているので、Diffuse面におけるサンプリング方法と同じものをつかって次の方向を決める
Expand All @@ -39,7 +41,6 @@ LighttracingResult generate_vertices_by_lighttracing(const Camera &camera, Rando
Ray now_ray(position_on_light, next_dir);
Vec previous_normal = normal_on_light;

double russian_roulette_probability = 1.0;
for (;;) {
Intersection intersection;
const bool scene_hit = intersect_scene(now_ray, &intersection);
Expand Down Expand Up @@ -81,7 +82,7 @@ LighttracingResult generate_vertices_by_lighttracing(const Camera &camera, Rando
const Sphere &now_object = spheres[intersection.object_id];
const Hitpoint &hitpoint = intersection.hitpoint;
const Vec orienting_normal = dot(hitpoint.normal , now_ray.dir) < 0.0 ? hitpoint.normal: (-1.0 * hitpoint.normal); // 交差位置の法線(物体からのレイの入出を考慮)
russian_roulette_probability = russian_roulette(now_object);
const double russian_roulette_probability = russian_roulette(now_object);
// ロシアンルーレット
if (rnd->next01() >= russian_roulette_probability) {
break;
Expand Down Expand Up @@ -177,4 +178,4 @@ LighttracingResult generate_vertices_by_lighttracing(const Camera &camera, Rando

};

#endif
#endif
2 changes: 1 addition & 1 deletion pathtracing.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,4 @@ PathtracingResult generate_vertices_by_pathtracing(const Camera &camera, const i

};

#endif
#endif

0 comments on commit 5300ad7

Please sign in to comment.