Sphere color with constant_medium #951
Replies: 5 comments
-
Do you have a light in the scene? |
Beta Was this translation helpful? Give feedback.
-
Try to set the background to other colours,then see if it changes,if changes,to check the new ray direction in scatter. colour_t ray_colour(const ray_t &r,const hittable_list_t &world,const colour_t &background={0,0,0},int depth=50)
{
if(depth<=0)
return {0,0,0};
auto [is_hit,rec]=world.hit(r, 0.001, infinity);
if(is_hit==false)
return background;
... You also should make a big light sphere to hold everything,if the colour is same as background,to locate the bug. |
Beta Was this translation helpful? Give feedback.
-
Possibly related #760 |
Beta Was this translation helpful? Give feedback.
-
Good thought @Walther . |
Beta Was this translation helpful? Give feedback.
-
Converting to discussion. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When i tried this code of the book 2 in the book 3, no matter what color I apply it stays black.
shared_ptr<hittable> boundary = make_shared<sphere>(point3(200,150,200), 70, make_shared<dielectric>(1.5)); objects.add(boundary); objects.add(make_shared<constant_medium>(boundary, 0.2, color(1, 1, 1)));
What am i doing wrong??
Beta Was this translation helpful? Give feedback.
All reactions