惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
Google DeepMind News
Google DeepMind News
博客园 - 司徒正美
Y
Y Combinator Blog
F
Fortinet All Blogs
云风的 BLOG
云风的 BLOG
T
Tailwind CSS Blog
G
Google Developers Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
罗磊的独立博客
D
DataBreaches.Net
T
The Blog of Author Tim Ferriss
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
MyScale Blog
MyScale Blog
N
Netflix TechBlog - Medium
Microsoft Security Blog
Microsoft Security Blog
GbyAI
GbyAI
P
Proofpoint News Feed
Jina AI
Jina AI
B
Blog RSS Feed
腾讯CDC
阮一峰的网络日志
阮一峰的网络日志
D
Docker

博客园 - 莫小龙

wps之使用宏修改全篇表格样式 geoserver之强制配置OnlineResource mysql之将shp转化为wkt,然后存储再geomerty字段内 cesium之用着色器添加建筑贴图 uniapp之plus.downloader.createDownload下载文件传参 谷歌之将网页保存为图片 elementui之table中相同数据的单元格合并 krpano之使用教程 threejs之灯光不跟随OrbitControls控制器旋转 canvas之修改Base64图片中不透明部分的颜色 threejs之将PlaneGeometry转换为BufferGeometry threejs之利用shape通过线绘制面和体 threejs之添加渐变背景 threejs之创建发光墙体 paperjs之fitBounds适应区域前后屏幕坐标和输入坐标的转换 arcmap之通过点数据获取等值线 uniapp之安卓APP打开百度地图、高德地图APP openlayer之添加带箭头的线 geoserver之图片图标样式 SHP转WKT文件工具 openlayers之geoserver的wms图层mysql数据源数据修改后更新问题 通过日照时数计算每天RAD(太阳辐射)值 Uniapp之安卓签名证书(.keystore)生成
threejs之将张纹理图片组成材质组
莫小龙 · 2025-08-05 · via 博客园 - 莫小龙

threejs之将张纹理图片组成材质组

                        const texture1 = textureLoader.load('./static/img/1.jpg');
                        const texture2 = textureLoader.load('./static/img/2.jpg');
                        const customMaterial = new THREE.ShaderMaterial({
                            uniforms: {
                                texture1: { value: texture1 },
                                texture2: { value: texture2 },
                                blendFactor: { value: 0.5 }
                            },
                            vertexShader: `
                            varying vec2 vUv;
                            void main() {
                            vUv = uv;
                            gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
                            }
                        `,
                            fragmentShader: `
                            uniform sampler2D texture1;
                            uniform sampler2D texture2;
                            uniform float blendFactor;
                            varying vec2 vUv;
                            
                            void main() {
                            vec4 tex1 = texture2D(texture1, vUv);
                            vec4 tex2 = texture2D(texture2, vUv); // 双倍UV实现细节重复
                            gl_FragColor = mix(tex1, tex2, step(0.5, tex2.a));
                            }
                        `
                        });

钻研不易,转载请注明出处。。。。。。