some optimizations
This commit is contained in:
@@ -48,8 +48,9 @@ class McpipClip {
|
||||
packet2_t* staticPacket;
|
||||
u16 vu1DBufferSize;
|
||||
|
||||
std::vector<EEClipVertex> clippedTriangle;
|
||||
std::vector<EEClipVertex> inputTriangle;
|
||||
Vec4 inputVerts[3];
|
||||
EEClipVertexPtrs inputTriangle[3];
|
||||
EEClipVertex clippedTriangle[9];
|
||||
|
||||
Vec4 vertexBuffers[2][108];
|
||||
Vec4 texCoordBuffers[2][108];
|
||||
|
||||
@@ -18,7 +18,12 @@ namespace Tyra {
|
||||
|
||||
class PipelineOptions {
|
||||
public:
|
||||
PipelineOptions() { lighting = nullptr; }
|
||||
PipelineOptions() {
|
||||
lighting = nullptr;
|
||||
antiAliasingEnabled = false;
|
||||
blendingEnabled = true;
|
||||
shadingType = TyraShadingFlat;
|
||||
}
|
||||
~PipelineOptions() {}
|
||||
|
||||
PipelineFrustumCulling frustumCulling;
|
||||
|
||||
@@ -39,6 +39,10 @@ class StaPipClipper {
|
||||
EEClipAlgorithm algorithm;
|
||||
M4x4* mvp;
|
||||
|
||||
Vec4 inputVerts[3];
|
||||
EEClipVertexPtrs inputTriangle[3];
|
||||
EEClipVertex clippedTriangle[9];
|
||||
|
||||
void perspectiveDivide(std::vector<EEClipVertex>* vertices);
|
||||
void moveDataToBuffer(const std::vector<EEClipVertex>& vertices,
|
||||
StaPipQBuffer* buffer);
|
||||
|
||||
@@ -28,25 +28,25 @@ class EEClipAlgorithm {
|
||||
|
||||
void init(const RendererSettings& settings);
|
||||
|
||||
void clip(std::vector<EEClipVertex>* o_vertices,
|
||||
const std::vector<EEClipVertex>& vertices,
|
||||
const EEClipAlgorithmSettings& settings);
|
||||
u8 clip(EEClipVertex* o_vertices, EEClipVertexPtrs* i_vertices,
|
||||
const EEClipAlgorithmSettings& settings);
|
||||
|
||||
static float clipMargin;
|
||||
|
||||
private:
|
||||
float halfWidth, halfHeight, near, far;
|
||||
std::vector<EEClipVertex> tempVertices;
|
||||
EEClipVertex* tempVertices;
|
||||
|
||||
float getValueByPlane(const EEClipVertex& v, const int& plane);
|
||||
|
||||
bool isInside(const int& plane, const float& v, const float& w,
|
||||
const float& planeLimitValue);
|
||||
|
||||
void clipAgainstPlane(const std::vector<EEClipVertex>& original,
|
||||
std::vector<EEClipVertex>* clipped, const int& plane,
|
||||
const float& planeLimitValue,
|
||||
const EEClipAlgorithmSettings& settings);
|
||||
/** @return clipped size */
|
||||
u8 clipAgainstPlane(EEClipVertex* original, const u8& originalSize,
|
||||
EEClipVertex* clipped, const int& plane,
|
||||
const float& planeLimitValue,
|
||||
const EEClipAlgorithmSettings& settings);
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
|
||||
@@ -18,4 +18,8 @@ struct EEClipVertex {
|
||||
Vec4 position, normal, st, color;
|
||||
};
|
||||
|
||||
struct EEClipVertexPtrs {
|
||||
Vec4 *position, *normal, *st, *color;
|
||||
};
|
||||
|
||||
} // namespace Tyra
|
||||
|
||||
Reference in New Issue
Block a user