File tree Expand file tree Collapse file tree 3 files changed +21
-10
lines changed
Expand file tree Collapse file tree 3 files changed +21
-10
lines changed Original file line number Diff line number Diff line change @@ -580,14 +580,16 @@ class ScaleGizmo extends TransformGizmo {
580580 }
581581
582582 // mirror axes
583- const cameraDir = this . cameraDir ;
584- const rot = tmpQ1 . copy ( this . _rootStartRot ) ;
585- let dot = cameraDir . dot ( rot . transformVector ( Vec3 . RIGHT , tmpV1 ) ) ;
586- point . x *= dot < 0 ? - 1 : 1 ;
587- dot = cameraDir . dot ( rot . transformVector ( Vec3 . UP , tmpV1 ) ) ;
588- point . y *= dot < 0 ? - 1 : 1 ;
589- dot = cameraDir . dot ( rot . transformVector ( Vec3 . FORWARD , tmpV1 ) ) ;
590- point . z *= dot > 0 ? - 1 : 1 ;
583+ if ( this . flipAxes ) {
584+ const cameraDir = this . cameraDir ;
585+ const rot = tmpQ1 . copy ( this . _rootStartRot ) ;
586+ let dot = cameraDir . dot ( rot . transformVector ( Vec3 . RIGHT , tmpV1 ) ) ;
587+ point . x *= dot < 0 ? - 1 : 1 ;
588+ dot = cameraDir . dot ( rot . transformVector ( Vec3 . UP , tmpV1 ) ) ;
589+ point . y *= dot < 0 ? - 1 : 1 ;
590+ dot = cameraDir . dot ( rot . transformVector ( Vec3 . FORWARD , tmpV1 ) ) ;
591+ point . z *= dot > 0 ? - 1 : 1 ;
592+ }
591593
592594 // uniform scaling for planes
593595 if ( this . _uniform && isPlane ) {
Original file line number Diff line number Diff line change @@ -29,7 +29,10 @@ export const unlitShader = {
2929 uniform vec4 uColor;
3030
3131 void main(void) {
32- gl_FragColor = vec4(gammaCorrectOutput(decodeGamma(uColor)), uColor.w);
32+ if (uColor.a < 1.0 / 255.0) {
33+ discard;
34+ }
35+ gl_FragColor = vec4(gammaCorrectOutput(decodeGamma(uColor)), uColor.a);
3336 #if DEPTH_WRITE == 0
3437 gl_FragDepth = 0.0;
3538 #endif
@@ -58,7 +61,10 @@ export const unlitShader = {
5861 @fragment
5962 fn fragmentMain(input: FragmentInput) -> FragmentOutput {
6063 var output: FragmentOutput;
61- output.color = vec4f(gammaCorrectOutput(decodeGamma(uniform.uColor)), uniform.uColor.w);
64+ if (uniform.uColor.a < 1.0 / 255.0) {
65+ discard;
66+ }
67+ output.color = vec4f(gammaCorrectOutput(decodeGamma(uniform.uColor)), uniform.uColor.a);
6268 #if DEPTH_WRITE == 0
6369 output.fragDepth = 0.0;
6470 #endif
Original file line number Diff line number Diff line change @@ -230,6 +230,9 @@ class Shape {
230230 * @type {boolean }
231231 */
232232 set visible ( value ) {
233+ if ( value === this . _visible ) {
234+ return ;
235+ }
233236 for ( let i = 0 ; i < this . meshInstances . length ; i ++ ) {
234237 this . meshInstances [ i ] . visible = value ;
235238 }
You can’t perform that action at this time.
0 commit comments