Skip to content

Commit

Permalink
fix degre
Browse files Browse the repository at this point in the history
  • Loading branch information
lilpacy committed Nov 4, 2024
1 parent d72a8e7 commit f434766
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,16 @@ const cubeMaterial = new THREE.ShaderMaterial({
varying vec3 vPosition;
void main() {
vec3 color = vPosition;
gl_FragColor = vec4(color, 0.3);
if(abs(vPosition.x) == 0.5 || abs(vPosition.y) == 0.5 || abs(vPosition.z) == 0.5) {
gl_FragColor = vec4(color, 0.0);
} else {
gl_FragColor = vec4(color, 0.3);
}
}
`,
transparent: true,
side: THREE.DoubleSide
side: THREE.DoubleSide,
depthWrite: false
});

const cube = new THREE.Mesh(cubeGeometry, cubeMaterial);
Expand Down

0 comments on commit f434766

Please sign in to comment.