diff --git a/libraries/gpu/src/gpu/DrawViewportQuadTransformTexcoord.slv b/libraries/gpu/src/gpu/DrawViewportQuadTransformTexcoord.slv index 7fd6e816b3..e91b8a7644 100755 --- a/libraries/gpu/src/gpu/DrawViewportQuadTransformTexcoord.slv +++ b/libraries/gpu/src/gpu/DrawViewportQuadTransformTexcoord.slv @@ -12,27 +12,27 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -<@include gpu/Transform.slh@> - +<@include gpu/Transform.slh@> + <$declareStandardTransform()$> varying vec2 varTexcoord; void main(void) { - const vec4 UNIT_QUAD[4] = vec4[4]( - vec4(-1.0, -1.0, 0.0, 1.0), - vec4(1.0, -1.0, 0.0, 1.0), - vec4(-1.0, 1.0, 0.0, 1.0), + const vec4 UNIT_QUAD[4] = vec4[4]( + vec4(-1.0, -1.0, 0.0, 1.0), + vec4(1.0, -1.0, 0.0, 1.0), + vec4(-1.0, 1.0, 0.0, 1.0), vec4(1.0, 1.0, 0.0, 1.0) ); vec4 pos = UNIT_QUAD[gl_VertexID]; - - // standard transform but applied to the Texcoord - vec4 tc = vec4((pos.xy + 1) * 0.5, pos.zw); - - TransformObject obj = getTransformObject(); - <$transformModelToWorldPos(obj, tc, tc)$> - - gl_Position = pos; - varTexcoord = tc.xy; + + // standard transform but applied to the Texcoord + vec4 tc = vec4((pos.xy + 1) * 0.5, pos.zw); + + TransformObject obj = getTransformObject(); + <$transformModelToWorldPos(obj, tc, tc)$> + + gl_Position = pos; + varTexcoord = tc.xy; } diff --git a/libraries/gpu/src/gpu/Transform.slh b/libraries/gpu/src/gpu/Transform.slh index fad2e9ada8..1802f585cd 100644 --- a/libraries/gpu/src/gpu/Transform.slh +++ b/libraries/gpu/src/gpu/Transform.slh @@ -129,7 +129,7 @@ uniform mat4 transformCamera_viewInverse; <$worldPos$> = (<$objectTransform$>._model * <$modelPos$>); } <@else@> - <$worldPos$> = vec3(transformObject_model * <$modelPos$>); + <$worldPos$> = (transformObject_model * <$modelPos$>); <@endif@> <@endfunc@> diff --git a/libraries/render-utils/src/DeferredLightingEffect.cpp b/libraries/render-utils/src/DeferredLightingEffect.cpp index afcc116aea..b742cd8ffe 100644 --- a/libraries/render-utils/src/DeferredLightingEffect.cpp +++ b/libraries/render-utils/src/DeferredLightingEffect.cpp @@ -644,12 +644,12 @@ void DeferredLightingEffect::render(RenderArgs* args) { model.postRotate(spotRotation); model.postTranslate(glm::vec3(0.0f, 0.0f, -light->getMaximumRadius() * (1.0f + SCALE_EXPANSION * 0.5f))); - float base = expandedRadius * glm::tan(light->getSpotAngle()); + float base = expandedRadius * glm::tan(light->getSpotAngle()); float height = expandedRadius; model.postScale(glm::vec3(base, base, height)); batch.setModelTransform(model); - auto& mesh = getSpotLightMesh(); + auto mesh = getSpotLightMesh(); batch.setIndexBuffer(mesh->getIndexBuffer()); @@ -935,11 +935,11 @@ void DeferredLightingEffect::setGlobalSkybox(const model::SkyboxPointer& skybox) } model::MeshPointer DeferredLightingEffect::getSpotLightMesh() { - if (!_spotLightMesh) { - _spotLightMesh.reset(new model::Mesh()); - - int slices = 32; - int stacks = 1; + if (!_spotLightMesh) { + _spotLightMesh.reset(new model::Mesh()); + + int slices = 32; + int stacks = 1; int vertices = (stacks + 2) * slices; int baseTriangles = slices - 2; int indices = 6 * slices * stacks + 3 * baseTriangles;