Radium Engine  1.5.20
Loading...
Searching...
No Matches
VolumetricMaterial.hpp
1#pragma once
2#include <Engine/RaEngine.hpp>
3
4#include <map>
5#include <string>
6
7#include <Core/Utils/Color.hpp>
8#include <Engine/Data/Material.hpp>
9#include <Engine/Data/Texture.hpp>
10
11namespace Ra {
12namespace Engine {
13namespace Data {
14
15class ShaderProgram;
16
24class RA_ENGINE_API VolumetricMaterial final : public Material, public ParameterSetEditingInterface
25{
26
27 public:
32 explicit VolumetricMaterial( const std::string& name );
38 ~VolumetricMaterial() override;
39
40 void updateGL() override;
41 void updateFromParameters() override;
42 bool isTransparent() const override;
43
49 inline void setTexture( Texture* texture );
50
56 inline Texture* getTexture() const;
57
63 static void registerMaterial();
64
69 static void unregisterMaterial();
70
76 inline nlohmann::json getParametersMetadata() const override;
77
78 public:
80 Core::Utils::Color m_sigma_a { 0.0011_ra, 0.0024_ra, 0.014_ra };
82 Core::Utils::Color m_sigma_s { 2.55_ra, 3.21_ra, 3.77_ra };
84 Scalar m_g { 0_ra };
86 Scalar m_scale { 1_ra };
89 Scalar m_stepsize { -1_ra };
92 Core::Transform m_modelToMedium { Core::Transform::Identity() };
93
94 private:
95 // The density matrix
97 Texture* m_texture;
98
102 void updateRenderingParameters();
103
105 static nlohmann::json s_parametersMetadata;
106};
107
108// Add a texture as material parameter from an already existing Radium Texture
110 m_texture = texture;
111}
112
114 return m_texture;
115}
116
117inline nlohmann::json VolumetricMaterial::getParametersMetadata() const {
118 return s_parametersMetadata;
119}
120
121} // namespace Data
122} // namespace Engine
123} // namespace Ra
Base class for materials.
Definition Material.hpp:24
Interface to define metadata (constraints, description, ...) for the editing of parameter set.
Represent a Texture of the engine.
Definition Texture.hpp:120
nlohmann::json getParametersMetadata() const override
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:3