3D制图渲染和3d游戏 渲染错误内的渲染有什么区别

3Ds Max渲染教程:制作逼真的游戏中的CG人物
作者:佚名
字体:[ ] 来源:互联网 时间:06-30 10:54:41
在这个教程里我将讲一些我在创建Anhells这个角色中所使用的一些处理方法.我不会很深入地去讲解每一步的操作,所以需要对2D,3D软件都很熟悉的人适合学习,希望这篇教程对大家有所帮助
在这个教程里我将讲一些我在创建Anhells这个角色中所使用的一些处理方法.我不会很深入地去讲解每一步的操作,我把你当作一位对2D,3D软件都很熟悉的人.我使用3ds max,photoshop,和combustion作为主要的工具,Mental Ray和Vray是我主要使用的渲染器,因为这两个渲染器我都喜欢,所以这两个我都使用。
3Ds Max制作&Anhells&
作者:Julio C. Espada
使用软件::3ds Max, Photoshop, V-Ray, mental ray
主要内容:角色的设定及灯光材质的调节
这个图片是从我工作中做的一个头部模型开始的(于现在看起来是完全不同的.)在花费了很多小时来调节多边形之后,我觉的我可以结合一些比较酷的角色模型来结束这项工作,再随后,因为一些原因我决定我要创建一个更为复杂的场景,所以我一点一点开始做了.在这个教程当中我想要传递给你的最重要的事情之一就是:
在做之后一定要先画出草图来!我只是以我脑海中一些关于天使,魔鬼或是地狱的一些比较模糊的印象来开始这项工作的.相信我!如果不这样做,你做完的东西很可能就是一件垃圾作品.因为你在创建物体的过程当中你都不知道哪一个物体应该放置在哪里,所以一定一定要记住在开始做之前,一定先在纸上画一些草图来思考你在3D里面应该怎样去创建。
在这个场景中我创建的第一个物体是那一个主要的角色,每一个角色都是在同一个基础上做一下稍微的改变得来的.在下图(图1)中你可以看到角色的头部的两个发展形态,因为这个场景中不需要做动画,而且材质也不需要很精致,所以有些地方我做的不是很细。
手(图2)是使用一个基本网格制作而成的。
上面这几乎是所有部分了,对于手我是使用了一个以前做的不完全的模型(图3)。
腿(图4)是从我以前做的一个角色上得来的,然后把他们放置好并且重新调整了以使它看起来更好看一点。
关于角色的分析已经完成了.现在我已经比较清楚我应该让这个角色怎样去表现了(图5)。
我使用了Bipe作为骨骼,然后再给角色蒙皮,我首先做了一些很基础的蒙皮,当我对角色的姿态比较满意后我做了一个网格的快照,然后再继续调节以使它看起来更好,然后再通过编辑点使角色的嘴张开(图6)。
因为先前我已经很明白我的这个天使于魔鬼角色的外观应该是什么样的,所以我制作了一个尾巴来跟天使的翅膀形成对比.并且把尾巴做成线形的朝着他运动的方向.因为他是一个不受约束的物体,而且后面部分并看不到,所以我不需要再去做挡在身体后面的部分的模型了(图7)。
正如你所看到的,模型的后面(图8)是经过很困难的调节才使他在摄像视图中看起来不错的.但是如果是在别的角度下看就不是这么好了。
至于衣服,我不是很明白为什么要穿在那里,但是我感觉这样可以为运动增加更多的动态.为其添加更多的衣服,制作方法跟下面的那一个都是相同的(图9)。
链子(图10)在完成建模以后再添加一些骨骼,这样可以按照我的想法去移动它.我使用了一个push修改器以使它们在光滑后看起来更好一些。
羽毛(图11)我使用了alpha通道,我发现如果你有比较好的贴图,用这种方法是最好的了,我使用了一个我以前在互联网上看到的一个教程里面的贴图,羽毛的过渡色贴图就是一个深褐色的。
我使用了一个功能可以允许我放置羽毛在适当的位置而不需要做很多的调整.然后我再添中一个FFD变形修改来改变主体的外形,但是在这一步之前我需要先要确定这些羽毛应该怎么去放置,这是一件很重要的事情,因为过一会屏幕上会有太多的羽毛多边形了,那样选择某一个单一的羽毛会比较困难(图12)。
使用在视图中显示贴图可以预览所有的羽毛而不需要渲染,但是要注意如果你的贴图精度很高而你的计算机配置比较低,你就需要放置更多的平面来使羽毛看起来可信,如果不,那么它们会起来比较薄的.几乎所有的羽毛都需要手动去调整的。
在这里我使用的一个窍门是把这些羽毛物体都attach到一到成为一个多边形物体,这样就可以使用软选择来移动或是调整这些羽毛了而不需要费那么多事了(图13)。
至此模型已经创建完毕了.然后我又做了一些调整以适应别的角色模型.但是只是做了一些很小的调整,比如说旋转翅膀的角度,链子的跟随等等(图14)。
我决定创建一个更为复杂的场景,所以我又添加了另一个角色,将新添加的色角调整以后得到了一个新的姿态,我花了很多时间去调节网格直到我觉的是最好为止(图15)。
灯光的设置比较简单,我只用了两盏灯来照明,并且在环境中使用了HDRI贴图,我调整灯光的衰减参数以来得到我想要的颜色混合.翅膀是在另一层中没有HDRI贴图和final gather. 在这里我使用了mental ray渲染器(图16)。
环境背景是在photoshop里添加的,这样可以使角色看起来更可信!在这里翅膀没有看到.因为透明材质在这种方法下渲染的不是很好,看起来太暗了.皮肤的材质是经过调整以后以得到一种乳白色的效果(图17)。
地面的贴图是在photoshop 里手工画的.正如你所看到的.都是重复的,但是在摄像机视图里并不很明显,所以不需要再去调整了(图18-19)。
我创建了一个很大的圆柱体并且给它指定贴图来给画面增加一些深度.在后面的合成中我使用了它多次(图20)。
我把背景渲染成RPF格式文件,这样我就可以控制深度和雾.combustion可以对静态图象处理的很好.不仅仅是针对视频或是动画.(图21)。
这是在photoshop中所有的图层,在photoshop中对图象做了很多的调整,几乎所有的贴图都是在这里完成的.我使用了很多贴图和图片来产生火、烟、云以及灰尘等。同样还渲染了更多的角色来给图像增加更多的效果。我希望你在这篇教程中能学到一些你需要的东西以及在你做一些复杂的场景的时候需要避免的一些错误(图22)。
以上就是用3Ds Max制作逼真的游戏中的CG人物过程,希望大家通过这篇教程能收获很多知识,并运用到工作之中!谢谢大家观看!
大家感兴趣的内容
12345678910
最近更新的内容 上传我的文档
 下载
 收藏
高级java工程师、移动支付领域项目经理;擅长产品研发、项目管理;获得信息系统项目管理师证书。
 下载此文档
正在努力加载中...
3D游戏实时图形渲染框架的设计与实现
下载积分:1250
内容提示:3D游戏实时图形渲染框架的设计与实现
文档格式:PDF|
浏览次数:22|
上传日期: 20:02:43|
文档星级:
该用户还上传了这些文档
3D游戏实时图形渲染框架的设计与实现
官方公共微信重要:在目前市面上常见的游戏引擎中,主要采用以下三种灯光实现方式:
顶点照明渲染路径细节&Vertex Lit Rendering Path Details
正向渲染路径细节&Forward Rendering Path Details
延迟光照渲染路径的细节&Deferred Lighting Rendering Path Details
以unity3d为例,以下将详细讲解三种灯光渲染方式的实现、原理及缺陷。
顶点照明渲染路径细节&Vertex Lit Rendering Path Details
Vertex Lit path generally renders each object in one pass, with lighting from all lights calculated at object vertices.
顶点照明渲染路径通常在一个通道中渲染物体,所有光源的照明都是在物体的顶点上进行计算的。
It's the fastest rendering path and has widest hardware support (however, keep in mind: it does not work on consoles).
顶点照明渲染路径是最快的渲染路径并且有最广泛的硬件支持(然而,请记住:它无法工作在游戏机上)。
Since all lighting is calculated at vertex level, this rendering path does not support most of per-pixel effects: shadows, normal mapping, light cookies, highly detailed specular highlights are not supported.
由于所有的光照都是在顶点层级上计算的,此渲染路径不支持大部分的逐像素渲染效果:如,阴影、法线贴图、灯光遮罩、高精度的高光。
正向渲染路径细节&Forward Rendering Path Details
Forward Rendering path renders each object in one or more passes, depending on lights that affect the object. Lights themselves are also treated differently by Forward Rendering, depending on their settings and intensity.
根据影响物体的光源的不同,正向渲染路径用单个或多个通道来渲染物体。在正向渲染中,光源本身也会根据他们的设置和强度受到不同的对待。
Implementation Details 实现细节
In Forward Rendering, some number of brightest lights that affect each object are rendered in fully per-pixel lit mode. Then, up to 4 point lights are calculated per-vertex. The other lights are computed as Spherical Harmonics (SH), which is much faster but is only an approximation. Whether a light will be per-pixel light or not is dependent on this:
在正向渲染中,影响物体的最亮的几个光源使用逐像素光照模式。接下来,最多有4个点光源会以逐顶点渲染的方式被计算。其他光源将以球面调和(Spherical Harmonics)的方式进行计算,球面调和技术计算很快但只能得到近似值。根据以下的规则判断一个光源是否为逐像素光源:
Lights that have their Render Mode set to&Not Important&are always per-vertex or SH.&
渲染模式被设置为不重要(Not Important)的光源以逐顶点或球面调和的方式进行计算
directional light is always per-pixel.&
最亮的方向光源为像素光源
that have their Render Mode set to&Important&are
always per-pixel.&
渲染模式被设置重要(Important)的光源为像素光源
the above results in less lights than current&Pixel
Light Count&, then more lights are rendered
per-pixel, in order of decreasing brightness.&
如根据以上规则得到的像素光源数量小于质量设置中的像素光源数量(Pixel Light Count),为了减少亮度,会有更多的光源以逐像素的方式进行渲染
of each object happens as follows:
用以下的方法渲染每个物体:
Pass applies one per-pixel directional light and all per-vertex/SH lights.&
基础通道渲染一个逐像素方向光和所有的逐顶点/球面调和光。
per-pixel lights are rendered in additional passes, one pass for each
其他逐像素光在附加的通道中进行渲染,每个光源都需要一个通道
example, if there is some object that's affected by a number of lights (a
circle in a picture below, affected by lights A to H):
例如,如果有一个物体受到若干光源的影响(下图中的圆圈,受到光源A到H的影响)
assume lights A to H have the same color & intensity, all all of them have
Auto rendering mode, so they would be sorted in exactly this order for this
object. The brightest lights will be rendered in per-pixel lit mode (A to D),
then up to 4 lights in per-vertex lit mode (D to G), and finally the rest of
lights in SH (G to H):
假设光源A到H都有相同的颜色和强度,且它们的渲染模式都为自动的(Auto),那么它们严格的按照其名字排序。最亮的光源以逐像素光照模式的方式进行渲染(A到D),然后最多有4个光源以逐顶点光照模式进行渲染(D到G),其他光源以球面调和的方式进行渲染(G到H)。
for example last per-pixel light blends into
per-vertex lit mode so there are less "light popping" as objects and
lights move around.
注意不同的光照组间有重叠,如,最后一个逐像素光源也以逐顶点光照模式的方式渲染,这样能减少当物体和灯光移动时可能出现的"光照跳跃"现象。
Pass 基本通道
pass renders object with one per-pixel directional light and all SH lights.
This pass also adds any lightmaps, ambient and emissive lighting from the
shader. Directional light rendered in this pass can have Shadows. Note that
Lightmapped objects do not get illumination from SH lights.
基础通道用一个逐像素方向光和所有球面调和光渲染物体。此通道还负责渲染着色器中的光照贴图,环境光和自发光。在此通道中渲染的方向光可以产生阴影。需要注意的是,使用了光照贴图的物体不会得到球面调和光的光照。
Additional
Passes 附加通道
Additional
passes are rendered for each additional per-pixel light that affect this
object. Lights in these passes can't have shadows (so in result, Forward
Rendering supports one directional light with shadows).
附加通道用于渲染影响物体的其他逐像素光源。这些通道中渲染的光源无法产生阴影(因此,前向渲染支持一个能产生阴影的方向光)。
Performance
Considerations 性能注意事项
Harmonics lights are&very&fast to render. They have a
tiny cost on the CPU, and are&actually free&for the GPU to apply (that
is, base pass always computes SH but due to the way SH lights work,
the cost is exactly the same no matter how many SH lights are there).
渲染球面调和光很快。它们只花费很少的CPU计算时间,并且实际上无需花费任何GPU计算时间(换言之,基础通道会计算球面调和光照,但由于球面调和光的计算方式,无论有多少球面调和光源,计算它们所花费的时间都是相同的)。
downsides of SH lights are:
球面调和光源的缺点有:
are computed at object's vertices, not pixels. This means they do not
support light Cookies or normal maps.&
它们计算的是物体的顶点而不是像素。这意味着它们不支持投影遮罩和发现贴图。
lighting is very low frequency. You can't have sharp lighting transitions with
SH lights. They are also only affecting the diffuse lighting (too low
frequency for specular highlights).&
球面调和光只有很低的频率。球面调和光不能产生锋利的照明过渡。它们也只会影响散射光照(对高光来说,球面调和光的频率太低了)。
ligh point or spot SH lights close to some surface
will "look wrong".&
球面调和不是局部的,靠近曲面的球面调和点光和聚光可能会"看起来不正确"。
summary, SH lights are often good enough for small dynamic objects.
总的来说,球面调和光的效果对小的动态物体来说已经足够好了。
延迟光照渲染路径的细节&Deferred Lighting Rendering
Path Details
Lighting is rendering path with the most lighting and shadow fidelity:
延迟光照是一种当前最高级的能实现光线和阴影保真的渲染路径
no limit how many lights can affect any object.&
对于能影响任何物体的光线数量没有上限
lights are evaluated per-pixel. Which means that they all interact
properly with normal maps etc.&
完全采用以每像素的方式评估光线,这等于意味着全部将以正常贴图的方式正确的和物体交互
lights can have Cookies.&
所有光线都能拥有信息缓存
lights can have Shadows.&
所有的光线都能产生阴影
Lighting's advantages&延迟光照的优点:
cost is proportional to light size on screen. Does not matter how many
objects it shines on. Small lights = cheap!&
光照的开销与屏幕的光线尺寸成正比,不用担心光线所照射的物品的数量,少量光线
廉价的花费
Consistency.
All lighting for all lights is computed per- there are no lighting
computations that break down on large triangles etc.&
一致性,所有的光线的光照采用按像素为计算分割单位来计算。比如,不会有在大规模三角形情况下光照计算使计算性能发生崩溃的情况发生。
Disadvantages&缺点:
real anti-aliasing support.&
没有实时抗锯齿支持
Lighting can't handle semi-transparent objects. Those are rendered using
Forward Rendering.&
延迟光照不能处理半透明物体,也不能用在哪些使用前向渲染的物体之上
lighting model support (Blinn-Phong). All lighting is computed the same
you can't have drastically different lighting models on different
有限的光照模式支持(Blinn-Phong)。所有光照以同样的方式计算,你不能够在不同的物体上采用完全不同的光照模式
support for "receive shadows" flag and limited support light
Culling Masks.&
没有对接收阴影特征的支持和对光线遮罩剔除有限的支持
Requirements
for Deferred Lighting 延时光照的需求
Requires&Unity Pro.&
需要Unity专业版
card with Shader Model 3.0 (or later), support for Depth render textures
and two-sided stencil buffer. Most graphics cards made after 2004 support
it: GeForce FX and later, Radeon X1300 and later, Intel 965 / GMA X3100
and later.&
显示卡支持Shader Model 3.0(或更高),深度纹理渲染和双面模板缓冲特性。许多2004年后的显卡都支持:如Geforce
Fx或更高,Radeon X1300或更高 Intel 965/ GMA
X3100 或更高
does not work on mobile platforms.&
目前在移动平台不支持。
Performance
Considerations 性能注意事项
of realtime lights in Deferred Lighting is proportional to number of pixels the
and&not&dependent on scene complexity. So
small point or spot lights are very cheap to render. Point or spot lights that
are fully or partially occluded by some scene objects get their pixels skipped
on the GPU, so they are even cheaper.
延迟光照中实时光线的开销和光线照亮的像素值的数量成正比。而不取决于场景的复杂性。微小的点光源和聚光灯光源非常容易渲染。点光源或者完全或者部分被场景物体遮挡的聚光灯光源所照射的像素则被GPU所跳过,因此更加廉价。
course, lights with shadows are much more expensive than lights without
shadows. In Deferred Lighting, shadow casters still need to be rendered once or
more for each shadow-casting light. And the lighting shader that applies
shadows is also more expensive than one without shadows.
当然,拥有阴影的光源比没有阴影的光源要昂贵许多。使用延迟光照,光影投射器仍然需要为每个阴影投射渲染一次或者多次。而且产生阴影的光线着色器也比不产生阴影的光线着色器要昂贵许多。
Implementation
Details 实现细节
When Deferred
Lighting is used, rendering process in Unity happens like this:
当延迟光照生效时,在Unity中发生的渲染过程如下:
Base Pass: objects are
rendered, producing screen-space buffers with depth, normals, and specular
基本渲染:被渲染的对象产生带有深度,法线,和反射量的屏幕空间缓冲
Lighting pass: lighting is
computed using the previous buffers. Lighting is computed into another
screen-space buffer.&
光照渲染:使用上一步的缓冲计算出光照。结果放入另一个屏幕空间缓存
Final pass: objects are
rendered again. They fetch computed lighting, combine it with color textures
and add any ambient/emissive lighting.&
最后渲染:物体再次渲染。取来已经计算好的光线和颜色纹理混合在一起,然后再加上环境光以及散射光照。
with shaders that can't handle Deferred Lighting are rendered after this
process is done, using&&path.
不能采用延迟光照技术的带阴影的物体在延迟光照渲染完后使用前向渲染路径处理。
Pass 基本渲染阶段
pass renders each object once. View space normals and specular power are
rendered into single ARGB32&&(normals in RGB channels, specular power in A). If platform
& hardware supports reading Z buffer as a texture, then depth is not
explicitly rendered. If Z buffer can't be accessed as a texture, then depth is
rendered in additional rendering pass, using&.
基本渲染将每个物体都渲染一次。视图空间法线和高光强度被渲染进单一的ARGB32渲染纹理(法线在RGB通道,高光强度在A通道)中。如果平台和硬件支持将Z缓冲按纹理读取,那么深度不会被明确的渲染。如果Z缓冲不能被以纹理的方式访问,那么深度将在额外的渲染处理中被使用着色器替代技术渲染。
of the base pass is Z buffer filled with scene contents and Render Texture with
normals & specular power.
基本渲染的结果是被屏幕内容填满的Z缓冲和带有法线和高光强度的渲染纹理。
Pass 光照渲染阶段
pass computes lighting based on depth, normals and specular power. Lighting is
computed in screen space, so it's independent of scene complexity. Lighting
buffer is single ARGB32 Render Texture, with diffuse lighting in RGB channels
and monochrome specular lighting in A channel. Lighting values are encoded
using logarithmic encoding to provide extended dynamic range than usually
possible with ARGB32 texture.
光照渲染基于深度,法线和高光强度计算光照。光照是被屏幕空间被计算的,因此和屏幕复杂性无关。光照缓冲是一个单一的ARGGB32渲染纹理,纹理的RGB通道带有漫反射的光照信息,在A通道带有单一特定颜色的光照。光照值采用对数值编码以产生比通常ARGB32纹理所能达到的动态扩展范围。
model is fixed to Blinn-Phong.
光照模式固定为Blinn-Phong。
and Spot lights that do not cross camera's near plane are rendered as 3D
shapes, with Z buffer test against scene enabled. This makes partially or fully
occluded Point and Spot lights very cheap to render. Directional lights and
Point/Spot lights that cross the near plane are rendered as fullscreen quads.
不能跨越临近平面的点光源和聚光灯光源被作为带有开启测试场景的Z缓冲3D形状渲染,这部分和完全屏蔽的点光源和聚光灯光源可以非常廉价的渲染。 跨越临近区域的平行光或者点光源能作为全屏四边形。
light has shadows enabled, they are rendered and applies in this pass as well.
Note that shadows are not "free"; shadow casters need to be rendered
and a more complex light shader needs to be applied.
如果一个带有阴影的光源生效,在这个处理过程中会被很好的渲染。注意阴影并不免费,阴影投射器需要开销来渲染,同时一个更加复杂的光线着色器需要应用。
Pass 最后渲染阶段
pass produces final rendered image. Here all object with
shaders that fetch the lighting, combine it with textures and add any emissive
are also applied in the final pass. Close to the camera, realtime lighting is
used, and only baked indirect lighting is added. This crossfades into fully
baked lighting further away from the camera.
最终渲染阶段产生最后渲染后的图像,到这一步,所有的对象都将被再次渲染,其中着色器将混合前一步生成的光源和纹理以及所有自发光照明。
在最后渲染阶段光照贴图也被应用。靠近相机,使用实时光照,并仅烘焙间接光照。
其他:lightingmap 烘焙贴图不在及时光的技术范围内。烘焙灯光是通过贴图记录光照信息来模拟固定的光照效果,场景中本身不包含及时灯光。
Rendering Paths Comparison 渲染路径比较
Deferred Lighting&延时光照
Forward Rendering&正向渲染
Vertex Lit&顶点光照
Features 功能
Per-pixel lighting (normal maps, light cookies)每像素计算光照(法线贴图、灯光cookies)
Realtime shadows&实时阴影
1 Directional Light(一盏平行光)
Dual Lightmaps&双光照贴图
Depth&Normals Buffers&深度与法线缓冲区
Additional render passes&额外渲染通道
Soft Particles&软粒子
Semitransparent objects&半透明的物体
Anti-Aliasing&抗锯齿
Light Culling Masks&灯光剔除蒙板
Lighting Fidelity&光照保真度
All per-pixel&全部像素
Some per-pixel&某些像素
All per-vertex&所有顶点
Performance 性能
Cost of a per-pixel Light&每像素光照的花费
Number of pixels it illuminates照亮的像素数
Number of pixels * Number of objects it illuminates像素数*照亮的像素数
Platform Support 支持平台
PC (Windows/Mac)&台式机
Shader Model 3.0+
Shader Model 2.0+
Mobile (iOS/Android)&移动设备
OpenGL ES 2.0
OpenGL ES 2.0 & 1.1
Consoles &(游戏)平台
阅读(...) 评论()

我要回帖

更多关于 2d游戏和3d游戏区别 的文章

 

随机推荐