Ai
263 Star 4K Fork 923

ICEGL/icegl-three-vue-tres

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
solidClippingMaterial.vue 869 Bytes
一键复制 编辑 原始数据 按行查看 历史
地虎降天龙 提交于 2024-12-26 12:15 +08:00 . 增加了 裁切材质的补色组件
<!--
* @Description:
* @Version: 1.668
* @Autor: 地虎降天龙
* @Date: 2024-12-26 09:31:40
* @LastEditors: 地虎降天龙
* @LastEditTime: 2024-12-26 12:09:31
-->
<template>
<CustomShaderMaterial :baseMaterial="THREE.MeshPhongMaterial" :fragmentShader="fragmentShader" :uniforms="uniforms" />
</template>
<script setup lang="ts">
import { watch } from 'vue'
import * as THREE from 'three'
import { CustomShaderMaterial } from '@tresjs/cientos'
import fragmentShader from '../shader/solidClippingMaterial.frag'
const props = defineProps({
cutSectionColor: {
default: '#aaff11',
},
})
const uniforms = {
cutSectionColor: {
value: new THREE.Color(props.cutSectionColor),
},
}
watch(
() => props.cutSectionColor,
(cutSectionColor) => {
uniforms.cutSectionColor.value.set(cutSectionColor)
},
)
</script>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/ice-gl/icegl-three-vue-tres.git
git@gitee.com:ice-gl/icegl-three-vue-tres.git
ice-gl
icegl-three-vue-tres
icegl-three-vue-tres
master

搜索帮助