Ocular Engine
|
Public Member Functions | |
virtual void | bind () |
virtual void | unbind () |
virtual void | unload () override |
virtual void | onLoad (Core::BuilderNode const *node) override |
virtual void | onSave (Core::BuilderNode *node) const override |
virtual bool | setTexture (uint32_t index, std::string const &name, Texture *texture) |
Texture * | getTexture (uint32_t index) const |
virtual void | removeTexture (uint32_t index) |
uint32_t | getNumTextures () const |
std::vector< TextureSamplerInfo > const * | getTextures () const |
bool | setVertexShader (std::string const &name) |
void | setVertexShader (VertexShader *shader) |
bool | setGeometryShader (std::string const &name) |
void | setGeometryShader (GeometryShader *shader) |
bool | setFragmentShader (std::string const &name) |
void | setFragmentShader (FragmentShader *shader) |
bool | setPreTessellationShader (std::string const &name) |
void | setPreTessellationShader (PreTessellationShader *shader) |
bool | setPostTessellationShader (std::string const &name) |
void | setPostTessellationShader (PostTessellationShader *shader) |
VertexShader * | getVertexShader () const |
GeometryShader * | getGeometryShader () const |
FragmentShader * | getFragmentShader () const |
PreTessellationShader * | getPreTessellationShader () const |
PostTessellationShader * | getPostTessellationShader () const |
virtual void | setUniform (std::string const &name, uint32_t registerIndex, float value) |
virtual bool | getUniform (std::string const &name, float &value) |
virtual void | setUniform (std::string const &name, uint32_t registerIndex, Math::Vector4f const &value, std::string const &type=Utils::TypeName< Math::Vector4f >::name) |
virtual bool | getUniform (std::string const &name, Math::Vector4f &value) |
virtual void | setUniform (std::string const &name, uint32_t registerIndex, Math::Matrix3x3 const &value) |
virtual bool | getUniform (std::string const &name, Math::Matrix3x3 &value) |
virtual void | setUniform (std::string const &name, uint32_t registerIndex, Math::Matrix4x4 const &value) |
virtual bool | getUniform (std::string const &name, Math::Matrix4x4 &value) |
UniformBuffer const * | getUniformBuffer () const |
void | setPrimitiveStyle (PrimitiveStyle style) |
PrimitiveStyle | getPrimitiveStyle () const |
void | setFillMode (FillMode mode) |
FillMode | getFillMode () const |
void | setRenderPriority (uint32_t priority) |
uint32_t | getRenderPriority () const |
Public Member Functions inherited from Ocular::Core::Resource | |
Resource (File const &source) | |
virtual void | forceLoad () |
File | getSourceFile () const |
void | setSourceFile (File const &file) |
void | setIsInMemory (bool inMemory) |
bool | isInMemory () const |
void | setSize (uint64_t size) |
uint64_t | getSize () const |
ResourceType | getResourceType () const |
void | setName (std::string const &name) |
std::string const & | getName () const |
std::string const & | getMappingName () const |
void | setMappingName (std::string const &name) |
ResourceMetadata * | getMetadata () const |
void | setMetadata (ResourceMetadata *metadata) |
Public Member Functions inherited from Ocular::Core::Exposable | |
void | getAllExposedNames (std::vector< std::string > &names) const |
bool | getVariable (std::string const &name, ExposedVariable &var) |
template<typename T > | |
bool | getVariableValue (std::string const &name, T &var) |
template<typename T > | |
bool | setVariableValue (std::string const &name, T const &value) |
virtual void | onVariableModified (std::string const &varName) |
Protected Member Functions | |
void | setDefaults () |
void | bindShaders () |
void | unbindShaders () |
void | bindStateChanges () |
void | unbindStateChanges () |
Protected Member Functions inherited from Ocular::Core::Exposable | |
void | exposeVariable (std::string const &name, std::string const &type, bool isPointer, bool isExposed, void *data) |
Protected Attributes | |
VertexShader * | m_VertexShader |
GeometryShader * | m_GeometryShader |
FragmentShader * | m_FragmentShader |
PreTessellationShader * | m_PreTessellationShader |
PostTessellationShader * | m_PostTessellationShader |
RasterState | m_StoredRasterState |
std::vector< TextureSamplerInfo > | m_Textures |
UniformBuffer * | m_UniformBuffer |
uint32_t | m_RenderPriority |
Protected Attributes inherited from Ocular::Core::Resource | |
ResourceType | m_Type |
ResourceMetadata * | m_Metadata |
File | m_SourceFile |
bool | m_IsInMemory |
uint64_t | m_SizeInMemory |
std::string | m_Name |
std::string | m_MappingName |
Protected Attributes inherited from Ocular::Core::Exposable | |
std::unordered_map< std::string, ExposedVariable > | m_ExposedVariables |
FillMode Ocular::Graphics::Material::getFillMode | ( | ) | const |
FragmentShader * Ocular::Graphics::Material::getFragmentShader | ( | ) | const |
GeometryShader * Ocular::Graphics::Material::getGeometryShader | ( | ) | const |
uint32_t Ocular::Graphics::Material::getNumTextures | ( | ) | const |
PostTessellationShader * Ocular::Graphics::Material::getPostTessellationShader | ( | ) | const |
PreTessellationShader * Ocular::Graphics::Material::getPreTessellationShader | ( | ) | const |
PrimitiveStyle Ocular::Graphics::Material::getPrimitiveStyle | ( | ) | const |
uint32_t Ocular::Graphics::Material::getRenderPriority | ( | ) | const |
Texture * Ocular::Graphics::Material::getTexture | ( | uint32_t | index | ) | const |
Retrieves the texture stored at the specified identifier.
[in] | index | Index of the texture to retrieve. |
std::vector< TextureSamplerInfo > const * Ocular::Graphics::Material::getTextures | ( | ) | const |
|
virtual |
Returns the value of the associated uniform.
[in] | name | Valid uniform name. |
[out] | value | Value of the specified uniform. |
|
virtual |
Returns the value of the associated uniform.
[in] | name | Valid uniform name. |
[out] | value | Value of the specified uniform. |
|
virtual |
Returns the value of the associated uniform.
[in] | name | Valid uniform name. |
[out] | value | Value of the specified uniform. |
|
virtual |
Returns the value of the associated uniform.
[in] | name | Valid uniform name. |
[out] | value | Value of the specified uniform. |
UniformBuffer const * Ocular::Graphics::Material::getUniformBuffer | ( | ) | const |
VertexShader * Ocular::Graphics::Material::getVertexShader | ( | ) | const |
|
overridevirtual |
Alternate creation method (opposed to the constructor) in which one is provided with a BuilderNode chain. This chain may be explored to retrieve any relevant variables, and their values, that may have been stored in it.
This method will typically mirror the onSave, in which relevant values are stored within the chain.
[in] | node | Node to extract variable information from |
Reimplemented from Ocular::Core::ObjectIO.
Reimplemented in Ocular::Graphics::MaterialEmpty, and Ocular::Graphics::MaterialMissing.
|
overridevirtual |
Method used to add an object's data to an existing node chain in preparation for being save to a file.
[in] | node | Node to place variable information in |
Reimplemented from Ocular::Core::ObjectIO.
Reimplemented in Ocular::Graphics::MaterialEmpty, and Ocular::Graphics::MaterialMissing.
|
virtual |
Removes the texture at the specified index from this material.
[in] | index |
Reimplemented in Ocular::Graphics::D3D11Material.
void Ocular::Graphics::Material::setFillMode | ( | FillMode | mode | ) |
Sets the fill mode that the material should render as.
[in] | fill |
bool Ocular::Graphics::Material::setFragmentShader | ( | std::string const & | name | ) |
Sets the fragment shader used by this Material.
[in] | name | Name of the shader to use. |
void Ocular::Graphics::Material::setFragmentShader | ( | FragmentShader * | shader | ) |
Sets the fragment shader used by this Material.
[in] | shader | Pointer to the shared fragment shader to use. |
bool Ocular::Graphics::Material::setGeometryShader | ( | std::string const & | name | ) |
Sets the geometry shader used by this Material.
[in] | name | Name of the shader to use. |
void Ocular::Graphics::Material::setGeometryShader | ( | GeometryShader * | shader | ) |
Sets the geometry shader used by this Material.
[in] | shader | Pointer to the shared geometry shader to use. |
bool Ocular::Graphics::Material::setPostTessellationShader | ( | std::string const & | name | ) |
Sets the post-tessellation shader used by this Material.
[in] | name | Name of the shader to use. |
void Ocular::Graphics::Material::setPostTessellationShader | ( | PostTessellationShader * | shader | ) |
Sets the post-tessellation shader used by this Material.
[in] | shader | Pointer to the shared post-tessellation shader to use. |
bool Ocular::Graphics::Material::setPreTessellationShader | ( | std::string const & | name | ) |
Sets the pre-tessellation shader used by this Material.
[in] | name | Name of the shader to use. |
void Ocular::Graphics::Material::setPreTessellationShader | ( | PreTessellationShader * | shader | ) |
Sets the pre-tessellation shader used by this Material.
[in] | shader | Pointer to the shared pre-tessellation shader to use. |
void Ocular::Graphics::Material::setPrimitiveStyle | ( | PrimitiveStyle | style | ) |
Sets the primitive style that the material should render as.
[in] | style |
void Ocular::Graphics::Material::setRenderPriority | ( | uint32_t | priority | ) |
Sets the priority of the material in the render queue.
See Graphics::RenderPriority for pre-set priority values.
[in] | priority |
|
virtual |
Assigns a texture to a specific input register for use by the shaders that are part of this material. All textures are automatically bound to all relevant (non-NULL) shader stages.
Depending on the underlying graphics API, and shader implementation language, some may make use of the index or the name or both.
Note that some texture assignment indices and names are reserved by the engine. See ----— for a list of all reserved locations.
[in] | index | The index to bind the texture to. This can be on the range of 0 to (GraphicsDriver::getMaxBoundTextures - 1). Note that indices do not have to be sequential. For example, you may have use 0, 1, 3, 79. |
[in] | name | The name to bind the texture to. |
[in] | texture | The texture to bind. |
Reimplemented in Ocular::Graphics::D3D11Material.
|
virtual |
Sets the value of the specified uniform.
[in] | name | Valid uniform name. |
[in] | registerIndex | First register that the uniform occupies. Each register is 16 bytes, and a single uniform may occupy multiple registers at once. |
[in] | value | Single floating-point value for the uniform. |
|
virtual |
Sets the value of the specified uniform.
[in] | name | Valid uniform name. |
[in] | registerIndex | First register that the uniform occupies. Each register is 16 bytes, and a single uniform may occupy multiple registers at once. |
[in] | value | A 4-component Vector value for the uniform. |
[in] | type | Uniform type. Used to differentiate between Vector4f and Color uniforms. |
|
virtual |
Sets the value of the specified uniform.
[in] | name | Valid uniform name. |
[in] | registerIndex | First register that the uniform occupies. Each register is 16 bytes, and a single uniform may occupy multiple registers at once. |
[in] | value | A 3x3 matrix value for the uniform. |
|
virtual |
Sets the value of the specified uniform.
[in] | name | Valid uniform name. |
[in] | registerIndex | First register that the uniform occupies. Each register is 16 bytes, and a single uniform may occupy multiple registers at once. |
[in] | value | A 4x4 matrix value for the uniform. |
bool Ocular::Graphics::Material::setVertexShader | ( | std::string const & | name | ) |
Sets the vertex shader used by this Material.
[in] | name | Name of the shader to use. |
void Ocular::Graphics::Material::setVertexShader | ( | VertexShader * | shader | ) |
Sets the vertex shader used by this Material.
[in] | shader | Pointer to the shared vertex shader to use. |
|
overridevirtual |
Frees all memory used by this Resource.
Reimplemented from Ocular::Core::Resource.
Reimplemented in Ocular::Graphics::MaterialEmpty, and Ocular::Graphics::MaterialMissing.