Radium Engine
1.5.20
|
#include <Engine/Data/VolumetricMaterial.hpp>
Public Member Functions | |
VolumetricMaterial (const std::string &name) | |
~VolumetricMaterial () override | |
void | updateGL () override |
Update the OpenGL states used by the ShaderParameterProvider. | |
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 | |
virtual | ~Material ()=default |
const std::string & | getInstanceName () const |
const std::string & | getMaterialName () const |
void | setMaterialAspect (const MaterialAspect &aspect) |
const MaterialAspect & | getMaterialAspect () const |
Get the aspect (MAT_OPAQUE or MAT_TRANSPARENT) of the material. | |
std::list< std::string > | getPropertyList () const override |
Get the list of properties the material migh use in a shader. | |
virtual void | setColoredByVertexAttrib (bool state) |
Makes the Material take its base color from the VERTEX_COLOR attribute of the rendered geometry. | |
virtual bool | isColoredByVertexAttrib () const |
Indicates if the material takes the VERTEX_COLOR attribute into account. | |
void | needUpdate () |
Mark the Material as needing update before the next OpenGL call. | |
Public Member Functions inherited from Ra::Engine::Data::ShaderParameterProvider | |
virtual RenderParameters & | getParameters () |
virtual const RenderParameters & | getParameters () const |
Public Member Functions inherited from Ra::Engine::Data::ParameterSetEditingInterface |
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 } |
Identifies the type of the material. More... | |
Protected Member Functions inherited from Ra::Engine::Data::Material | |
Material (const std::string &instanceName, const std::string &materialName, MaterialAspect aspect=MaterialAspect::MAT_OPAQUE) | |
Creates a named material with the given aspect. | |
void | setMaterialName (std::string newName) |
Change the material name. | |
bool | isDirty () |
Return dirty state. | |
void | setDirty () |
Set dirty state to true. | |
void | setClean () |
Set dirty state to false. | |
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 |
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.
|
overridevirtual |
Update the attributes of the ShaderParameterProvider to their actual values stored in the renderParameters.
Reimplemented from Ra::Engine::Data::ShaderParameterProvider.
Definition at line 32 of file VolumetricMaterial.cpp.
|
overridevirtual |
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.
Implements Ra::Engine::Data::ShaderParameterProvider.
Definition at line 25 of file VolumetricMaterial.cpp.
Scalar Ra::Engine::Data::VolumetricMaterial::m_g { 0_ra } |
phase function assymetry factor, default to 0
Definition at line 84 of file VolumetricMaterial.hpp.
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 92 of file VolumetricMaterial.hpp.
Scalar Ra::Engine::Data::VolumetricMaterial::m_scale { 1_ra } |
Scale factor applied to the absorption and scattering coefficients.
Definition at line 86 of file VolumetricMaterial.hpp.
Core::Utils::Color Ra::Engine::Data::VolumetricMaterial::m_sigma_a { 0.0011_ra, 0.0024_ra, 0.014_ra } |
Absorption coefficient, default to Air (0.0011, 0.0024, 0.014)
Definition at line 80 of file VolumetricMaterial.hpp.
Core::Utils::Color Ra::Engine::Data::VolumetricMaterial::m_sigma_s { 2.55_ra, 3.21_ra, 3.77_ra } |
Scattering coefficient, default to Air (2.55, 3.21, 3.77)
Definition at line 82 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 89 of file VolumetricMaterial.hpp.