当前位置:网站首页>three.js模糊玻璃效果
three.js模糊玻璃效果
2022-08-10 11:12:00 【Jedi Hongbin】
制作透镜模糊效果 主要用到下面几个材质的属性 以及 MeshPhysicalMaterial 材质
const params = {
color: 0xffffff,
//类似透明度
transmission: 0.9,
opacity: 1,
//金属度
metalness: 0,
//粗糙
roughness: 0,
//折射率
ior: 1.52,
//厚度 透过看物体的模糊程度
thickness: 0.8,
//镜面强度
specularIntensity: 1,
//镜面颜色
specularColor: new Color("#ffffff"),
//光强度
lightIntensity: 1
};
普通酒杯
const params = {
color: 0xffffff,
"transmission": 0.9,
"opacity": 1,
"metalness": 0,
"roughness": 0,
"ior": 1.52,
"thickness": 0.8,
"specularIntensity": 1
}
const glassMaterial = new MeshPhysicalMaterial({
side: DoubleSide,
specularColor: new Color("#ffffff"),
...params,
});
金属酒杯
{
"color": 0xffffff,
"transmission": 0.9063505503810331,
"opacity": 0.9713801862828112,
"metalness": 0.7329381879762913,
"roughness": 0,
"ior": 1.52,
"thickness": 0.8,
"specularIntensity": 1
}
{
"color": 0xffffff,
"transmission": 0.7329381879762913,
"opacity": 1,
"metalness": 0.9063505503810331,
"roughness": 0.5812023708721422,
"ior": 1.209822184589331,
"thickness": 1.4049110922946655,
"specularIntensity": 1.0364098221845894
}
磨砂酒杯
参数
{
"color": 0xffffff,
"transmission": 0.9063505503810331,
"opacity": 0.9713801862828112,
"metalness": 0,
"roughness": 0.45114309906858596,
"ior": 1.52,
"thickness": 0.8,
"specularIntensity": 1
}
gui调试
for (const key of Object.keys(params)) {
gui.add(params, key, 0, 2).onChange((v) => {
glassMaterial[key] = v;
});
}
gui.add(
{
log: () => {
console.log(params);
},
},
"log"
);
边栏推荐
- Analysis of the name matching process between the LCD driver and the device (Tiny4412)
- mpf6_Time Series Data_quandl_correct kernel PCA_AIC_BIC_trend_log_return_seasonal_decompose_sARIMAx_ADFull
- rider内Mono脚本找不到引用资源
- 有哪些好用的性能测试工具推荐?性能测试报告收费标准
- Redis常用命令
- VSCode remote connection server error: Could not establish connection to "xxxxxx" possible error reasons and solutions
- HDU 4135:Co-prime (容斥原理)
- 实现内网穿透的最佳解决方案(无实名认证,完全免费)
- Database management tool: dynamic read-write separation
- LeetCode 109. Sorted Linked List Conversion Binary Search Tree
猜你喜欢
Network Fundamentals (Section 1)
建校仅11年就入选“双一流” ,这所高校是凭什么做到的?
孩子自律性不够?猿辅导:计划表要注意“留白”给孩子更多掌控感
皕杰报表在传参乱码
Where can I view the version record of WeChat applet submission review history?
How many constants and data types do you remember?
StoneDB Document Bug Hunting Season 1
Nocalhost - 让云原生时代的开发更高效
Do self-media monthly income tens of thousands?Several self-media tools that bloggers are using
mpf6_Time Series Data_quandl_更正kernel PCA_AIC_BIC_trend_log_return_seasonal_decompose_sARIMAx_ADFull
随机推荐
即时零售业态下如何实现自动做账?
Interviewer: How are Dao, Service, Controller, Util, and Model divided in the project?
模块九 - 设计电商秒杀系统
SMIC CIM localization project suspended?Rising software: not shut down, changed to remote development!
Introduction to Software Architecture
AutoCAD Map 3D功能之一暴力处理悬挂点(延伸)
态路小课堂丨如何为CXP光模块选择光纤跳线?
LeetCode 61. 旋转链表
零基础想自学软件测试,有没有大佬可以分享下接下来的学习书籍和路线?
彩色图和深度图转点云
使用.NET简单实现一个Redis的高性能克隆版(六)
A case of violent parameter tuning in machine learning
LeetCode 21. 合并两个有序链表
使用哈工大LTP测试分词并且增加自定义字典
LeetCode 24. 两两交换链表中的节点
孩子自律性不够?猿辅导:计划表要注意“留白”给孩子更多掌控感
【小程序 | 启航篇】一文打通任督二脉
OSSCore 开源解决方案介绍
快手“弃”有赞与微盟“结亲”,电商SaaS行业竞争格局将变?
LeetCode 19. Delete the Nth last node of the linked list