If ray intersects shape, return the shape's color
This commit is contained in:
parent
ca13877c19
commit
34428a764d
1 changed files with 3 additions and 1 deletions
|
@ -10,6 +10,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "scene.h"
|
#include "scene.h"
|
||||||
|
#include "texture.h"
|
||||||
|
|
||||||
|
|
||||||
struct _ObjectList
|
struct _ObjectList
|
||||||
|
@ -170,5 +171,6 @@ scene_trace_ray(Scene *scene, const Ray ray, const int depth)
|
||||||
return out_color;
|
return out_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
return out_color;
|
Texture *tex = object_get_texture(intersected_obj);
|
||||||
|
return texture_get_color(tex);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue