From 42894c5721a1027b13bc1301e83fb95fc843f5d3 Mon Sep 17 00:00:00 2001 From: Adrian Meredith Date: Thu, 12 Sep 2024 15:52:50 +0100 Subject: [PATCH] outline QOL improvements --- src/extras/gizmo/transform-gizmo.js | 2 +- src/extras/renderers/outline-renderer.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/extras/gizmo/transform-gizmo.js b/src/extras/gizmo/transform-gizmo.js index eb4a39f5b2e..f6a443821dd 100644 --- a/src/extras/gizmo/transform-gizmo.js +++ b/src/extras/gizmo/transform-gizmo.js @@ -694,7 +694,7 @@ class TransformGizmo extends Gizmo { tmpV2.copy(tmpV1).mulScalar(-1); rot.transformVector(tmpV1, tmpV1); rot.transformVector(tmpV2, tmpV2); - this._app.drawLine(tmpV1.add(pos), tmpV2.add(pos), this._guideColors[axis], true); + this._app.drawLine(tmpV1.add(pos), tmpV2.add(pos), this._guideColors[axis], true, this._layer); } /** diff --git a/src/extras/renderers/outline-renderer.js b/src/extras/renderers/outline-renderer.js index 1550124597e..a01efec2f15 100644 --- a/src/extras/renderers/outline-renderer.js +++ b/src/extras/renderers/outline-renderer.js @@ -16,6 +16,8 @@ import { StandardMaterial } from '../../scene/materials/standard-material.js'; import { shaderChunks } from '../../scene/shader-lib/chunks/chunks.js'; import { createShaderFromCode } from '../../scene/shader-lib/utils.js'; +const THICKNESS = 3.25; + /** * @import { AppBase } from '../../framework/app-base.js' * @import { Layer } from "../../scene/layer.js" @@ -262,7 +264,7 @@ class OutlineRenderer { // horizontal extend pass // magnopus patched - make it thicc - _tempFloatArray[0] = 1.5 / width / 2.0; + _tempFloatArray[0] = THICKNESS / width / 2.0; _tempFloatArray[1] = 0; uOffset.setValue(_tempFloatArray); uColorBuffer.setValue(rt.colorBuffer); @@ -272,7 +274,7 @@ class OutlineRenderer { // vertical extend pass _tempFloatArray[0] = 0; // magnopus patched - make it thicc - _tempFloatArray[1] = 1.5 / height / 2.0; + _tempFloatArray[1] = THICKNESS / height / 2.0; uOffset.setValue(_tempFloatArray); uColorBuffer.setValue(tempRt.colorBuffer); uSrcMultiplier.setValue(1.0); @@ -297,6 +299,8 @@ class OutlineRenderer { return new RenderTarget({ colorBuffer: texture, depth: depth, + // magnopus patched - antialias + samples: 4, flipY: this.app.graphicsDevice.isWebGPU }); }