码迷,mamicode.com
首页 > 其他好文 > 详细

move UVs of a texture

时间:2018-07-02 13:32:23      阅读:169      评论:0      收藏:0      [点我收藏+]

标签:constant   ons   offset   gallery   slot   fetch   creat   wave   分享   

技术分享图片

Go to the material options on the left, and use a Custom UV. Create a vector parameter, use it to scale and offset your texture coordinate, and feed it back into the custom UV slot for that texture coordinate.

You could also do this right before sampling your texture in the main body of your material, but that will add an extra instruction in your base pass shader (for every pixel) compared to using a Custom UV. Using a Custom UV can also let the GPU pre-fetch the texture data since it knows at the vertex exactly which texture samples you are going to need later in the shader--probably more important for mobile devices than modern PC GPUs these days.

If you want to do fancier distortion effects (i.e. heat waves, water ripples, etc.) above and beyond a constant scale/offset, there is no way around doing it per-pixel before you sample it in the base pass.

move UVs of a texture

标签:constant   ons   offset   gallery   slot   fetch   creat   wave   分享   

原文地址:https://www.cnblogs.com/vfxJerry/p/9253343.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!