Radium Engine
1.5.0
|
#include <Engine/Data/VolumetricMaterial.hpp>
Public Member Functions | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW | VolumetricMaterial (const std::string &name) |
~VolumetricMaterial () override | |
void | updateGL () override |
Update the OpenGL states used by the ShaderParameterProvider. These state could be the ones from an associated material (textures, precomputed tables or whatever data associated to the material) or some parameters that are specific to the provider semantic. | |
void | updateFromParameters () override |
Update the attributes of the ShaderParameterProvider to their actual values stored in the renderParameters. | |
bool | isTransparent () const override |
void | setTexture (Texture *texture) |
Texture * | getTexture () const |
nlohmann::json | getParametersMetadata () const override |
Public Member Functions inherited from Ra::Engine::Data::Material | |
const std::string & | getInstanceName () const |
const std::string & | getMaterialName () const |
void | setMaterialAspect (const MaterialAspect &aspect) |
const MaterialAspect & | getMaterialAspect () const |
std::list< std::string > | getPropertyList () const override |
virtual void | setColoredByVertexAttrib (bool) |
Makes the Material take its base color from the VERTEX_COLOR attribute of the rendered geometry. More... | |
virtual bool | isColoredByVertexAttrib () const |
Indicates if the material takes the VERTEX_COLOR attribute into account. | |
void | needUpdate () |
Public Member Functions inherited from Ra::Engine::Data::ShaderParameterProvider | |
virtual RenderParameters & | getParameters () |
virtual const RenderParameters & | getParameters () const |
Static Public Member Functions | |
static void | registerMaterial () |
static void | unregisterMaterial () |
Static Public Member Functions inherited from Ra::Engine::Data::ParameterSetEditingInterface | |
static void | loadMetaData (const std::string &basename, nlohmann::json &destination) |
Load the ParameterSet description. | |
Public Attributes | |
Core::Utils::Color | m_sigma_a { 0.0011_ra, 0.0024_ra, 0.014_ra } |
Absorption coefficient, default to Air (0.0011, 0.0024, 0.014) | |
Core::Utils::Color | m_sigma_s { 2.55_ra, 3.21_ra, 3.77_ra } |
Scattering coefficient, default to Air (2.55, 3.21, 3.77) | |
Scalar | m_g { 0_ra } |
phase function assymetry factor, default to 0 | |
Scalar | m_scale { 1_ra } |
Scale factor applied to the absorption and scattering coefficients. | |
Scalar | m_stepsize { -1_ra } |
Core::Transform | m_modelToMedium { Core::Transform::Identity() } |
Additional Inherited Members | |
Public Types inherited from Ra::Engine::Data::Material | |
enum class | MaterialAspect { MAT_OPAQUE , MAT_TRANSPARENT , MAT_DENSITY } |
Protected Member Functions inherited from Ra::Engine::Data::Material | |
Material (const std::string &instanceName, const std::string &materialName, MaterialAspect aspect=MaterialAspect::MAT_OPAQUE) | |
void | setMaterialName (std::string newName) |
Protected Attributes inherited from Ra::Engine::Data::Material | |
std::string | m_instanceName {} |
Material instance name. | |
MaterialAspect | m_aspect { MaterialAspect::MAT_OPAQUE } |
Material aspect. | |
bool | m_isDirty { true } |
Implementation of a simple Volumetric Material. Based on a 3D texture defining the density distribution in the volume, perform ray-marching and absorption based rendering of the volume..
Definition at line 24 of file VolumetricMaterial.hpp.
|
explicit |
Construct a named VolumetricMaterial
name | The name of the material |
Definition at line 20 of file VolumetricMaterial.cpp.
|
override |
Destructor.
Definition at line 23 of file VolumetricMaterial.cpp.
|
inlineoverridevirtual |
Get a json containing metadata about the parameters of the material.
Implements Ra::Engine::Data::ParameterSetEditingInterface.
Definition at line 117 of file VolumetricMaterial.hpp.
|
inline |
Get the texture associated to the given semantic.
semantic |
Definition at line 113 of file VolumetricMaterial.hpp.
|
overridevirtual |
Test if material is transperent.
Reimplemented from Ra::Engine::Data::Material.
Definition at line 58 of file VolumetricMaterial.cpp.
|
static |
Register the material in the material library. After registration, the material could be instantiated by any Radium system, renderer, plugin, ...
Definition at line 62 of file VolumetricMaterial.cpp.
|
inline |
Add an already existing texture to control the specified BSDF parameter.
semantic | The texture semantic |
texture | The texture to use |
Definition at line 109 of file VolumetricMaterial.hpp.
|
static |
Remove the material from the material library. After removal, the material is no more available, ...
Definition at line 120 of file VolumetricMaterial.cpp.
Core::Transform Ra::Engine::Data::VolumetricMaterial::m_modelToMedium { Core::Transform::Identity() } |
Transformation matrix to go from the associated geometry frame to the canonical [0, 1]^3 density domain
Definition at line 93 of file VolumetricMaterial.hpp.
Scalar Ra::Engine::Data::VolumetricMaterial::m_stepsize { -1_ra } |
Step size for ray-marching rendering. If negative whane rendering, interpreted as 1/textureDim.
Definition at line 90 of file VolumetricMaterial.hpp.