Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'renderer' into renderer2, based on latest master
# Conflicts: # radiantcore/brush/Face.cpp # radiantcore/brush/Face.h # radiantcore/entity/doom3group/Doom3Group.cpp # radiantcore/entity/doom3group/Doom3Group.h # radiantcore/entity/doom3group/Doom3GroupNode.cpp # radiantcore/patch/Patch.h # test/Entity.cpp
- Loading branch information
Showing
127 changed files
with
3,620 additions
and
794 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#pragma once | ||
|
||
#include <vector> | ||
#include <limits> | ||
#include <cstdint> | ||
#include "render/ArbitraryMeshVertex.h" | ||
|
||
namespace render | ||
{ | ||
|
||
enum class SurfaceIndexingType | ||
{ | ||
Triangles, | ||
Quads, | ||
}; | ||
|
||
/** | ||
* A surface renderer accepts a variable number of indexed surfaces and arranges | ||
* them into one or more continuous blocks of vertices for efficient rendering. | ||
* | ||
* The internal arrangement has the goal of reducing the amount of draw calls for | ||
* suraces sharing a single material. Allocating a surface slot yields a handle which | ||
* allows for later update or deallocation of the slot. | ||
*/ | ||
class ISurfaceRenderer | ||
{ | ||
public: | ||
virtual ~ISurfaceRenderer() {} | ||
|
||
using Slot = std::uint64_t; | ||
static constexpr Slot InvalidSlot = std::numeric_limits<Slot>::max(); | ||
|
||
// Allocate a slot to hold the given surface data of the given size | ||
// Returns the handle which can be used to update or deallocate the data later | ||
// The indexType determines the primitive GLenum that is chosen to render this surface | ||
virtual Slot addSurface(SurfaceIndexingType indexType, | ||
const std::vector<ArbitraryMeshVertex>& vertices, | ||
const std::vector<unsigned int>& indices) = 0; | ||
|
||
// Releases a previously allocated slot. This invalidates the handle. | ||
virtual void removeSurface(Slot slot) = 0; | ||
|
||
// Sets the surface data | ||
virtual void updateSurface(Slot slot, const std::vector<ArbitraryMeshVertex>& vertices, | ||
const std::vector<unsigned int>& indices) = 0; | ||
|
||
// Submits the geometry of a single surface slot to GL | ||
virtual void renderSurface(Slot slot) = 0; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#pragma once | ||
|
||
#include <vector> | ||
#include <limits> | ||
#include <cstdint> | ||
#include "render/ArbitraryMeshVertex.h" | ||
|
||
namespace render | ||
{ | ||
|
||
/** | ||
* A winding renderer accepts a variable number of windings and arranges them into | ||
* one or more continuous blocks of vertices for efficient rendering. | ||
* | ||
* The internal arrangement has the goal of reducing the amount of draw calls for | ||
* winding sharing a single material. Allocating a winding slot yields a handle which | ||
* allows for later update or deallocation of the slot. | ||
* | ||
* Only the vertex data (XYZ, UV, Normals, Colour) needs to be submitted, | ||
* the render indices of each winding slot are handled internally. | ||
*/ | ||
class IWindingRenderer | ||
{ | ||
public: | ||
virtual ~IWindingRenderer() {} | ||
|
||
using Slot = std::uint64_t; | ||
static constexpr Slot InvalidSlot = std::numeric_limits<Slot>::max(); | ||
|
||
// Allocate a slot to hold the vertex data of a winding of the given size | ||
// Returns the handle which can be used to update or deallocate the data later | ||
virtual Slot addWinding(const std::vector<ArbitraryMeshVertex>& vertices) = 0; | ||
|
||
// Releases a previously allocated winding slot. This invalidates the handle. | ||
virtual void removeWinding(Slot slot) = 0; | ||
|
||
// Sets the winding data | ||
virtual void updateWinding(Slot slot, const std::vector<ArbitraryMeshVertex>& vertices) = 0; | ||
|
||
// Mode used to specify how to render a single winding | ||
enum class RenderMode | ||
{ | ||
Triangles, | ||
Polygon, | ||
}; | ||
|
||
// Submits a single winding to GL | ||
virtual void renderWinding(RenderMode mode, Slot slot) = 0; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.