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

省运会官方网站建设wordpress文章id递增2

省运会官方网站建设,wordpress文章id递增2,济南电商培训基地,网络规划设计师报名入口文章目录 前言一、额外灯的距离衰减二、DistanceAttenuation函数的传入参数1、distanceSqr2、distanceAndSpotAttenuation3、_AdditionalLightsAttenuation4、GetPunctualLightDistanceAttenuation函数三、DistanceAttenuation函数的程序体 前言 在上一篇文章中#xff0c;我… 文章目录 前言一、额外灯的距离衰减二、DistanceAttenuation函数的传入参数1、distanceSqr2、distanceAndSpotAttenuation3、_AdditionalLightsAttenuation4、GetPunctualLightDistanceAttenuation函数三、DistanceAttenuation函数的程序体 前言 在上一篇文章中我们分析了额外灯的方向怎么计算。 Unity中URP下计算额外灯的方向 在这篇文章中我们来分析一下额外灯的距离衰减。 一、额外灯的距离衰减 在上一篇文章中完成了额外灯方向计算后来到了计算额外光的衰减部分衰减包括距离衰减 和 角度衰减我们这篇文章主要分析 距离衰减 DistanceAttenuation(distanceSqr, distanceAndSpotAttenuation.xy) 二、DistanceAttenuation函数的传入参数 调用 DistanceAttenuation1(distanceSqr, distanceAndSpotAttenuation.xy) 1、distanceSqr 这个计算光线向量后的点积结果 // Directional lights store direction in lightPosition.xyz and have .w set to 0.0. // This way the following code will work for both directional and punctual lights. float3 lightVector lightPositionWS.xyz - positionWS * lightPositionWS.w; float distanceSqr max(dot(lightVector, lightVector), HALF_MIN); 2、distanceAndSpotAttenuation 该参数是通过内置变量获取的 该参数是通过C#脚本提前计算好的 3、_AdditionalLightsAttenuation 我们来看一下C#是怎么计算得出该参数的 衰减默认值平行光 k_DefaultLightAttenuation默认值为0,0,0,1 非平行光下会对衰减值进行修改 该函数对衰减值做出了修改。使衰减值在灯光限制处刚好为0 4、GetPunctualLightDistanceAttenuation函数 该函数为以下参数做出准备 Unity使灯光限制处为0的公式移动平台Unity2022已经舍弃 s m o o t h F a c t o r l i g h t R a n g e S q r − d i s t a n c e T o L i g h t S q r l i g h t R a n g e S q r − f a d e S t a r t D i s t a n c e S q r smoothFactor\frac{lightRangeSqr - distanceToLightSqr}{lightRangeSqr -fadeStartDistanceSqr} smoothFactorlightRangeSqr−fadeStartDistanceSqrlightRangeSqr−distanceToLightSqr​非移动平台 s m o o t h F a c t o r ( 1 − ( d i s t a n c e T o L i g h t S q r 1 l i g h t R a n g e S q r ) 2 ) 2 smoothFactor(1-(distanceToLightSqr\frac{1}{lightRangeSqr})^2)^2 smoothFactor(1−(distanceToLightSqrlightRangeSqr1​)2)2 我们来看一下该公式实现了什么 l i g h t R a n g e S q r l i g h t R a n g e ∗ l i g h t R a n g e lightRangeSqr lightRange * lightRange lightRangeSqrlightRange∗lightRange f a d e S t a r t D i s t a n c e S q r 0.8 f ∗ 0.8 f ∗ l i g h t R a n g e S q r ; fadeStartDistanceSqr 0.8f * 0.8f * lightRangeSqr; fadeStartDistanceSqr0.8f∗0.8f∗lightRangeSqr;(0.8指的是80%开始衰减) d i s t a n c e T o L i g h t S q r 灯光的衰减距离的平方 distanceToLightSqr灯光的衰减距离的平方 distanceToLightSqr灯光的衰减距离的平方 三、DistanceAttenuation函数的程序体 移动平台Unity2022已经舍弃 s m o o t h F a c t o r l i g h t R a n g e S q r − d i s t a n c e T o L i g h t S q r l i g h t R a n g e S q r − f a d e S t a r t D i s t a n c e S q r smoothFactor\frac{lightRangeSqr - distanceToLightSqr}{lightRangeSqr -fadeStartDistanceSqr} smoothFactorlightRangeSqr−fadeStartDistanceSqrlightRangeSqr−distanceToLightSqr​ 可以看出经过该公式计算后我们的灯光强度在灯光距离限制处刚好为零 非移动平台 s m o o t h F a c t o r ( 1 − ( d i s t a n c e T o L i g h t S q r 1 l i g h t R a n g e S q r ) 2 ) 2 smoothFactor(1-(distanceToLightSqr\frac{1}{lightRangeSqr})^2)^2 smoothFactor(1−(distanceToLightSqrlightRangeSqr1​)2)2 这样就实现了额外灯的距离衰减效果了
http://www.zqtcl.cn/news/514754/

相关文章:

  • 360报危险网站微信代码小程序
  • 网站维护报价单国外 做励志视频的网站
  • 用源码做自己的网站公司网站建设哪家公司好
  • 网站运营做seohtml前端网站开发PPT
  • 上海网站定制设计图wordpress网站在线安装
  • 互动网站的核心技术wordpress不用插件
  • 厦门市建设工程交易中心网站怎么自己做游戏软件的app
  • 网站论文参考文献人力资源公司名称大全简单大气
  • 射阳做企业网站哪家好wordpress 进销存
  • 青海个人旅游网站建设wordpress用户名密码加密方式
  • 安徽平台网站建设找哪家wordpress首页加登录
  • 雅安市住房和城乡建设局网站湖南全程电子化服务平台官网
  • dw做的上传网站打不开网页制作培训价格
  • 工程网站怎么做广州做网站平台
  • 成都网站建设 全美深圳定制网站建设
  • 邢台网站建设与制作陕西高速公路建设集团网站
  • 太原 招聘 网站建设 技术经理关于 建设 二级网站
  • 如何做网站店铺的模板著名的响应式网站有哪些
  • 相城区建设网站做网站 设计师很
  • python网站开发好吗广州软件外包
  • 山东能源集团 网站建设对网站建设功能的情况说明
  • 网站设计个人各种类型网站建设口碑好
  • 西安巨久科技网站建设嘚嘚笔记 wordpress主推
  • 杭州利兴建设官方网站上海专业网站建设费
  • 自适应网站制作费用中国建设网官方网站企业登录
  • h5网站和传统网站区别电子商务主要学什么就业方向及前景
  • 凡科建站弊端各学院二级网站建设通报
  • 做网站怎么注册营业执照民制作网站哪家便宜
  • 临沂做进销存网站推广软件公司
  • 网站前端建设唐山网站建设托管