mirror of
https://github.com/TomHodson/tomhodson.github.com.git
synced 2025-06-26 10:01:18 +02:00
tweaks to outline viewer
This commit is contained in:
parent
0a37afee12
commit
b90ac49f24
@ -172,12 +172,6 @@ class CustomOutlinePass extends Pass {
|
||||
surfaceIdDiff += any(notEqual(surfaceValue, getSurfaceValue(0, e))) ? 1.0 : 0.0;
|
||||
surfaceIdDiff += any(notEqual(surfaceValue, getSurfaceValue(-e, 0))) ? 1.0 : 0.0;
|
||||
surfaceIdDiff += any(notEqual(surfaceValue, getSurfaceValue(0, -e))) ? 1.0 : 0.0;
|
||||
|
||||
surfaceIdDiff += any(notEqual(surfaceValue, getSurfaceValue(e, e))) ? 1.0 : 0.0;
|
||||
surfaceIdDiff += any(notEqual(surfaceValue, getSurfaceValue(e, -e))) ? 1.0 : 0.0;
|
||||
surfaceIdDiff += any(notEqual(surfaceValue, getSurfaceValue(-e, e))) ? 1.0 : 0.0;
|
||||
surfaceIdDiff += any(notEqual(surfaceValue, getSurfaceValue(-e, -e))) ? 1.0 : 0.0;
|
||||
|
||||
return surfaceIdDiff;
|
||||
}
|
||||
|
||||
@ -187,11 +181,6 @@ class CustomOutlinePass extends Pass {
|
||||
depthDiff += abs(depth - getPixelDepth(-1, 0));
|
||||
depthDiff += abs(depth - getPixelDepth(0, 1));
|
||||
depthDiff += abs(depth - getPixelDepth(0, -1));
|
||||
|
||||
depthDiff += abs(depth - getPixelDepth(1, 1));
|
||||
depthDiff += abs(depth - getPixelDepth(1, -1));
|
||||
depthDiff += abs(depth - getPixelDepth(-1, 1));
|
||||
depthDiff += abs(depth - getPixelDepth(-1, -1));
|
||||
return depthDiff;
|
||||
}
|
||||
|
||||
@ -232,8 +221,6 @@ class CustomOutlinePass extends Pass {
|
||||
gl_FragColor = vec4(vec3(surfaceValueDiff), 1.0);
|
||||
}
|
||||
|
||||
if (surfaceValueDiff != 0.0) surfaceValueDiff = 1.0;
|
||||
|
||||
float outline;
|
||||
vec4 outlineColor = vec4(outlineColor, 1.0);;
|
||||
|
||||
|
@ -128,7 +128,7 @@ export class OutlineModelViewer extends HTMLElement {
|
||||
composer.addPass(effectFXAA);
|
||||
|
||||
// Set over sampling ratio
|
||||
this.updateEdgeThickness(1);
|
||||
this.updateEdgeThickness(1 / window.devicePixelRatio);
|
||||
this.updatePixelRatio(window.devicePixelRatio);
|
||||
renderer.setSize(width, height, false);
|
||||
|
||||
@ -294,9 +294,11 @@ export class OutlineModelViewer extends HTMLElement {
|
||||
uniforms.debugVisualize.value = value;
|
||||
});
|
||||
|
||||
gui.add(params, "edgeThickness", 1, 10).onChange(function (value) {
|
||||
element.updateEdgeThickness(value);
|
||||
});
|
||||
gui
|
||||
.add(params, "edgeThickness", 1 / window.devicePixelRatio, 10)
|
||||
.onChange(function (value) {
|
||||
element.updateEdgeThickness(value);
|
||||
});
|
||||
|
||||
gui.add(params, "pixelRatio", 1, 8, 1).onChange(function (value) {
|
||||
element.updatePixelRatio(value);
|
||||
|
@ -24,7 +24,6 @@ if (inline_viewer) {
|
||||
|
||||
original.autoRotate = controls.autoRotate;
|
||||
controls.autoRotate = true;
|
||||
inline_viewer.updateEdgeThickness(0.5);
|
||||
}
|
||||
|
||||
if (mode === "icon" && delta > 2 * margin) {
|
||||
@ -42,8 +41,6 @@ if (inline_viewer) {
|
||||
);
|
||||
controls.autoRotate = original.autoRotate;
|
||||
mode = "inline";
|
||||
// inline_viewer.onWindowResize();
|
||||
inline_viewer.updateEdgeThickness(1);
|
||||
canvas.classList.remove("revealed");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user