Simplification, window fix.

This commit is contained in:
Andrzej Kapolka 2014-11-17 18:44:38 -08:00
parent ba50beab91
commit a3e65fc231
2 changed files with 2 additions and 5 deletions

View file

@ -2036,12 +2036,9 @@ void HeightfieldRenderer::render(bool cursor) {
glColor4f(1.0f, 1.0f, 1.0f, 1.0f); glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
DefaultMetavoxelRendererImplementation::getBaseHeightfieldProgram().bind(); DefaultMetavoxelRendererImplementation::getBaseHeightfieldProgram().bind();
float sDistance = 2.0f / (innerWidth - 1);
float tDistance = 2.0f / (innerHeight - 1);
float distanceProduct = -sDistance * tDistance;
DefaultMetavoxelRendererImplementation::getBaseHeightfieldProgram().setUniformValue( DefaultMetavoxelRendererImplementation::getBaseHeightfieldProgram().setUniformValue(
DefaultMetavoxelRendererImplementation::getBaseHeightScaleLocation(), 1.0f / width, 1.0f / height, DefaultMetavoxelRendererImplementation::getBaseHeightScaleLocation(), 1.0f / width, 1.0f / height,
sDistance / distanceProduct, tDistance / distanceProduct); (innerWidth - 1) / -2.0f, (innerHeight - 1) / -2.0f);
DefaultMetavoxelRendererImplementation::getBaseHeightfieldProgram().setUniformValue( DefaultMetavoxelRendererImplementation::getBaseHeightfieldProgram().setUniformValue(
DefaultMetavoxelRendererImplementation::getBaseColorScaleLocation(), (float)width / innerWidth, DefaultMetavoxelRendererImplementation::getBaseColorScaleLocation(), (float)width / innerWidth,
(float)height / innerHeight); (float)height / innerHeight);

View file

@ -48,7 +48,7 @@ enum GridPlane {
const glm::vec2 INVALID_VECTOR(FLT_MAX, FLT_MAX); const glm::vec2 INVALID_VECTOR(FLT_MAX, FLT_MAX);
MetavoxelEditor::MetavoxelEditor() : MetavoxelEditor::MetavoxelEditor() :
QWidget(Application::getInstance()->getGLWidget(), Qt::Tool) { QWidget(Application::getInstance()->getWindow(), Qt::Tool) {
setWindowTitle("Metavoxel Editor"); setWindowTitle("Metavoxel Editor");
setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_DeleteOnClose);