MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / get_color

Method get_color

examples/pde/bhrt.cpp:831–844  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

829 }
830
831 af::array get_color(const af::array& ray_begin,
832 const af::array& ray_end) const override {
833 auto pair = intersect(ray_begin, ray_end);
834 af::array hit = pair.first;
835 af::array pos = pair.second;
836
837 auto val = 1.f - (norm3(pos - center).T() - inner_radius) /
838 (outter_radius - inner_radius);
839
840 af::array color =
841 disk_color.T() * 1.5f * (val * val * (val * -2.f + 3.f)).as(f32);
842
843 return af::select(af::tile(hit, af::dim4(1, 3)), color, 0.f);
844 }
845};
846/**
847 * @brief Background struct

Callers

nothing calls this directly

Calls 6

norm3Function · 0.85
TMethod · 0.80
asMethod · 0.80
selectFunction · 0.50
tileFunction · 0.50
dim4Class · 0.50

Tested by

no test coverage detected