Render agnostic material.
More...
#include <OxygenEngine/scene/material.h>
|
|
void | setTexture (const std::string &name, render::Texture *texture) |
| |
| uint32_t | getNextAvailableTextureLayer (const uint32_t start=0) const |
| | Get an available texture layer for this material.
|
| |
| template<typename T > |
| Material * | setProperty (const std::string &name, const T &value)=delete |
| | Get all material textures.
|
| |
| template<typename T > |
| Material * | setArray (const std::string &name, const std::vector< T > &value)=delete |
| | Set a array of properties on a material.
|
| |
|
template<> |
| Material * | setProperty (const std::string &name, const size_t &value) |
| |
|
template<> |
| Material * | setProperty (const std::string &name, const bool &value) |
| |
|
template<> |
| Material * | setArray (const std::string &name, const std::vector< bool > &values) |
| |
|
|
std::vector< TextureProperty > | textures |
| |
|
TextureCoordinatesTransform | texture_coordinates_0 |
| | First texture coordinates transformation set.
|
| |
|
TextureCoordinatesTransform | texture_coordinates_1 |
| | Second texture coordinates transformation set.
|
| |
| uint32_t | flags = 0 |
| | General purpose user flags, may be used for collisions / sounds / etc...
|
| |
|
oe::render::ShaderBase * | shader = nullptr |
| | Shader to use to render this material.
|
| |
|
bool | double_sided = false |
| | Draws two sides of faces.
|
| |
|
bool | invert_faces = false |
| | If not double sided, draws back faces instead of front ones.
|
| |
| bool | is_blend = false |
| | This material need blending (transparency, effects, ...)
|
| |
|
TransmissiveProperties | transmissive_properties |
| | Physically-based transmission properties.
|
| |
|
float | alpha_threshold = 0.5f |
| | Texture with alpha below this value will be considered completely transparent.
|
| |
|
Material * | parent = nullptr |
| | Material source where properties/textures should be inherited from.
|
| |
|
bool | inherit_properties = false |
| | Check if Material properties should be inherited from parent Material.
|
| |
|
bool | inherit_textures = false |
| | Check if Material textures should be inherited from parent Material.
|
| |
|
|
class | oe::render::ShaderBase |
| |
Render agnostic material.
- See also
- oe::render::ShaderBase::fillFromMaterial to understand which properties are automatically sent to shaders
◆ getNextAvailableTextureLayer()
| uint32_t oe::scene::Material::getNextAvailableTextureLayer |
( |
const uint32_t |
start = 0 | ) |
const |
Get an available texture layer for this material.
- Note
- Material being rendering agnostic, there is no limit on textures layers
- Parameters
-
| start | Do not search below this layer |
- Returns
- id of next available layer
- Exceptions
-
| runtime_error | If there are no more than INT_MAX layers |
◆ setArray()
template<typename T >
| Material * oe::scene::Material::setArray |
( |
const std::string & |
name, |
|
|
const std::vector< T > & |
value |
|
) |
| |
|
delete |
Set a array of properties on a material.
- Parameters
-
| name | array name |
| value | vector of property values |
◆ setProperty()
template<typename T >
| Material * oe::scene::Material::setProperty |
( |
const std::string & |
name, |
|
|
const T & |
value |
|
) |
| |
|
delete |
Get all material textures.
- Returns
- map where keys are textures names and values are std::pair<layer, std::shared_ptr<Texture>>
Set a property on a material
- Parameters
-
| name | property name |
| value | property value |
◆ flags
| uint32_t oe::scene::Material::flags = 0 |
General purpose user flags, may be used for collisions / sounds / etc...
- Note
- OxygenEngine won't touch those
◆ is_blend
| bool oe::scene::Material::is_blend = false |
This material need blending (transparency, effects, ...)
If blending is enabled, this material will only be drawn on Forward pass
The documentation for this class was generated from the following file: