Real-Time Rendering——6.4 Texture Animation纹理动画 6.5 Material Mapping材料映射

本文主要是介绍Real-Time Rendering——6.4 Texture Animation纹理动画 6.5 Material Mapping材料映射,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

6.4 Texture Animation纹理动画

The image applied to a surface does not have to be static. For example, a video source can be used as a texture that changes from frame to frame.

应用于表面的图像不必是静态的。例如,视频源 可用作逐帧变化的纹理。

The texture coordinates need not be static, either. The application designer can explicitly change the texture coordinates from frame to frame, either in the mesh’s data itself or via functions applied in the vertex or pixel shader. Imagine that a waterfall has been modeled and that it has been textured with an image that looks like falling water. Say the v-coordinate is the direction of flow. To make the water move, one must subtract an amount from the v-coordinates on each successive frame.Subtraction from the texture coordinates has the effect of making the texture itself appear to move forward.

纹理坐标也不必是静态的。应用程序设计人员可以在网格数据本身中或通过顶点或像素着色器中应用的函数来显式地更改帧与帧之间的纹理坐标。想象一下,一个瀑布已经被建模,并且已经用看起来像正在下落的水的图像对其进行了纹理处理。假设v坐标是流动的方向。要让水流动,必须在每一个连续的帧上从v坐标中减去一个量。从纹理坐标中减去具有使纹理本身看起来向前移动的效果。

More elaborate effects can be created by applying a matrix to the texture coordinates.In addition to translation, this allows for linear transformations such as zoom,rotation, and shearing [1192, 1904], image warping and morphing transforms [1729],and generalized projections [638]. Many more elaborate effects can be created by applying functions on the CPU or in shaders.

通过将矩阵应用于纹理坐标,可以创建更精细的效果。除了平移,这允许线性变换,例如缩放、旋转和剪切[1192,1904],图像扭曲和变形变换[1729],以及广义投影[638]。通过在CPU或着色器中应用函数,可以创建更多精细的效果。

By using texture blending techniques, one can realize other animated effects. For example, by starting with a marble texture and fading in a flesh texture, one can make a statue come to life [1215].

通过使用纹理混合技术,可以实现其他动画效果。例如,从大理石纹理开始,然后淡入肉色纹理,就可以让雕像栩栩如生[1215]。

6.5 Material Mapping材料映射

A common use of a texture is to modify a material property affecting the shading equation. Real-world objects usually have material properties that vary over their surface. To simulate such objects, the pixel shader can read values from textures and use them to modify the material parameters before evaluating the shading equation.The parameter that is most often modified by a texture is the surface color. This texture is known as an albedo color map or diffuse color map. However, any parameter can be modified by a texture: replacing it, multiplying it, or changing it in some other way. For example, in Figure 6.25 three different textures are applied to a surface,replacing the constant values.

纹理的一个常见用途是修改影响着色方程的材质属性。现实世界中的物体通常具有随其表面而变化的材料属性。为了模拟这样的对象,像素着色器可以从纹理中读取值,并在评估着色方程之前使用它们来修改材质参数。纹理最常修改的参数是表面颜色。这种纹理被称为反照率颜色贴图或漫反射颜色贴图。然而,任何参数都可以被纹理修改:替换它,乘以它,或者以其他方式改变它。例如,在图6.25中,三种不同的纹理被应用到一个表面,取代了常量值。

Figure 6.25. Metallic bricks and mortar. On the right are the textures for surface color, roughness (lighter is rougher), and bump map height (lighter is higher). (Image from three.js example webgl tonemapping [218].) 

图6.25。金属砖和灰浆。右边是表面颜色、粗糙度(越浅越粗糙)和凹凸贴图高度(越浅越高)的纹理。(图片来自three.js示例webgl色调映射[218])。)

The use of textures in materials can be taken further. Instead of modifying a parameter in an equation, a texture can be used to control the flow and function of the pixel shader itself. Two or more materials with different shading equations and parameters could be applied to a surface by having one texture specify which areas of the surface have which material, causing different code to be executed for each. As an example, a metallic surface with some rusty regions can use a texture to indicate where the rust is located, conditionally executing the rusty part of the shader based on that texture lookup and otherwise executing the shiny metal shader (Section 9.5.2).

材质的使用可以更进一步。纹理可以用来控制像素着色器本身的流程和功能,而不是修改方程中的参数。通过让一个纹理指定表面的哪些区域具有哪种材料,可以将具有不同着色方程式和参数的两种或多种材料应用于表面,从而为每个区域执行不同的代码。例如,具有一些生锈区域的金属表面可以使用纹理来指示生锈的位置,根据纹理查找有条件地执行着色器的生锈部分,否则执行闪亮金属着色器(第9.5.2节)。

Shading model inputs such as surface color have a linear relationship to the final color output from the shader. Thus, textures containing such inputs can be filtered with standard techniques, and aliasing is avoided. Textures containing nonlinear shading inputs, such as roughness or bump mapping (Section 6.7), require a bit more care to avoid aliasing. Filtering techniques that take account of the shading equation can improve results for such textures. These techniques are discussed in Section 9.13.

着色模型输入(如表面颜色)与着色器的最终颜色输出具有线性关系。因此,包含这种输入的纹理可以用标准技术过滤,并且避免了锯齿。包含非线性阴影输入的纹理,如粗糙度或凹凸贴图(6.7节),需要多加小心以避免走样。考虑到着色方程的过滤技术可以改善这种纹理的结果。这些技术将在9.13节中讨论。

这篇关于Real-Time Rendering——6.4 Texture Animation纹理动画 6.5 Material Mapping材料映射的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/536616

相关文章

使用animation.css库快速实现CSS3旋转动画效果

《使用animation.css库快速实现CSS3旋转动画效果》随着Web技术的不断发展,动画效果已经成为了网页设计中不可或缺的一部分,本文将深入探讨animation.css的工作原理,如何使用以及... 目录1. css3动画技术简介2. animation.css库介绍2.1 animation.cs

解决IDEA报错:编码GBK的不可映射字符问题

《解决IDEA报错:编码GBK的不可映射字符问题》:本文主要介绍解决IDEA报错:编码GBK的不可映射字符问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录IDEA报错:编码GBK的不可映射字符终端软件问题描述原因分析解决方案方法1:将命令改为方法2:右下jav

Python的time模块一些常用功能(各种与时间相关的函数)

《Python的time模块一些常用功能(各种与时间相关的函数)》Python的time模块提供了各种与时间相关的函数,包括获取当前时间、处理时间间隔、执行时间测量等,:本文主要介绍Python的... 目录1. 获取当前时间2. 时间格式化3. 延时执行4. 时间戳运算5. 计算代码执行时间6. 转换为指

resultMap如何处理复杂映射问题

《resultMap如何处理复杂映射问题》:本文主要介绍resultMap如何处理复杂映射问题,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录resultMap复杂映射问题Ⅰ 多对一查询:学生——老师Ⅱ 一对多查询:老师——学生总结resultMap复杂映射问题

Java枚举类实现Key-Value映射的多种实现方式

《Java枚举类实现Key-Value映射的多种实现方式》在Java开发中,枚举(Enum)是一种特殊的类,本文将详细介绍Java枚举类实现key-value映射的多种方式,有需要的小伙伴可以根据需要... 目录前言一、基础实现方式1.1 为枚举添加属性和构造方法二、http://www.cppcns.co

python中time模块的常用方法及应用详解

《python中time模块的常用方法及应用详解》在Python开发中,时间处理是绕不开的刚需场景,从性能计时到定时任务,从日志记录到数据同步,时间模块始终是开发者最得力的工具之一,本文将通过真实案例... 目录一、时间基石:time.time()典型场景:程序性能分析进阶技巧:结合上下文管理器实现自动计时

Java中基于注解的代码生成工具MapStruct映射使用详解

《Java中基于注解的代码生成工具MapStruct映射使用详解》MapStruct作为一个基于注解的代码生成工具,为我们提供了一种更加优雅、高效的解决方案,本文主要为大家介绍了它的具体使用,感兴趣... 目录介绍优缺点优点缺点核心注解及详细使用语法说明@Mapper@Mapping@Mappings@Co

MySQL中时区参数time_zone解读

《MySQL中时区参数time_zone解读》MySQL时区参数time_zone用于控制系统函数和字段的DEFAULTCURRENT_TIMESTAMP属性,修改时区可能会影响timestamp类型... 目录前言1.时区参数影响2.如何设置3.字段类型选择总结前言mysql 时区参数 time_zon

在MyBatis的XML映射文件中<trim>元素所有场景下的完整使用示例代码

《在MyBatis的XML映射文件中<trim>元素所有场景下的完整使用示例代码》在MyBatis的XML映射文件中,trim元素用于动态添加SQL语句的一部分,处理前缀、后缀及多余的逗号或连接符,示... 在MyBATis的XML映射文件中,<trim>元素用于动态地添加SQL语句的一部分,例如SET或W

Python 标准库time时间的访问和转换问题小结

《Python标准库time时间的访问和转换问题小结》time模块为Python提供了处理时间和日期的多种功能,适用于多种与时间相关的场景,包括获取当前时间、格式化时间、暂停程序执行、计算程序运行时... 目录模块介绍使用场景主要类主要函数 - time()- sleep()- localtime()- g