Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/extras/gizmo/shaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ export const unlitShader = {
uniform vec4 uColor;

void main(void) {
gl_FragColor = vec4(gammaCorrectOutput(decodeGamma(uColor)), uColor.w);
if (uColor.a < 1e-4) {
discard;
}
gl_FragColor = vec4(gammaCorrectOutput(decodeGamma(uColor)), uColor.a);
#if DEPTH_WRITE == 0
gl_FragDepth = 0.0;
#endif
Expand Down Expand Up @@ -58,7 +61,10 @@ export const unlitShader = {
@fragment
fn fragmentMain(input: FragmentInput) -> FragmentOutput {
var output: FragmentOutput;
output.color = vec4f(gammaCorrectOutput(decodeGamma(uniform.uColor)), uniform.uColor.w);
if (uniform.uColor.a < 1e-4) {
discard;
}
output.color = vec4f(gammaCorrectOutput(decodeGamma(uniform.uColor)), uniform.uColor.a);
#if DEPTH_WRITE == 0
output.fragDepth = 0.0;
#endif
Expand Down
3 changes: 3 additions & 0 deletions src/extras/gizmo/shape/shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ class Shape {
* @type {boolean}
*/
set visible(value) {
if (value === this._visible) {
return;
}
for (let i = 0; i < this.meshInstances.length; i++) {
this.meshInstances[i].visible = value;
}
Expand Down