All GPU backends now support NanoVDB, using our own kernel side code that is easily portable. This simplifies kernel and device code. Volume bounds are now built from the NanoVDB grid instead of OpenVDB, to avoid having to keep around the OpenVDB grid after loading. While this reduces memory usage, it does have a performance impact, particularly for the Cubic filter. That will be addressed by another commit. Pull Request: https://projects.blender.org/blender/blender/pulls/132908
30 lines
560 B
C++
30 lines
560 B
C++
/* SPDX-FileCopyrightText: 2020-2022 Blender Foundation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0 */
|
|
|
|
#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, step_size)
|
|
NODE_SOCKET_API(bool, object_space)
|
|
NODE_SOCKET_API(float, velocity_scale)
|
|
|
|
/* Merge attributes for efficiency, call right after creating them. */
|
|
void merge_grids(const Scene *scene);
|
|
|
|
void clear(bool preserve_shaders = false) override;
|
|
};
|
|
|
|
CCL_NAMESPACE_END
|