mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
[sprout.darkroom] implement refraction process
This commit is contained in:
parent
8e306168da
commit
63ac0d0df5
10 changed files with 494 additions and 69 deletions
|
@ -11,6 +11,7 @@
|
|||
#include <cstddef>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/type_traits/identity.hpp>
|
||||
#include <sprout/darkroom/renderers/calculate.hpp>
|
||||
|
||||
namespace sprout {
|
||||
namespace darkroom {
|
||||
|
@ -38,13 +39,24 @@ namespace sprout {
|
|||
//
|
||||
// calculate
|
||||
//
|
||||
template<typename Tracer, typename Renderer, typename Camera, typename Objects, typename Lights, typename Unit2D, typename Refractions>
|
||||
inline SPROUT_CONSTEXPR typename sprout::darkroom::tracers::calculate_result<Tracer, Renderer, Camera, Objects, Lights, Unit2D>::type
|
||||
calculate(
|
||||
Tracer const& tracer,
|
||||
Renderer const& renderer, Camera const& camera, Objects const& objs, Lights const& lights,
|
||||
Unit2D const& x, Unit2D const& y, Unit2D const& width, Unit2D const& height,
|
||||
std::size_t depth_max, Refractions const& refracs
|
||||
)
|
||||
{
|
||||
return tracer(renderer, camera, objs, lights, x, y, width, height, depth_max, refracs);
|
||||
}
|
||||
template<typename Tracer, typename Renderer, typename Camera, typename Objects, typename Lights, typename Unit2D>
|
||||
inline SPROUT_CONSTEXPR typename sprout::darkroom::tracers::calculate_result<Tracer, Renderer, Camera, Objects, Lights, Unit2D>::type
|
||||
calculate(
|
||||
Tracer const& tracer,
|
||||
Renderer const& renderer, Camera const& camera, Objects const& objs, Lights const& lights,
|
||||
Unit2D const& x, Unit2D const& y, Unit2D const& width, Unit2D const& height,
|
||||
std::size_t depth_max = 8
|
||||
std::size_t depth_max = sprout::darkroom::renderers::default_depth
|
||||
)
|
||||
{
|
||||
return tracer(renderer, camera, objs, lights, x, y, width, height, depth_max);
|
||||
|
|
|
@ -25,11 +25,25 @@ namespace sprout {
|
|||
public:
|
||||
typedef Color color_type;
|
||||
public:
|
||||
template<typename Renderer, typename Camera, typename Objects, typename Lights, typename Unit2D, typename Refractions>
|
||||
SPROUT_CONSTEXPR color_type operator()(
|
||||
Renderer const& renderer, Camera const& camera, Objects const& objs, Lights const& lights,
|
||||
Unit2D const& x, Unit2D const& y, Unit2D const& width, Unit2D const& height,
|
||||
std::size_t depth_max, Refractions const& refracs
|
||||
) const
|
||||
{
|
||||
return sprout::darkroom::renderers::calculate<color_type>(
|
||||
renderer,
|
||||
camera, objs, lights,
|
||||
sprout::darkroom::cameras::calculate(camera, x, y, width, height),
|
||||
depth_max, refracs
|
||||
);
|
||||
}
|
||||
template<typename Renderer, typename Camera, typename Objects, typename Lights, typename Unit2D>
|
||||
SPROUT_CONSTEXPR color_type operator()(
|
||||
Renderer const& renderer, Camera const& camera, Objects const& objs, Lights const& lights,
|
||||
Unit2D const& x, Unit2D const& y, Unit2D const& width, Unit2D const& height,
|
||||
std::size_t depth_max = 8
|
||||
std::size_t depth_max = sprout::darkroom::renderers::default_depth
|
||||
) const
|
||||
{
|
||||
return sprout::darkroom::renderers::calculate<color_type>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue