|
raytracer
Parallel Ray Tracer written from scratch (no graphics API).
|
#include <cubemap.h>
Public Member Functions | |
| Cubemap (const std::string &path, int face_width, int face_height, int color_channels, bool is_grayscale) | |
| Cubemap (common::Image _top, common::Image _left, common::Image _front, common::Image _right, common::Image _back, common::Image _bottom) | |
| common::Vec3 | get_color_at_point (const common::Vec3 &normal) const |
A texture made of six images, one for each face of a cube, which is sampled using a direction vector.
| raytracer::raytracer::Cubemap::Cubemap | ( | const std::string & | path, |
| int | face_width, | ||
| int | face_height, | ||
| int | color_channels, | ||
| bool | is_grayscale ) |
Loads a cubemap from a bitmap on disk, with the faces laid out in a 4x3 cross.
| std::runtime_error | If the file cannot be opened or read, or if it is too small for the face dimensions. |
| path | The path to the bitmap file. |
| face_width | The width of each face in pixels. |
| face_height | The height of each face in pixels. |
| color_channels | The number of color channels of each face. |
| is_grayscale | Whether the faces are grayscale (scalar color instead of RGB). |


| raytracer::raytracer::Cubemap::Cubemap | ( | common::Image | _top, |
| common::Image | _left, | ||
| common::Image | _front, | ||
| common::Image | _right, | ||
| common::Image | _back, | ||
| common::Image | _bottom ) |
Creates a cubemap from six existing images.
| _top | The top face. |
| _left | The left face. |
| _front | The front face. |
| _right | The right face. |
| _back | The back face. |
| _bottom | The bottom face. |

|
nodiscard |
Calculates the texture color at a point on the sphere, given the normal.
| normal | The normal to the sphere surface at that point. |

