Compare commits
1 Commits
DICOM_View
...
main
| Author | SHA256 | Date | |
|---|---|---|---|
| 4fce05a927 |
@@ -1,2 +1,5 @@
|
||||
# TSE
|
||||
|
||||
packages needed for building under linux:
|
||||
|
||||
build-essential llvm cmake ninja-build clang mesa-common-dev gdb
|
||||
@@ -186,36 +186,14 @@ TSE::Matrix4x4 BuildView_Zplus_RH(const TSE::Matrix4x4& world)
|
||||
void TSE::Camera::PreDraw(IShader *shader)
|
||||
{
|
||||
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);
|
||||
// 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);
|
||||
shader->SetUniform("camMatrix", &viewMatrix);
|
||||
helper->OnRenderTargetChanged(lastRtSize.x, lastRtSize.y);
|
||||
}
|
||||
|
||||
void TSE::Camera::PostDraw()
|
||||
|
||||
@@ -105,7 +105,7 @@ void TSE::OpenGL::TextureHelperOpenGL::Apply3D(VolumeTexture3D *tex)
|
||||
{
|
||||
if(tex->bpp() == 32)
|
||||
{
|
||||
internal = GL_R16;
|
||||
internal = GL_RGBA;
|
||||
input = GL_BGRA;
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user