8 #include <nap/resourceptr.h>
9 #include <utility/dllexport.h>
10 #include <nap/resource.h>
13 #include "uniformcontainer.h"
14 #include "materialcommon.h"
21 class DescriptorSetCache;
46 std::vector<ResourcePtr<BufferBinding>>
mBuffers;
53 using UniformStructMap = std::unordered_map<std::string, std::unique_ptr<UniformStruct>>;
54 using UniformStructArrayMap = std::unordered_map<std::string, std::unique_ptr<UniformStructArray>>;
144 const VertexAttributeBinding* findVertexAttributeBinding(
const std::string& shaderAttributeID)
const;
149 static const std::vector<VertexAttributeBinding>& sGetDefaultVertexAttributeBindings();
const Shader & getShader() const
Definition: material.h:110
Definition: material.h:30
Definition: material.h:172
EBlendMode
Definition: materialcommon.h:18
void setDepthMode(EDepthMode depthMode)
Definition: material.h:138
Definition: objectptr.h:184
@ InheritFromBlendMode
Transparent objects do not write depth, but do read depth. Opaque objects read and write depth.
void setBlendMode(EBlendMode blendMode)
Definition: material.h:124
EDepthMode
Definition: materialcommon.h:40
ResourcePtr< ComputeShader > mShader
Property: 'Shader' The compute shader that this material is using.
Definition: material.h:194
ResourcePtr< Shader > mShader
Property: 'Shader' The shader that this material is using.
Definition: material.h:152
Definition: errorstate.h:19
@ NotSet
Default value for MaterialInstances, means that the Material's blend is used instead.
Definition: material.h:72
std::vector< VertexAttributeBinding > mVertexAttributeBindings
Property: 'VertexAttributeBindings' Optional, mapping from mesh vertex attr to shader vertex attr.
Definition: material.h:151
@ Opaque
Regular opaque, similar to (One, Zero) blend.
virtual ~BaseMaterial()=default
EDepthMode getDepthMode() const
Definition: material.h:131
std::string mMeshAttributeID
mesh vertex buffer name
Definition: material.h:95
@ NotSet
Default value for MaterialInstances, means that the Material's blend mode is used instead.
Definition: renderservice.h:268
std::vector< ResourcePtr< UniformStruct > > mUniforms
Property: 'Uniforms' Static uniforms (as read from file, or as set in code before calling init())
Definition: material.h:45
std::string mShaderAttributeID
shader vertex buffer name
Definition: material.h:96
std::vector< ResourcePtr< BufferBinding > > mBuffers
Property: 'Buffers' Static buffer bindings (as read from file, or as set in code before calling init(...
Definition: material.h:46
const ComputeShader & getShader() const
Definition: material.h:192
bool rebuild(const BaseShader &shader, utility::ErrorState &errorState)
Definition: resource.h:19
EBlendMode getBlendMode() const
Definition: material.h:117
std::vector< ResourcePtr< Sampler > > mSamplers
Property: 'Samplers' Static samplers (as read from file, or as set in code before calling init())
Definition: material.h:47
Definition: material.h:84
const BaseShader & getShader()
Definition: material.h:43