Skip to content

Commit

Permalink
outline QOL improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
MAG-AdrianMeredith committed Sep 12, 2024
1 parent 5c6c8c8 commit 42894c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/extras/gizmo/transform-gizmo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
8 changes: 6 additions & 2 deletions src/extras/renderers/outline-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -297,6 +299,8 @@ class OutlineRenderer {
return new RenderTarget({
colorBuffer: texture,
depth: depth,
// magnopus patched - antialias
samples: 4,
flipY: this.app.graphicsDevice.isWebGPU
});
}
Expand Down

0 comments on commit 42894c5

Please sign in to comment.