Surfaces module
Geometric surfaces in the scene which can be intersected by rays.
Files
Classes
- class Sphere
- A sphere centered at the origin with radius m_
radius. - struct HitInfo
- Contains information about a ray intersection hit point.
- struct EmitterRecord
- Data record for conveniently querying and sampling emitters.
- class Surface
- This is the abstract superclass for all surfaces.
- class XformedSurfaceWithMaterial
- A convenience subclass of Surface for simple surfaces with a Transform and a Material.
- class SurfaceGroup
- A collection of Surfaces grouped together.
- struct BBH
- An axis-aligned bounding box hierarchy acceleration structure.
- struct BBHNode
- A node of an axis-aligned bounding box hierarchy.
- class Quad
- A quad spanning from -m_
size / 2 to m_ size / 2 in the (x,y)-plane at z=0.
Functions
- auto intersect(const Ray3f& ray, HitInfo& hit) const -> bool override
- Ray-Surface intersection test.
- void build() override
- Construct the BBH (must be called before intersect)
- auto intersect(const Ray3f& ray, HitInfo& hit) const -> bool override
- Intersect a ray against all surfaces registered with the Accelerator.
- auto intersect(const Ray3f& ray, HitInfo& hit) const -> bool override
- Ray-Surface intersection test.
- auto local_bounds() const -> Box3f override
- Return the surface's local-space AABB.
- auto sample(EmitterRecord& rec, const Vec2f& rv) const -> Color3f override
- Sample a direction from
rec.o
towards this surface. - auto pdf(const Vec3f& o, const Vec3f& v) const -> float override
- Return the probability density of the sample generated by sample.
- auto intersect(const Ray3f& ray, HitInfo& hit) const -> bool override
- Ray-Surface intersection test.
- auto local_bounds() const -> Box3f override
- Return the surface's local-space AABB.
Function documentation
bool intersect(const Ray3f& ray,
HitInfo& hit) const override
#include <src/surfaces/bbh.cpp>
Ray-Surface intersection test.
Parameters | |
---|---|
ray | A 3-dimensional ray data structure with minimum/maximum extent information |
hit | A detailed intersection record, which will be filled by the intersection query |
Returns | true if an intersection was found |
Intersect a ray against this surface and return detailed intersection information.
void build() override
#include <src/surfaces/bbh.cpp>
bool intersect(const Ray3f& ray,
HitInfo& hit) const override
#include <src/surfaces/bbh.cpp>
Intersect a ray against all surfaces registered with the Accelerator.
bool intersect(const Ray3f& ray,
HitInfo& hit) const override
#include <src/surfaces/quad.cpp>
Ray-Surface intersection test.
Parameters | |
---|---|
ray | A 3-dimensional ray data structure with minimum/maximum extent information |
hit | A detailed intersection record, which will be filled by the intersection query |
Returns | true if an intersection was found |
Intersect a ray against this surface and return detailed intersection information.
Box3f local_bounds() const override
#include <src/surfaces/quad.cpp>
Return the surface's local-space AABB.
Color3f sample(EmitterRecord& rec,
const Vec2f& rv) const override
#include <src/surfaces/quad.cpp>
Sample a direction from rec.o
towards this surface.
Parameters | |
---|---|
rec | An emitter query record. Only rec.o is used as input, the remaining fields are used as output. |
rv | Two uniformly distributed random variables on [0,1) |
Returns | The surface color value divided by the probability density of the sample. A zero value means that sampling failed. |
Store result in rec
, and return important weight (i.e. the color of the Surface divided by the probability density of the sample with respect to solid angle).
float pdf(const Vec3f& o,
const Vec3f& v) const override
#include <src/surfaces/quad.cpp>
Return the probability density of the sample generated by sample.
bool intersect(const Ray3f& ray,
HitInfo& hit) const override
#include <darts/sphere.h>
Ray-Surface intersection test.
Parameters | |
---|---|
ray | A 3-dimensional ray data structure with minimum/maximum extent information |
hit | A detailed intersection record, which will be filled by the intersection query |
Returns | true if an intersection was found |
Intersect a ray against this surface and return detailed intersection information.
Box3f local_bounds() const override
#include <darts/sphere.h>
Return the surface's local-space AABB.