some things work, others dont
This commit is contained in:
@@ -9,6 +9,8 @@ QuadOutput quadMain(uint vertexIndex : SV_VertexID)
|
|||||||
{
|
{
|
||||||
QuadOutput result;
|
QuadOutput result;
|
||||||
result.uv = float2(vertexIndex & 2, (vertexIndex << 1) & 2);
|
result.uv = float2(vertexIndex & 2, (vertexIndex << 1) & 2);
|
||||||
result.position = float4(result.uv * 2.0f + -1.0f, 0.0f, 1.0f);
|
float2 ndc = result.uv * 2.0f + -1.0f;
|
||||||
|
ndc.y = -ndc.y; // Flip Y for flipped viewport
|
||||||
|
result.position = float4(ndc, 0.0f, 1.0f);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -76,8 +76,8 @@ void ShadowPass::beginFrame(const Component::Camera& camera, const Component::Tr
|
|||||||
float splitDist = cascadeSplits[i];
|
float splitDist = cascadeSplits[i];
|
||||||
|
|
||||||
Array<Vector> frustumCorners = {
|
Array<Vector> frustumCorners = {
|
||||||
Vector(-1.0f, 1.0f, 0.0f), Vector(1.0f, 1.0f, 0.0f), Vector(1.0f, -1.0f, 0.0f), Vector(-1.0f, -1.0f, 0.0f),
|
|
||||||
Vector(-1.0f, 1.0f, 1.0f), Vector(1.0f, 1.0f, 1.0f), Vector(1.0f, -1.0f, 1.0f), Vector(-1.0f, -1.0f, 1.0f),
|
Vector(-1.0f, 1.0f, 1.0f), Vector(1.0f, 1.0f, 1.0f), Vector(1.0f, -1.0f, 1.0f), Vector(-1.0f, -1.0f, 1.0f),
|
||||||
|
Vector(-1.0f, 1.0f, 0.0f), Vector(1.0f, 1.0f, 0.0f), Vector(1.0f, -1.0f, 0.0f), Vector(-1.0f, -1.0f, 0.0f),
|
||||||
};
|
};
|
||||||
|
|
||||||
for (auto& c : frustumCorners) {
|
for (auto& c : frustumCorners) {
|
||||||
|
|||||||
@@ -292,10 +292,10 @@ void Window::createSwapChain() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Viewport::Viewport(PWindow owner, const ViewportCreateInfo& viewportInfo) : Gfx::Viewport(owner, viewportInfo) {
|
Viewport::Viewport(PWindow owner, const ViewportCreateInfo& viewportInfo) : Gfx::Viewport(owner, viewportInfo) {
|
||||||
handle.width = static_cast<float>(sizeX);
|
|
||||||
handle.height = static_cast<float>(sizeY);
|
|
||||||
handle.x = static_cast<float>(offsetX);
|
handle.x = static_cast<float>(offsetX);
|
||||||
handle.y = static_cast<float>(offsetY);
|
handle.y = static_cast<float>(offsetY + sizeY);
|
||||||
|
handle.width = static_cast<float>(sizeX);
|
||||||
|
handle.height = -static_cast<float>(sizeY);
|
||||||
handle.minDepth = 1.f;
|
handle.minDepth = 1.f;
|
||||||
handle.maxDepth = 0.f;
|
handle.maxDepth = 0.f;
|
||||||
}
|
}
|
||||||
@@ -306,12 +306,12 @@ void Viewport::resize(uint32 newX, uint32 newY) {
|
|||||||
sizeX = newX;
|
sizeX = newX;
|
||||||
sizeY = newY;
|
sizeY = newY;
|
||||||
handle.width = static_cast<float>(sizeX);
|
handle.width = static_cast<float>(sizeX);
|
||||||
handle.height = static_cast<float>(sizeY);
|
handle.height = -static_cast<float>(sizeY);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Viewport::move(uint32 newOffsetX, uint32 newOffsetY) {
|
void Viewport::move(uint32 newOffsetX, uint32 newOffsetY) {
|
||||||
offsetX = newOffsetX;
|
offsetX = newOffsetX;
|
||||||
offsetY = newOffsetY;
|
offsetY = newOffsetY;
|
||||||
handle.x = static_cast<float>(offsetX);
|
handle.x = static_cast<float>(offsetX);
|
||||||
handle.y = static_cast<float>(offsetY);
|
handle.y = static_cast<float>(offsetY + sizeY);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ Matrix4 Seele::perspectiveProjection(float fov, float aspect, float nearPlane, f
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
0.0f,
|
0.0f,
|
||||||
-e,
|
e,
|
||||||
0.0f,
|
0.0f,
|
||||||
0.0f,
|
0.0f,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ void Transform::setScale(Vector s) { scale = Vector4(s, 0); }
|
|||||||
|
|
||||||
Vector Transform::getForward() const { return glm::normalize(Vector(0, 0, 1) * rotation); }
|
Vector Transform::getForward() const { return glm::normalize(Vector(0, 0, 1) * rotation); }
|
||||||
|
|
||||||
Vector Transform::getRight() const { return glm::normalize(Vector(-1, 0, 0) * rotation); }
|
Vector Transform::getRight() const { return glm::normalize(Vector(1, 0, 0) * rotation); }
|
||||||
|
|
||||||
Vector Transform::getUp() const { return glm::normalize(Vector(0, 1, 0) * rotation); }
|
Vector Transform::getUp() const { return glm::normalize(Vector(0, 1, 0) * rotation); }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user