Rewritted rendersystem
Former-commit-id: 9cbc601413e057047b94b8b872ee2316a86638c4
This commit is contained in:
86
include/Nazara/Graphics/ForwardRenderQueue.hpp
Normal file
86
include/Nazara/Graphics/ForwardRenderQueue.hpp
Normal file
@@ -0,0 +1,86 @@
|
||||
// Copyright (C) 2013 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Graphics module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_FORWARDRENDERQUEUE_HPP
|
||||
#define NAZARA_FORWARDRENDERQUEUE_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Graphics/AbstractRenderQueue.hpp>
|
||||
#include <Nazara/Math/Matrix4.hpp>
|
||||
#include <map>
|
||||
|
||||
class NzCamera;
|
||||
class NzMaterial;
|
||||
class NzSkeletalMesh;
|
||||
class NzStaticMesh;
|
||||
|
||||
class NAZARA_API NzForwardRenderQueue : public NzAbstractRenderQueue
|
||||
{
|
||||
friend class NzForwardRenderTechnique;
|
||||
|
||||
public:
|
||||
NzForwardRenderQueue() = default;
|
||||
~NzForwardRenderQueue() = default;
|
||||
|
||||
void AddDrawable(const NzDrawable* drawable);
|
||||
void AddLight(const NzLight* light);
|
||||
void AddModel(const NzModel* model);
|
||||
|
||||
void Clear();
|
||||
|
||||
void Sort(const NzCamera& camera);
|
||||
|
||||
private:
|
||||
struct MaterialComparator
|
||||
{
|
||||
bool operator()(const NzMaterial* mat1, const NzMaterial* mat2);
|
||||
};
|
||||
|
||||
struct SkeletalData
|
||||
{
|
||||
///TODO
|
||||
NzMatrix4f transformMatrix;
|
||||
};
|
||||
|
||||
struct SkeletalMeshComparator
|
||||
{
|
||||
bool operator()(const NzSkeletalMesh* subMesh1, const NzSkeletalMesh* subMesh2);
|
||||
};
|
||||
|
||||
struct StaticMeshComparator
|
||||
{
|
||||
bool operator()(const NzStaticMesh* subMesh1, const NzStaticMesh* subMesh2);
|
||||
};
|
||||
|
||||
struct TransparentModel
|
||||
{
|
||||
NzMatrix4f transformMatrix;
|
||||
NzMaterial* material;
|
||||
};
|
||||
|
||||
struct TransparentSkeletalModel : public TransparentModel
|
||||
{
|
||||
///TODO
|
||||
};
|
||||
|
||||
struct TransparentStaticModel : public TransparentModel
|
||||
{
|
||||
NzStaticMesh* mesh;
|
||||
};
|
||||
|
||||
typedef std::map<NzSkeletalMesh*, std::vector<SkeletalData>, SkeletalMeshComparator> SkeletalMeshContainer;
|
||||
typedef std::map<NzStaticMesh*, std::vector<NzMatrix4f>, StaticMeshComparator> StaticMeshContainer;
|
||||
|
||||
std::map<NzMaterial*, std::pair<SkeletalMeshContainer, StaticMeshContainer>, MaterialComparator> visibleModels;
|
||||
std::vector<std::pair<unsigned int, bool>> visibleTransparentsModels;
|
||||
std::vector<TransparentSkeletalModel> transparentSkeletalModels;
|
||||
std::vector<TransparentStaticModel> transparentStaticModels;
|
||||
std::vector<const NzDrawable*> otherDrawables;
|
||||
std::vector<const NzLight*> directionnalLights;
|
||||
std::vector<const NzLight*> visibleLights;
|
||||
};
|
||||
|
||||
#endif // NAZARA_FORWARDRENDERQUEUE_HPP
|
||||
Reference in New Issue
Block a user