18 #ifndef __H__OCULAR_GRAPHICS_GRAPHICS_MATERIAL_H__
19 #define __H__OCULAR_GRAPHICS_GRAPHICS_MATERIAL_H__
21 #include "Graphics/Shader/Uniform/UniformBuffer.hpp"
22 #include "Graphics/RenderState/RasterState.hpp"
23 #include "Renderer/RenderPriority.hpp"
25 #include "Resources/Resource.hpp"
26 #include "ObjectIO/ObjectIO.hpp"
27 #include "Math/Matrix4x4.hpp"
29 #include <unordered_map>
49 class PreTessellationShader;
50 class PostTessellationShader;
55 std::string samplerName;
56 uint32_t samplerRegister;
70 virtual void unbind();
72 virtual void unload()
override;
104 virtual bool setTexture(uint32_t index, std::string
const& name,
Texture* texture);
127 std::vector<TextureSamplerInfo>
const*
getTextures()
const;
253 virtual void setUniform(std::string
const& name, uint32_t registerIndex,
float value);
264 virtual bool getUniform(std::string
const& name,
float& value);
387 static const std::string ShaderNodeName;
388 static const std::string TextureNodeName;
389 static const std::string UniformNodeName;
390 static const std::string RenderStateNodeName;
397 void unbindShaders();
399 void bindStateChanges();
400 void unbindStateChanges();
412 std::vector<TextureSamplerInfo> m_Textures;
415 uint32_t m_RenderPriority;
virtual void unload() override
Definition: Material.cpp:95
Definition: Matrix3x3.hpp:39
Definition: Material.hpp:52
virtual void removeTexture(uint32_t index)
Definition: Material.cpp:488
void setRenderPriority(uint32_t priority)
Definition: Material.cpp:897
Definition: FragmentShader.hpp:40
Definition: VertexShader.hpp:40
virtual void onLoad(Core::BuilderNode const *node) override
Definition: Material.cpp:100
FillMode getFillMode() const
Definition: Material.cpp:892
void setFillMode(FillMode mode)
Definition: Material.cpp:887
void setPrimitiveStyle(PrimitiveStyle style)
Definition: Material.cpp:877
std::vector< TextureSamplerInfo > const * getTextures() const
Definition: Material.cpp:511
VertexShader * getVertexShader() const
Definition: Material.cpp:680
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
Definition: PreTessellationShader.hpp:40
bool setPostTessellationShader(std::string const &name)
Definition: Material.cpp:648
virtual void onSave(Core::BuilderNode *node) const override
Definition: Material.cpp:320
Utility structure to convert a type T to a string representation.
Definition: Types.hpp:66
Definition: ObjectIO.hpp:38
Texture * getTexture(uint32_t index) const
Definition: Material.cpp:466
UniformBuffer const * getUniformBuffer() const
Definition: Material.cpp:868
bool setFragmentShader(std::string const &name)
Definition: Material.cpp:584
GeometryShader * getGeometryShader() const
Definition: Material.cpp:685
virtual bool setTexture(uint32_t index, std::string const &name, Texture *texture)
Definition: Material.cpp:427
uint32_t getNumTextures() const
Definition: Material.cpp:506
bool setGeometryShader(std::string const &name)
Definition: Material.cpp:552
A 3x3 column-major float matrix.
Definition: Matrix3x3.hpp:63
uint32_t getRenderPriority() const
Definition: Material.cpp:902
virtual void setUniform(std::string const &name, uint32_t registerIndex, float value)
Definition: Material.cpp:709
PrimitiveStyle getPrimitiveStyle() const
Definition: Material.cpp:882
Generic node system used for loading and saving SceneObjects and their components.
Definition: BuilderNode.hpp:51
PreTessellationShader * getPreTessellationShader() const
Definition: Material.cpp:695
Definition: RasterState.hpp:92
Definition: PostTessellationShader.hpp:40
A 4x4 column-major float matrix.
Definition: Matrix4x4.hpp:64
PostTessellationShader * getPostTessellationShader() const
Definition: Material.cpp:700
bool setPreTessellationShader(std::string const &name)
Definition: Material.cpp:616
virtual bool getUniform(std::string const &name, float &value)
Definition: Material.cpp:720
bool setVertexShader(std::string const &name)
Definition: Material.cpp:520
FragmentShader * getFragmentShader() const
Definition: Material.cpp:690
Definition: GeometryShader.hpp:40
Definition: Material.hpp:62
Definition: Resource.hpp:46
Base class for all texture objects.
Definition: Texture.hpp:45