Skip to content

Commit

Permalink
feat: add alphaMap to useTexture
Browse files Browse the repository at this point in the history
  • Loading branch information
JaimeTorrealba committed Mar 28, 2023
1 parent dcc2895 commit f66c363
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions playground/src/components/TheBasic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,13 @@ const state = reactive({
toneMapping: NoToneMapping,
})
const { alphaMap } = await useTexture({
alphaMap: 'https://assets.codepen.io/4698468/2k_earth_clouds.jpg',
})
const sphereRef = ref()
const cloudRef = ref()
const { onLoop } = useRenderLoop()
onLoop(({ elapsed }) => {
if (!sphereRef.value) return
sphereRef.value.position.y += Math.sin(elapsed) * 0.01
cloudRef.value.position.y += Math.sin(elapsed) * 0.01
})
</script>
<template>
Expand All @@ -43,10 +37,6 @@ onLoop(({ elapsed }) => {
<TresMeshToonMaterial color="cyan" />
<!-- <TresMeshToonMaterial color="#FBB03B" /> -->
</TresMesh>
<TresMesh ref="cloudRef" :position="[0, 4, 0]" cast-shadow>
<TresSphereGeometry :args="[2.01,32,32]"/>
<TresMeshStandardMaterial :transparent="true" :alpha-map="alphaMap" />
</TresMesh>

<TresDirectionalLight :position="[0, 8, 4]" :intensity="0.7" cast-shadow />
<TresMesh :rotation="[-Math.PI / 2, 0, 0]" receive-shadow>
Expand Down

0 comments on commit f66c363

Please sign in to comment.