1
0
mirror of synced 2024-11-12 02:00:52 +01:00

fix: 3D Visualizer mirroring model

This commit is contained in:
WerWolv 2023-11-19 15:14:47 +01:00
parent 7b25d97ea2
commit 69bdebeb98
2 changed files with 2 additions and 6 deletions

View File

@ -31,6 +31,6 @@ mat4 viewMatrix(vec3 rotation) {
void main() {
mat4 view = viewMatrix(rotation);
normal = (vec4(in_Normal, 1.0) * view).xyz;
gl_Position = vec4((in_Position + translation) * scale, 1.0) * view;
normal = (vec4(in_Normal, 1.0) * view).xyz * -1;
gl_Position = vec4((in_Position + translation) * -scale, 1.0) * view;
}

View File

@ -296,7 +296,6 @@ namespace hex::plugin::builtin {
frameBuffer.bind();
glEnable(GL_DEPTH_TEST);
glEnable(GL_DEPTH_CLAMP);
shader.bind();
shader.setUniform("scale", scaling);
@ -308,9 +307,6 @@ namespace hex::plugin::builtin {
glViewport(0, 0, renderTexture.getWidth(), renderTexture.getHeight());
glClearColor(0.00F, 0.00F, 0.00F, 0.00f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum(-1.0F, 1.0F, -1.0F, 1.0F, 0.0000001F, 10000000.0F);
if (indices.empty())
vertexBuffer.draw();