载入中...
搜索中...
未找到
SurfaceDropletSimulation.cpp
浏览该文件的文档.
2#include <algorithm>
3#include <cmath>
4#include <glm/gtx/norm.hpp>
5#include <utility>
6#include "common/Exception.h"
11#include "graphics/Graphics.h"
12#include "graphics/Mesh.h"
13
14// SurfaceDropletSimulation.cpp
15namespace eve::fluids {
16
20
22 const float theta = glm::radians(std::clamp(params_.contactAngleDegrees, 5.f, 175.f));
23 const float cosine = std::cos(theta);
24 const float sine = std::max(1e-3f, std::sin(theta));
25 constexpr float pi = 3.14159265358979323846f;
26 const float factor = pi * (2.f - 3.f * cosine + cosine * cosine * cosine) / (3.f * sine * sine * sine);
27 return std::cbrt(std::max(0.f, volume) / std::max(1e-6f, factor));
28}
29
31 const glm::vec3& relativeVelocity) {
32 if (!binding_ || !binding_->isValid() || location.triangle >= uint32_t(binding_->triangleCount()) || volume <= 0.f)
33 return false;
35 droplet.id = nextDropletId_++;
36 droplet.location = location;
37 droplet.volume = volume;
38 const SurfaceSample sample = binding_->evaluate(location, 0.f);
39 droplet.relativeVelocity = relativeVelocity - sample.normal * glm::dot(relativeVelocity, sample.normal);
40 droplets_.push_back(droplet);
41 return true;
42}
43
45 detached_.clear();
46 if (!binding_ || !binding_->isValid() || dt <= 0.f || (droplets_.empty() && airborne_.empty())) return;
47 float remaining = dt;
48 while (remaining > 1e-7f) {
49 const float substep = std::min(remaining, 0.05f);
50 stepSubstep(substep, dt);
51 remaining -= substep;
52 }
53}
54
55void SurfaceDropletSimulation::stepSubstep(float dt, float poseDt) {
56 std::vector<SurfaceDroplet> attached;
57 attached.reserve(droplets_.size());
58 for (SurfaceDroplet droplet : droplets_) {
61 const SurfaceSample sample = binding_->evaluate(droplet.location, poseDt);
62 glm::vec3 surfaceAcceleration(0.f);
63 if (droplet.hasPreviousSurfaceVelocity)
64 surfaceAcceleration = (sample.velocity - droplet.previousSurfaceVelocity) / poseDt;
65
66 const glm::vec3 relativeAcceleration = params_.gravity - surfaceAcceleration;
67 const float outwardAcceleration = glm::dot(relativeAcceleration, sample.normal);
68 if (outwardAcceleration > std::max(0.f, params_.adhesionAcceleration)) {
69 detached_.push_back({sample.position, sample.velocity + droplet.relativeVelocity, droplet.volume});
70 airborne_.push_back({sample.position, sample.velocity + droplet.relativeVelocity, droplet.volume});
71 continue;
72 }
73
74 glm::vec3 tangentAcceleration =
75 relativeAcceleration - sample.normal * glm::dot(relativeAcceleration, sample.normal);
76 droplet.relativeVelocity += tangentAcceleration * dt;
77 droplet.relativeVelocity *= std::exp(-std::max(0.f, params_.friction) * dt);
78 const float speed2 = glm::length2(droplet.relativeVelocity);
79 const float maxSpeed = std::max(0.f, params_.maxSpeed);
80 if (maxSpeed > 0.f && speed2 > maxSpeed * maxSpeed) droplet.relativeVelocity *= maxSpeed / std::sqrt(speed2);
81
82 const SurfaceWalkResult walk = binding_->walkAcrossSurface(droplet.location, droplet.relativeVelocity * dt,
83 std::max(0, params_.maxCrossings));
84 if (!walk.valid) continue;
85 droplet.location = walk.location;
86 if (walk.reachedBoundary) {
87 const SurfaceSample edge = binding_->evaluate(walk.location, poseDt);
88 detached_.push_back({edge.position, edge.velocity + droplet.relativeVelocity, droplet.volume});
89 airborne_.push_back({edge.position, edge.velocity + droplet.relativeVelocity, droplet.volume, 0.f});
90 continue;
91 }
92
93 const SurfaceSample end = binding_->evaluate(droplet.location, poseDt);
94 droplet.relativeVelocity -= end.normal * glm::dot(droplet.relativeVelocity, end.normal);
95 droplet.previousSurfaceVelocity = end.velocity;
96 droplet.hasPreviousSurfaceVelocity = true;
97 if (wetness_) {
98 const float distance = glm::distance(previousSample.position, end.position);
99 wetness_->deposit(previousLocation, distance * params_.trailDeposition * droplet.volume);
100 wetness_->deposit(droplet.location, distance * params_.trailDeposition * droplet.volume);
101 }
102 attached.push_back(droplet);
103 }
104 droplets_.swap(attached);
105
106 // Merge overlapping spherical caps without depending on mesh UV seams.
107 for (size_t i = 0; i < droplets_.size(); ++i) {
108 const SurfaceSample a = binding_->evaluate(droplets_[i].location, poseDt);
109 for (size_t j = i + 1u; j < droplets_.size();) {
110 const SurfaceSample b = binding_->evaluate(droplets_[j].location, poseDt);
111 const float mergeDistance =
112 params_.mergeRadiusScale * (dropletRadius(droplets_[i].volume) + dropletRadius(droplets_[j].volume));
113 if (glm::distance2(a.position, b.position) > mergeDistance * mergeDistance) {
114 ++j;
115 continue;
116 }
117 const float combined = droplets_[i].volume + droplets_[j].volume;
118 droplets_[i].relativeVelocity = (droplets_[i].relativeVelocity * droplets_[i].volume +
119 droplets_[j].relativeVelocity * droplets_[j].volume) /
120 combined;
121 droplets_[i].volume = combined;
122 droplets_.erase(droplets_.begin() + std::ptrdiff_t(j));
123 }
124 }
125
126 std::vector<AirborneDroplet> flying;
127 flying.reserve(airborne_.size());
128 for (AirborneDroplet drop : airborne_) {
129 drop.age += dt;
130 drop.velocity += params_.gravity * dt;
131 drop.velocity *= std::exp(-std::max(0.f, params_.airDrag) * dt);
132 drop.position += drop.velocity * dt;
133 SurfaceLocation hit;
134 if (drop.age > 0.08f && binding_->project(drop.position, std::max(0.f, params_.reattachDistance), hit)) {
135 const SurfaceSample surface = binding_->evaluate(hit, poseDt);
136 if (glm::dot(drop.velocity - surface.velocity, surface.normal) <= 0.f) {
137 addDroplet(hit, drop.volume, drop.velocity - surface.velocity);
138 if (wetness_) wetness_->deposit(hit, drop.volume * 0.15f);
139 continue;
140 }
141 }
142 flying.push_back(drop);
143 }
144 airborne_.swap(flying);
145}
146
148 droplets_.clear();
149 detached_.clear();
150 airborne_.clear();
151 nextDropletId_ = 1;
152}
153
154} // namespace eve::fluids
155
156// SurfaceFluidContracts.cpp
157namespace eve::fluids {
158namespace {
159
161
163 const double seconds = step.delta.seconds();
164 if (!std::isfinite(seconds) || seconds < 0.0)
166 eve::DiagnosticCode::InvalidArgument, "Surface-fluid duration must be finite and non-negative", path));
167 if (!(step.tick > lastTick))
169 eve::DiagnosticCode::PreconditionViolation, "Surface-fluid simulation tick must increase strictly", path));
170 return applied();
171}
172
173eve::Result<void> validateDuration(eve::Duration duration, const char* path) {
174 const double seconds = duration.seconds();
175 if (!std::isfinite(seconds) || seconds < 0.0)
177 eve::DiagnosticCode::InvalidArgument, "Surface pose duration must be finite and non-negative", path));
178 return applied();
179}
180
181} // namespace
182
184 if (!solver_)
186 "Surface-fluid adapter has no live borrowed solver",
187 "fluids.surfaceSimulation.solver"));
188 auto valid = validateTick(stepValue, lastTick_, "fluids.surfaceSimulation.step");
189 if (!valid) return valid;
190 solver_->step(static_cast<float>(stepValue.delta.seconds()));
191 lastTick_ = stepValue.tick;
192 return applied();
193}
194
195int FluidSimulationAdapter::particleCount() const noexcept { return solver_ ? solver_->particleCount() : 0; }
196
197std::span<const FluidParticle> FluidSimulationAdapter::particles() const noexcept {
198 if (!solver_) return {};
199 const auto& values = solver_->particles();
200 const auto count = static_cast<std::size_t>(std::max(0, solver_->particleCount()));
201 return {values.data(), std::min(count, values.size())};
202}
203
205 const std::vector<std::uint32_t>& indices,
206 const std::vector<glm::vec2>& uvs) {
207 if (!binding_)
209 "Surface-fluid adapter has no live borrowed solver",
210 "fluids.surfaceConstraint.binding"));
211 if (!binding_->build(positions, indices, uvs))
213 eve::DiagnosticCode::InvalidArgument, "Surface constraint topology is not a valid triangle mesh",
214 "fluids.surfaceConstraint.topology"));
215 return applied();
216}
217
219 if (!binding_)
221 "Surface-fluid adapter has no live borrowed solver",
222 "fluids.surfaceConstraint.binding"));
223 binding_->setTransform(transform);
224 return applied();
225}
226
228 if (!binding_)
230 "Surface-fluid adapter has no live borrowed solver",
231 "fluids.surfaceConstraint.binding"));
232 if (!binding_->setDeformedPositions(worldPositions))
234 eve::DiagnosticCode::InvalidArgument, "Deformed surface vertex count does not match topology",
235 "fluids.surfaceConstraint.pose"));
236 return applied();
237}
238
239bool FluidSurfaceConstraintAdapter::isValid() const noexcept { return binding_ && binding_->isValid(); }
240
242 eve::Duration poseDelta) const {
243 auto validDuration = validateDuration(poseDelta, "fluids.surfaceConstraint.evaluate.dt");
245 if (!binding_ || !binding_->isValid())
247 eve::DiagnosticCode::PreconditionViolation, "Cannot evaluate an invalid surface constraint",
248 "fluids.surfaceConstraint.evaluate"));
249 if (location.triangle >= static_cast<std::uint32_t>(binding_->triangleCount()))
251 eve::DiagnosticCode::NotFound, "Surface location triangle is outside the bound topology",
252 "fluids.surfaceConstraint.evaluate.triangle"));
253 return eve::Result<SurfaceSample>::success(binding_->evaluate(location, static_cast<float>(poseDelta.seconds())));
254}
255
257 float maxDistance) const {
258 if (!binding_ || !binding_->isValid())
260 eve::DiagnosticCode::PreconditionViolation, "Cannot project against an invalid surface constraint",
261 "fluids.surfaceConstraint.project"));
262 SurfaceLocation location;
263 if (!binding_->project(worldPosition, maxDistance, location))
265 eve::DiagnosticCode::NotFound, "No surface location satisfies the projection distance",
266 "fluids.surfaceConstraint.project"));
268}
269
271 const glm::vec3& displacement,
272 int maxCrossings) const {
273 if (!binding_ || !binding_->isValid())
276 "Cannot walk an invalid surface constraint", "fluids.surfaceConstraint.walk"));
277 if (maxCrossings < 0)
279 eve::DiagnosticCode::InvalidArgument, "Surface traversal maxCrossings must be non-negative",
280 "fluids.surfaceConstraint.walk.maxCrossings"));
281 const auto result = binding_->walkAcrossSurface(start, displacement, maxCrossings);
282 if (!result.valid)
284 eve::DiagnosticCode::NotFound, "Surface traversal start is outside the bound topology",
285 "fluids.surfaceConstraint.walk.start"));
287}
288
290 bool preferGpu) {
291 if (params.width <= 0 || params.height <= 0) throw eve::Exception("Surface SSF output dimensions must be positive");
292 renderer_ = std::make_unique<FluidSurfaceRenderer>(params, preferGpu);
293}
294
296
298 float particleRadius) {
299 if (!renderer_)
301 "Surface-fluid adapter has no live borrowed solver",
302 "fluids.screenSpaceReconstruction.renderer"));
303 if (!std::isfinite(particleRadius) || particleRadius <= 0.f)
305 eve::DiagnosticCode::InvalidArgument, "Screen-space particle radius must be finite and positive",
306 "fluids.screenSpaceReconstruction.particleRadius"));
307 for (const glm::vec3& position : positions) {
308 if (!std::isfinite(position.x) || !std::isfinite(position.y) || !std::isfinite(position.z))
310 "Screen-space particle positions must be finite",
311 "fluids.screenSpaceReconstruction.positions"));
312 }
313 const std::vector<glm::vec3> ownedPositions(positions.begin(), positions.end());
314 renderer_->render(ownedPositions, particleRadius);
315 return applied();
316}
317
319 if (!renderer_)
321 "Surface-fluid adapter has no live borrowed solver",
322 "fluids.screenSpaceReconstruction.renderer"));
323 return renderer_->occludeWithSceneDepth(sceneDepth, depthBias);
324}
325
326int ScreenSpaceSurfaceReconstructionAdapter::width() const noexcept { return renderer_ ? renderer_->getWidth() : 0; }
327
328int ScreenSpaceSurfaceReconstructionAdapter::height() const noexcept { return renderer_ ? renderer_->getHeight() : 0; }
329
331 return renderer_ ? std::span<const float>(renderer_->depth()) : std::span<const float>{};
332}
333
335 return renderer_ ? std::span<const glm::vec3>(renderer_->normals()) : std::span<const glm::vec3>{};
336}
337
339 return renderer_ ? std::span<const float>(renderer_->thickness()) : std::span<const float>{};
340}
341
343 return renderer_ ? std::span<const std::uint8_t>(renderer_->color()) : std::span<const std::uint8_t>{};
344}
345
346bool ScreenSpaceSurfaceReconstructionAdapter::usingGpu() const noexcept { return renderer_ && renderer_->usingGpu(); }
347
348} // namespace eve::fluids
349
350// SurfaceFluidRenderData.cpp
351namespace eve::fluids {
352
355 droplets_.clear();
356 droplets_.reserve(simulation.droplets().size());
357 const float stretch = std::max(0.f, params.velocityStretch);
358 const float maximumAspect = std::max(1.f, params.maxAspectRatio);
359 const float theta = glm::radians(std::clamp(simulation.params().contactAngleDegrees, 5.f, 175.f));
360
361 for (const SurfaceDroplet& droplet : simulation.droplets()) {
362 const SurfaceSample surface = binding.evaluate(droplet.location, 0.f);
363 const float radius = simulation.dropletRadius(droplet.volume);
364 const float speed = glm::length(droplet.relativeVelocity);
365 const float aspect = std::clamp(1.f + speed * stretch, 1.f, maximumAspect);
366 const float axisScale = std::sqrt(aspect);
367
368 glm::vec3 direction = droplet.relativeVelocity;
369 direction -= surface.normal * glm::dot(direction, surface.normal);
370 if (glm::length2(direction) > 1e-12f)
371 direction = glm::normalize(direction);
372 else
373 direction = surface.tangent;
374 glm::vec3 across = glm::cross(surface.normal, direction);
375 if (glm::length2(across) > 1e-12f)
376 across = glm::normalize(across);
377 else
378 across = surface.bitangent;
379
381 instance.id = droplet.id;
382 instance.position = surface.position + surface.normal * std::max(0.f, params.surfaceOffset);
383 instance.normal = surface.normal;
384 instance.majorAxis = direction * (radius * axisScale);
385 instance.minorAxis = across * (radius / axisScale);
386 instance.velocity = surface.velocity + droplet.relativeVelocity;
387 instance.capHeight = radius * std::tan(theta * 0.5f);
388 instance.wetness = wetness ? std::clamp(wetness->sample(droplet.location), 0.f, 1.f) : 0.f;
389 droplets_.push_back(instance);
390 }
391}
392
396 sample.wetness = std::clamp(wetness, 0.f, 1.f);
397 const float response = sample.wetness * sample.wetness * (3.f - 2.f * sample.wetness);
398 sample.roughness = glm::mix(params.dryRoughness, params.wetRoughness, response);
399 sample.specular = glm::mix(params.drySpecular, params.wetSpecular, response);
400 sample.darkening = std::max(0.f, params.wetDarkening) * response;
401 sample.normalStrength = std::max(0.f, params.normalStrength) * response;
402 return sample;
403}
404
405} // namespace eve::fluids
406
407// SurfaceFluidSceneRenderer.cpp
408namespace eve::fluids {
409
411
413 glm::mat4 model(1.f);
414 model[0] = glm::vec4(instance.majorAxis, 0.f);
415 model[1] = glm::vec4(instance.normal * instance.capHeight, 0.f);
416 model[2] = glm::vec4(instance.minorAxis, 0.f);
417 model[3] = glm::vec4(instance.position + instance.normal * instance.capHeight, 1.f);
418 return model;
419}
420
422 drawCount_ = 0;
423 if (!graphics_) return;
424 if (!sphere_) sphere_ = graphics_->newMeshSphere(16, 8);
425 if (!sphere_) return;
426
427 for (const SurfaceDropletRenderInstance& instance : renderData.droplets()) {
429 SurfaceFluidRenderData::evaluateMaterial(std::max(0.35f, instance.wetness));
430 graphics_->setMesh3DMaterial(0.f, material.roughness);
431 graphics_->drawMesh(sphere_, modelMatrix(instance), nullptr, tint);
432 ++drawCount_;
433 }
434}
435
436} // namespace eve::fluids
Duration start
float duration
std::shared_ptr< AudioBinding > binding_
double volume
float wetness
bool applied
glm::vec4 tint
std::vector< std::uint32_t > indices
std::vector< float > positions
HexVec3 across
std::array< float, 3 > position
std::string response
Poco::JSON::Object::Ptr result
std::vector< RecipeParam > params
bool valid
MeleePoint3 b
Definition MeleeHit.cpp:41
double radius
Definition MeleeHit.cpp:42
MeleePoint3 a
Definition MeleeHit.cpp:40
float distance
glm::dvec3 displacement
double dt
eve::action::ActionVfxBinding binding
std::array< uint32_t, 16 > material
std::string path
Definition PlayHost.cpp:111
bool hit
std::set< std::string > values
glm::mat4 model
RoadLaneDirection direction
Graphics * graphics
size_t end
int count
Domain contracts separating surface simulation, constraints, and SSF presentation.
float step
Definition TreeMesh.cpp:451
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Signed, fixed-resolution simulation duration in nanoseconds.
Definition Time.h:43
EVENGINE_API_FOUNDATION public API.
Definition Exception.h:13
Move-only operation result carrying either a value or Status.
Definition Result.h:176
static Result success(T value)
Construct a successful result owning value.
Definition Result.h:185
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
static Status success(StatusCode code=StatusCode::Ok)
Construct a successful status with an explicit non-error outcome.
Definition Status.cpp:19
eve::Result< void > step(const eve::SimulationStep &step) override
Step.
std::span< const FluidParticle > particles() const noexcept override
Particles.
int particleCount() const noexcept override
Particle count.
int particleCount() const
Particle count.
const std::vector< FluidParticle > & particles() const
Particles.
void step(float dt)
Advance the simulation by dt seconds (params.iterations substeps).
Definition FluidSdf.cpp:321
Dynamic triangle surface used to bind films and droplets to deforming meshes.
bool build(const std::vector< glm::vec3 > &positions, const std::vector< uint32_t > &indices, const std::vector< glm::vec2 > &uvs={})
Build topology and initialize the current and previous poses.
Definition FluidSdf.cpp:604
void setTransform(const glm::mat4 &transform)
Apply a new rigid pose and preserve the old pose for velocity queries.
Definition FluidSdf.cpp:657
SurfaceSample evaluate(const SurfaceLocation &location, float dt) const
Evaluate a surface address in the current and previous poses.
Definition FluidSdf.cpp:718
bool isValid() const
True when valid.
Definition FluidSdf.cpp:673
bool setDeformedPositions(const std::vector< glm::vec3 > &worldPositions)
Supply a new deformed world-space pose and preserve the previous pose.
Definition FluidSdf.cpp:664
int triangleCount() const
Triangle count.
Definition FluidSdf.cpp:678
SurfaceWalkResult walkAcrossSurface(const SurfaceLocation &start, const glm::vec3 &worldDisplacement, int maxCrossings=16) const
Move a location by a world-space displacement, crossing triangle edges.
Definition FluidSdf.cpp:764
bool project(const glm::vec3 &worldPosition, float maxDistance, SurfaceLocation &outLocation) const
Find the closest material point on the current surface.
Definition FluidSdf.cpp:740
bool isValid() const noexcept override
True when valid.
eve::Result< SurfaceLocation > project(const glm::vec3 &worldPosition, float maxDistance) const override
Project.
eve::Result< void > setDeformedPositions(const std::vector< glm::vec3 > &worldPositions) override
Sets the deformed positions.
eve::Result< void > setTransform(const glm::mat4 &transform) override
Sets the transform.
eve::Result< void > build(const std::vector< glm::vec3 > &positions, const std::vector< std::uint32_t > &indices, const std::vector< glm::vec2 > &uvs={}) override
Builds .
eve::Result< SurfaceWalkResult > walk(const SurfaceLocation &start, const glm::vec3 &displacement, int maxCrossings=16) const override
Walk.
eve::Result< SurfaceSample > evaluate(const SurfaceLocation &location, eve::Duration poseDelta) const override
Evaluate.
std::span< const glm::vec3 > normals() const noexcept override
Normals.
std::span< const float > depth() const noexcept override
Depth.
eve::Result< void > reconstruct(std::span< const glm::vec3 > positions, float particleRadius) override
Reconstruct.
~ScreenSpaceSurfaceReconstructionAdapter() override
Releases ScreenSpaceSurfaceReconstructionAdapter resources.
std::span< const float > thickness() const noexcept override
Thickness.
std::span< const std::uint8_t > color() const noexcept override
Color.
eve::Result< void > occlude(std::span< const float > sceneDepth, float depthBias=0.001f) override
Occlude.
ScreenSpaceSurfaceReconstructionAdapter(const FluidSurfaceParams &params, bool preferGpu)
Constructs a ScreenSpaceSurfaceReconstructionAdapter.
CPU reference solver for droplets moving over static, rigid or deforming surfaces.
void step(float dt)
Advance all bound droplets and rebuild the detached event list.
void clear()
Remove attached droplets and pending detach events.
const std::vector< SurfaceDroplet > & droplets() const
Droplets.
bool addDroplet(const SurfaceLocation &location, float volume=1.f, const glm::vec3 &relativeVelocity=glm::vec3(0.f))
Add one bound droplet. Invalid locations are rejected.
float dropletRadius(float volume) const
Droplet radius.
SurfaceDropletSimulation(FluidSurfaceBinding *binding, const SurfaceDropletParams &params={}, SurfaceWetnessField *wetness=nullptr)
Surface droplet simulation.
Builds renderer-independent droplet instances and wet PBR parameters.
void update(const FluidSurfaceBinding &binding, const SurfaceDropletSimulation &simulation, const SurfaceWetnessField *wetness=nullptr, const SurfaceFluidRenderParams &params={})
Rebuild attached droplet instances from the latest simulation pose.
static WetSurfaceMaterialSample evaluateMaterial(float wetness, const WetSurfaceMaterialParams &params={})
Evaluate wet PBR values from a normalized wetness input.
SurfaceFluidSceneRenderer(graphics::Graphics *graphics)
Surface fluid scene renderer.
void draw(const SurfaceFluidRenderData &renderData, const glm::vec4 &tint=glm::vec4(0.72f, 0.88f, 0.96f, 0.78f))
Draw all attached droplet caps into an already-open 3D frame.
static glm::mat4 modelMatrix(const SurfaceDropletRenderInstance &instance)
Build a unit-sphere model matrix whose lower pole touches the surface.
Lightweight material-space wet-film field stored at mesh vertices.
void deposit(const SurfaceLocation &location, float amount)
Deposit a wet trace at a material-space location.
virtual void setMesh3DMaterial(float metallic, float roughness)=0
Metallic (0..1) and roughness (0..1) for the next default mesh draw.
virtual void drawMesh(Mesh *mesh, const glm::mat4 &model, Texture *texture, const Color &tint)=0
Draw one mesh with model matrix. Requires begin3DFrame() (or an open swapchain pass).
virtual Mesh * newMeshSphere(int slices=32, int stacks=16)=0
Procedural UV sphere (radius 1, Y-up). Owned by Graphics. slices = longitude divisions,...
GLSL compute kernels for the GPU surface-flow solver.
Definition FluidTarget.h:12
double sample(const Heightmap &map, double u, double v)
Sample.
One deterministic fixed-step emitted by SimulationClock.
Definition Time.h:158
Camera + reconstruction tuning for the SSF pipeline.
Material and integration parameters for surface-bound droplets.
float reattachDistance
Maximum distance at which an airborne droplet can reattach.
int maxCrossings
Maximum number of triangle edges crossed by one step.
float mergeRadiusScale
Multiplier for the sum of cap radii used by droplet merging.
float adhesionAcceleration
Maximum outward acceleration retained by adhesion.
float airDrag
Air drag applied after a droplet leaves the surface.
float trailDeposition
Wet-film amount deposited per world-space unit travelled.
float contactAngleDegrees
Water contact angle in degrees, used to derive a visible cap radius.
glm::vec3 gravity
World-space gravity in units per second squared.
float friction
Exponential damping of velocity relative to the surface.
float maxSpeed
Maximum relative droplet speed.
World-space oriented cap instance consumed by droplet instancing shaders.
One droplet addressed in material space on a dynamic triangle surface.
Tuning for converting simulated droplets into render instances.
Stable material-space address of a point on a triangle surface.
Evaluated world-space frame and motion at a surface location.
Material mapping from simulated wetness to a PBR surface response.
Evaluated material values suitable for a wet-surface shader.