辣条 发表于 2012-8-12 21:58

Unity3D 物体材质位移代码 附图



var scrollSpeed = 0.1;
function Update ()
{
    var offset = Time.time * scrollSpeed;
    renderer.material.SetTextureOffset ("_BumpMap", Vector2(offset/-7.0, offset));
   
    renderer.material.SetTextureOffset ("_MainTex", Vector2(offset/10.0, offset));
}

qarluqd25 发表于 2012-12-8 15:29

bumpMap 和MainTex 是?

水深 发表于 2012-12-10 17:16

"_MainTex" is the main diffuse texture .This can also be accessed via mainTextureOffset property.
"_MainTex"是主要的漫反射纹理,也能通过 mainTextureOffset 属性访问

"_BumpMap" is the normal map.
"_BumpMap"是法线贴图

"_Cube" is the reflection cubemap.
"_Cube"是反射cubemap.(立方体贴图)

jstones 发表于 2012-12-14 18:12

坎坷坷看看可

caaaaaaaat 发表于 2013-1-10 22:56

赞~
好东西~谢谢啦啊~

十夜 发表于 2017-3-22 08:50

顶顶多好

霍元一 发表于 2017-3-22 09:11

说的非常好

a2951617 发表于 2017-3-22 08:35

很好哦

gllm126 发表于 2017-3-22 08:50

不错不错

十夜 发表于 2017-3-22 08:28

LZ真是人才
页: [1]
查看完整版本: Unity3D 物体材质位移代码 附图