2890c11cd7
This adds support for rendering motion blur for volumes, using their velocity field. This works for fluid simulations and imported VDB volumes. For the latter, the name of the velocity field can be set per volume object, with automatic detection of velocity fields that are split into 3 scalar grids. A new parameter is also added to scale velocity for more artistic control. Like for Alembic and USD caches, a parameter to set the unit of time in which the velocity vectors are expressed is also added. For Blender gas simulations, the velocity unit should always be in seconds, so this is only exposed for volume objects which may come from external OpenVDB files. These parameters are available under the `Render` panels for the fluid domain and the volume object data properties respectively. Credits: kernel advection code from Tangent Animation's Blackbird based on earlier work by Geraldine Chua Differential Revision: https://developer.blender.org/D14629
27 lines
472 B
C++
27 lines
472 B
C++
/* SPDX-License-Identifier: Apache-2.0
|
|
* Copyright 2020-2022 Blender Foundation */
|
|
|
|
#pragma once
|
|
|
|
#include "graph/node.h"
|
|
|
|
#include "scene/mesh.h"
|
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
class Volume : public Mesh {
|
|
public:
|
|
NODE_DECLARE
|
|
|
|
Volume();
|
|
|
|
NODE_SOCKET_API(float, clipping)
|
|
NODE_SOCKET_API(float, step_size)
|
|
NODE_SOCKET_API(bool, object_space)
|
|
NODE_SOCKET_API(float, velocity_scale)
|
|
|
|
virtual void clear(bool preserve_shaders = false) override;
|
|
};
|
|
|
|
CCL_NAMESPACE_END
|