Skip to content

Commit

Permalink
Merge branch 'main' into feat/screen-quad
Browse files Browse the repository at this point in the history
  • Loading branch information
andretchen0 committed Nov 24, 2024
2 parents f77b06c + 75897e6 commit 74cf7ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
6 changes: 0 additions & 6 deletions src/core/materials/meshReflectionMaterial/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,6 @@ watch(() => [
})
}, { immediate: true })
watch(materialRef, () => {
if (materialRef.value) {
materialRef.value.onBeforeRender = onBeforeRender
}
})
// NOTE: Begin #615 warning
// The Tres core doesn't currently swap mesh materials when a
// material component recompiles.
Expand Down
7 changes: 3 additions & 4 deletions src/core/staging/ContactShadows.vue
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,11 @@ function setColors(ps: typeof props, pool: ReturnType<typeof init>) {
pool.depthMaterial.onBeforeCompile = function (shader) {
const tint = ps.tint ? new Color(ps.tint as ColorRepresentation) : new Color('white')
const { r, g, b } = tint
shader.fragmentShader = /* glsl */`
${shader.fragmentShader.replace(
const fragmentShader = shader.fragmentShader.replace(
'gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );',
`gl_FragColor = vec4( ${r}, ${g}, ${b}, ( 1.0 - fragCoordZ ) * opacity);`,
)}
`
)
shader.fragmentShader = fragmentShader
}
}
Expand Down

0 comments on commit 74cf7ab

Please sign in to comment.