当前位置: 首页 > news >正文

Babylonjs学习笔记(六)——贴图的使用

书接上回,这里讨论贴图的运用!!!

// 创建球网格const ball = MeshBuilder.CreateSphere('ball',{diameter:1},scene)ball.position = new Vector3(0,1,0)// 创建PRB材质const ballMat = new PBRMaterial('pbr',scene)// albedoTexture 反照率贴图ballMat.albedoTexture = new Texture('./textures/aerial_beach_02_diff_4k.jpg',scene)// 法线贴图ballMat.bumpTexture = new Texture('./textures/aerial_beach_02_nor_gl_4k.jpg',scene)ballMat.invertNormalMapX = trueballMat.invertNormalMapY = true// ao贴图ballMat.metallicTexture = new Texture('./textures/aerial_beach_02_ao_4k.jpg',scene)ballMat.useAmbientOcclusionFromMetallicTextureRed = trueballMat.useRoughnessFromMetallicTextureGreen = trueballMat.useMetallnessFromMetallicTextureBlue = true// 发光贴图ballMat.emissiveTexture = new Texture('./textures/emissive.jpg',scene)// 默认是黑色 不发光ballMat.emissiveColor = new Color3(1,1,1)// 发光强度ballMat.emissiveIntensity = 1// 材质接收到的环境光强度ballMat.environmentIntensity = 0.25// 发光层const glowLayer  = new GlowLayer('glow',scene)glowLayer.intensity = 1// 应用材质ball.material = ballMat;

http://www.lryc.cn/news/208662.html

相关文章:

  • 架构风格区别-架构案例(五十九)
  • p5.js画布操作实战:创建,绑定指定元素,动态调整大小,隐藏滚动条,删除画布
  • vue手动拖入和导入excel模版
  • Linux下导出dump文件(Oracle和PG数据)
  • TSINGSEE青犀睡岗离岗检测算法——确保加油站安全运营
  • gd32部分映射1/2,完全映射,备用功能选择等
  • 如何高效自学(黑客技术)方法——网络安全
  • K8S基础架构租赁(Lease )
  • vue使用smooth-signature实现移动端电子签字,包括横竖屏
  • K8s概念汇总-笔记
  • 小程序设计基本微信小程序的校园生活助手系统
  • 程序包com.sun.xml.internal.bind.marshaller不存在
  • Docker 入门
  • Arduino驱动ME007-ULS防水测距模组(超声波传感器)
  • docker容器怎么设置开机启动
  • 基于springboot实现校园交友网站管理系统项目【项目源码+论文说明】
  • 支付宝证书到期更新完整过程
  • Linux 云服务器磁盘挂载简介
  • LeetCode--3.无重复字符的最长子串
  • iOS调试技巧——使用Python 自定义LLDB
  • 经典卷积神经网络 - ResNet
  • 一、高效构建Java应用:Maven入门和进阶
  • 【Pytorch】Pytorch学习笔记02 - 单变量时间序列 LSTM
  • C# 压缩图片
  • Linux: sysctl: rp_filter; 包到了内核,没有到socket,火星包martia
  • Liunx两台服务器实现相互SSH免密登录
  • 刷题笔记day03-链表
  • Lua入门使用与基础语法
  • RDMA概览
  • 设计模式(15)组合模式