47 std::shared_ptr<VKBuffer> grid_buf,
48 const glm::vec3& bounds_min,
49 const glm::vec3& bounds_max,
53 std::string shader =
"sdf_field_gyroid.comp.spv");
72 std::shared_ptr<VKBuffer> grid_buf,
74 const glm::vec3& bounds_min,
75 const glm::vec3& bounds_max,
83 void set_bounds(
const glm::vec3& bounds_min,
const glm::vec3& bounds_max);
91 [[nodiscard]]
float get_time()
const {
return m_pc.time; }
94 void set_param0(
float v) { m_pc._pad[0] = std::bit_cast<uint32_t>(v); }
95 void set_param1(
float v) { m_pc._pad[1] = std::bit_cast<uint32_t>(v); }
100 m_field_pc.params[0] = params.x;
101 m_field_pc.params[1] = params.y;
102 m_field_pc.params[2] = params.z;
103 m_field_pc.params[3] = params.w;
107 void on_attach(
const std::shared_ptr<Buffer>&
buffer)
override;
108 bool on_before_execute(
110 const std::shared_ptr<VKBuffer>&
buffer)
override;
122 static_assert(
sizeof(PC) % 16 == 0);
125 float bounds_min[3] {};
133 static_assert(
sizeof(FieldPC) == 56);
137 bool m_from_field {
false };