Compare commits
2 Commits
main
...
8c0152c3b4
| Author | SHA256 | Date | |
|---|---|---|---|
| 8c0152c3b4 | |||
| 51a6ea1328 |
@@ -186,14 +186,36 @@ TSE::Matrix4x4 BuildView_Zplus_RH(const TSE::Matrix4x4& world)
|
|||||||
void TSE::Camera::PreDraw(IShader *shader)
|
void TSE::Camera::PreDraw(IShader *shader)
|
||||||
{
|
{
|
||||||
rt->Bind();
|
rt->Bind();
|
||||||
shader->SetUniform("prMatrix", projectionMatrix);
|
// shader->SetUniform("prMatrix", projectionMatrix);
|
||||||
|
|
||||||
auto worlmatrix = baseObject->GetGlobalMatrix();
|
// auto worlmatrix = baseObject->GetGlobalMatrix();
|
||||||
|
|
||||||
viewMatrix = BuildView_Zplus_RH(worlmatrix);
|
// viewMatrix = BuildView_Zplus_RH(worlmatrix);
|
||||||
|
|
||||||
shader->SetUniform("camMatrix", &viewMatrix);
|
// shader->SetUniform("camMatrix", &viewMatrix);
|
||||||
helper->OnRenderTargetChanged(lastRtSize.x, lastRtSize.y);
|
// helper->OnRenderTargetChanged(lastRtSize.x, lastRtSize.y);
|
||||||
|
|
||||||
|
Vector3 pos = baseObject->GetGlobalPosition();
|
||||||
|
Vector3 right = baseObject->LocalToGlobalPosition(Vector3::right) - pos;
|
||||||
|
Vector3 up = baseObject->LocalToGlobalPosition(Vector3::up) - pos;
|
||||||
|
Vector3 forward = baseObject->LocalToGlobalPosition(Vector3::forward) - pos;
|
||||||
|
forward.Normalize();
|
||||||
|
|
||||||
|
shader->SetUniform("CamPos", &pos);
|
||||||
|
shader->SetUniform("CamRight", &right);
|
||||||
|
shader->SetUniform("CamUp", &up);
|
||||||
|
shader->SetUniform("CamForward", &forward);
|
||||||
|
|
||||||
|
float x = lastRtSize.x / RenderScale;
|
||||||
|
float y = lastRtSize.y / RenderScale;
|
||||||
|
float mx = -x;
|
||||||
|
float my = -y;
|
||||||
|
shader->SetUniform("OrthoLeft", mx);
|
||||||
|
shader->SetUniform("OrthoRight", x);
|
||||||
|
shader->SetUniform("OrthoBottom", my);
|
||||||
|
shader->SetUniform("OrthoTop", y);
|
||||||
|
shader->SetUniform("NearPlane", nearClippingPlane);
|
||||||
|
shader->SetUniform("FarPlane", farClippingPlane);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TSE::Camera::PostDraw()
|
void TSE::Camera::PostDraw()
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ void TSE::OpenGL::TextureHelperOpenGL::Apply3D(VolumeTexture3D *tex)
|
|||||||
{
|
{
|
||||||
if(tex->bpp() == 32)
|
if(tex->bpp() == 32)
|
||||||
{
|
{
|
||||||
internal = GL_RGBA;
|
internal = GL_R16;
|
||||||
input = GL_BGRA;
|
input = GL_BGRA;
|
||||||
size = GL_UNSIGNED_BYTE;
|
size = GL_UNSIGNED_BYTE;
|
||||||
}
|
}
|
||||||
@@ -136,7 +136,7 @@ void TSE::OpenGL::TextureHelperOpenGL::Apply3D(VolumeTexture3D *tex)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
glGenerateMipmap(GL_TEXTURE_3D);
|
//glGenerateMipmap(GL_TEXTURE_3D);
|
||||||
|
|
||||||
glBindTexture(GL_TEXTURE_3D, 0);
|
glBindTexture(GL_TEXTURE_3D, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user