Added ShaderManager (Experimental)
Former-commit-id: 327e373f2b932e31184e88c5f29bd5bd8fa3ba46
This commit is contained in:
@@ -16,7 +16,6 @@ class NAZARA_API NzColorBackground : public NzAbstractBackground
|
||||
{
|
||||
public:
|
||||
NzColorBackground(const NzColor& color = NzColor::Black);
|
||||
~NzColorBackground();
|
||||
|
||||
void Draw(const NzScene* scene) const;
|
||||
|
||||
@@ -27,7 +26,7 @@ class NAZARA_API NzColorBackground : public NzAbstractBackground
|
||||
|
||||
private:
|
||||
NzColor m_color;
|
||||
NzShaderRef m_shader;
|
||||
NzShaderConstRef m_shader;
|
||||
};
|
||||
|
||||
#endif // NAZARA_COLORBACKGROUND_HPP
|
||||
|
||||
@@ -39,7 +39,7 @@ class NAZARA_API NzForwardRenderQueue : public NzAbstractRenderQueue, NzResource
|
||||
private:
|
||||
void OnResourceDestroy(const NzResource* resource, int index);
|
||||
|
||||
struct MaterialComparator
|
||||
struct ModelMaterialComparator
|
||||
{
|
||||
bool operator()(const NzMaterial* mat1, const NzMaterial* mat2);
|
||||
};
|
||||
@@ -55,6 +55,12 @@ class NAZARA_API NzForwardRenderQueue : public NzAbstractRenderQueue, NzResource
|
||||
bool operator()(const NzSkeletalMesh* subMesh1, const NzSkeletalMesh* subMesh2);
|
||||
};
|
||||
|
||||
struct StaticData
|
||||
{
|
||||
NzBoxf aabb;
|
||||
NzMatrix4f transformMatrix;
|
||||
};
|
||||
|
||||
struct StaticMeshComparator
|
||||
{
|
||||
bool operator()(const NzStaticMesh* subMesh1, const NzStaticMesh* subMesh2);
|
||||
@@ -78,8 +84,8 @@ class NAZARA_API NzForwardRenderQueue : public NzAbstractRenderQueue, NzResource
|
||||
};
|
||||
|
||||
typedef std::map<const NzSkeletalMesh*, std::vector<SkeletalData>, SkeletalMeshComparator> SkeletalMeshContainer;
|
||||
typedef std::map<const NzStaticMesh*, std::vector<NzMatrix4f>, StaticMeshComparator> StaticMeshContainer;
|
||||
typedef std::map<const NzMaterial*, std::pair<SkeletalMeshContainer, StaticMeshContainer>, MaterialComparator> MeshContainer;
|
||||
typedef std::map<const NzStaticMesh*, std::vector<StaticData>, StaticMeshComparator> StaticMeshContainer;
|
||||
typedef std::map<const NzMaterial*, std::pair<SkeletalMeshContainer, StaticMeshContainer>, ModelMaterialComparator> MeshContainer;
|
||||
|
||||
MeshContainer opaqueModels;
|
||||
std::vector<std::pair<unsigned int, bool>> transparentsModels;
|
||||
|
||||
@@ -23,7 +23,7 @@ class NAZARA_API NzLight : public NzSceneNode
|
||||
|
||||
void AddToRenderQueue(NzAbstractRenderQueue* renderQueue) const override;
|
||||
|
||||
void Apply(const NzShader* shader, unsigned int lightUnit) const;
|
||||
void Enable(const NzShader* shader, unsigned int lightUnit) const;
|
||||
|
||||
NzColor GetAmbientColor() const;
|
||||
float GetAttenuation() const;
|
||||
@@ -46,6 +46,8 @@ class NAZARA_API NzLight : public NzSceneNode
|
||||
|
||||
NzLight& operator=(const NzLight& light);
|
||||
|
||||
static void Disable(const NzShader* shader, unsigned int lightUnit);
|
||||
|
||||
private:
|
||||
void Invalidate();
|
||||
void Register();
|
||||
|
||||
@@ -17,7 +17,6 @@ class NAZARA_API NzTextureBackground : public NzAbstractBackground
|
||||
public:
|
||||
NzTextureBackground();
|
||||
NzTextureBackground(NzTexture* texture);
|
||||
~NzTextureBackground();
|
||||
|
||||
void Draw(const NzScene* scene) const;
|
||||
|
||||
@@ -27,7 +26,7 @@ class NAZARA_API NzTextureBackground : public NzAbstractBackground
|
||||
void SetTexture(NzTexture* texture);
|
||||
|
||||
private:
|
||||
NzShaderRef m_shader;
|
||||
NzShaderConstRef m_shader;
|
||||
NzTextureRef m_texture;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user