Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5893: Move all renderer algorithm from OpenGLRenderSystem to separat…
…e SceneRenderer implementations, one for Lighting Mode, one for FullBright Mode.
- Loading branch information
1 parent
2441085
commit b4e641e
Showing
20 changed files
with
529 additions
and
315 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#pragma once | ||
|
||
#include "irenderview.h" | ||
#include "NopVolumeTest.h" | ||
#include "math/Frustum.h" | ||
#include "math/Viewer.h" | ||
|
||
namespace render | ||
{ | ||
|
||
class NopRenderView : | ||
public IRenderView | ||
{ | ||
private: | ||
NopVolumeTest _volumeTest; | ||
Frustum _frustum; | ||
Viewer _viewer; | ||
|
||
public: | ||
bool TestPoint(const Vector3& point) const { return _volumeTest.TestPoint(point); } | ||
bool TestLine(const Segment& segment) const { return _volumeTest.TestLine(segment); } | ||
bool TestPlane(const Plane3& plane) const { return _volumeTest.TestPlane(plane); } | ||
bool TestPlane(const Plane3& plane, const Matrix4& localToWorld) const { return _volumeTest.TestPlane(plane, localToWorld); } | ||
|
||
VolumeIntersectionValue TestAABB(const AABB& aabb) const | ||
{ | ||
return _volumeTest.TestAABB(aabb); | ||
} | ||
|
||
VolumeIntersectionValue TestAABB(const AABB& aabb, const Matrix4& localToWorld) const | ||
{ | ||
return _volumeTest.TestAABB(aabb, localToWorld); | ||
} | ||
|
||
bool fill() const { return _volumeTest.fill(); } | ||
|
||
const Matrix4& GetViewProjection() const { return _volumeTest.GetViewProjection(); } | ||
const Matrix4& GetViewport() const { return _volumeTest.GetViewport(); } | ||
const Matrix4& GetProjection() const { return _volumeTest.GetProjection(); } | ||
const Matrix4& GetModelview() const { return _volumeTest.GetModelview(); } | ||
|
||
void construct(const Matrix4& projection, const Matrix4& modelview, std::size_t width, std::size_t height) override | ||
{ | ||
_volumeTest.setProjection(projection); | ||
_volumeTest.setModelView(modelview); | ||
|
||
_frustum = Frustum::createFromViewproj(_volumeTest.GetViewProjection()); | ||
_viewer = Viewer::createFromViewProjection(_volumeTest.GetViewProjection()); | ||
} | ||
|
||
Vector3 getViewer() const override | ||
{ | ||
return _viewer.getVector3(); | ||
} | ||
|
||
const Frustum& getFrustum() const override | ||
{ | ||
return _frustum; | ||
} | ||
|
||
std::string getCullStats() const override | ||
{ | ||
return {}; | ||
} | ||
}; | ||
|
||
} |
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
Oops, something went wrong.