Difference between revisions of "例子程序"

From KlayGE
Jump to: navigation, search
 
(6 intermediate revisions by one user not shown)
Line 1: Line 1:
''' 注意 '''
+
在第一次执行之前,建议先运行引擎提供的[[KGEConfig]]来完成配置。
  
如果要在没有安装Microsoft Visual C++ 2010的机器上运行二进制版本的例子,需要事先安装Microsoft Visual C++ 2010 Redistributable Package。
+
= Area Lighting =
*x86版本可以从[http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=a7b7a05e-6de6-4d3a-a423-37bf0912db84]下载。
+
[[File:AreaLighting.jpg|200px|thumb|right|Area Lighting]]
*x64版本可以从[http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=bd512d9e-43c8-4655-81bf-9350143d5867]下载。
+
实时球形和管形面光源光照。
  
在第一次执行之前,建议先运行引擎提供的[[KGEConfig]]来完成配置。
+
'''难度'''
 +
 +
 
 +
'''技术'''
 +
#面光源
 +
 
 +
'''需求'''
 +
*Geforce 6600以上或Radeon 9500以上。
 +
 
 +
'''渲染引擎支持'''
 +
*D3D11/OpenGL/OpenGLES。
  
 
= Atmospheric Scattering =
 
= Atmospheric Scattering =
 
[[File:AtmosphericScattering.jpg|200px|thumb|right|Atmospheric Scattering]]
 
[[File:AtmosphericScattering.jpg|200px|thumb|right|Atmospheric Scattering]]
基于物理的大气散射,可以模拟各种密度和各种厚度的大气状况。
+
基于物理的大气散射,可以模拟各种密度和各种吸收率的大气状况。
  
 
'''难度'''
 
'''难度'''
Line 21: Line 31:
  
 
''' 渲染引擎支持 '''
 
''' 渲染引擎支持 '''
*D3D11/OpenGL。
+
*D3D11/OpenGL/OpenGLES。
 +
 
 +
= Cascaded Shadow Map =
 +
[[File:CascadedShadowMap.jpg|200px|thumb|right|Cascaded Shadow Map]]
 +
两种高质量的大范围阴影渲染。
 +
 
 +
'''难度'''
 +
 +
 
 +
''' 技术点 '''
 +
#PSSM
 +
#SDSM
 +
 
 +
''' 需求 '''
 +
*Geforce 6600以上或Radeon 9500以上。
 +
 
 +
''' 渲染引擎支持 '''
 +
*D3D11/OpenGL/OpenGLES。
  
 
= Caustics Map =
 
= Caustics Map =
Line 39: Line 66:
  
 
''' 渲染引擎支持 '''
 
''' 渲染引擎支持 '''
*D3D11/OpenGL。
+
*D3D11/OpenGL/OpenGLES。
  
 
= Deferred Rendering =
 
= Deferred Rendering =
Line 61: Line 88:
  
 
''' 渲染引擎支持 '''
 
''' 渲染引擎支持 '''
*D3D11/OpenGL/OpenGLES2。
+
*D3D11/OpenGL/OpenGLES。
 
+
= Depth peeling =
+
[[File:Depthpeeling.jpg|200px|thumb|right|Depth Peeling]]
+
顺序无关的透明物体渲染。
+
 
+
'''难度'''
+
+
 
+
'''技术点'''
+
#Depth peeling
+
#MRT
+
#UI
+
 
+
'''需求'''
+
*Geforce 6600以上或Radeon 9500以上。
+
 
+
'''渲染引擎支持'''
+
*D3D11/OpenGL/OpenGLES2。
+
  
 
= Detailed surface =
 
= Detailed surface =
Line 97: Line 106:
 
'''需求'''
 
'''需求'''
 
*Geforce FX以上或Radeon 9500以上。
 
*Geforce FX以上或Radeon 9500以上。
 +
 +
'''渲染引擎支持'''
 +
*D3D11/OpenGL/OpenGLES。
 +
 +
= Env Lighting =
 +
[[File:EnvLighting.jpg|200px|thumb|right|Env Lighting]]
 +
实时基于物理的环境光照。
 +
 +
'''难度'''
 +
 +
 +
'''技术'''
 +
#环境光源
 +
 +
'''需求'''
 +
*Geforce 6600以上或Radeon 9500以上。
  
 
'''渲染引擎支持'''
 
'''渲染引擎支持'''
Line 117: Line 142:
  
 
'''渲染引擎支持'''
 
'''渲染引擎支持'''
*D3D11/OpenGL/OpenGLES2。
+
*D3D11/OpenGL/OpenGLES。
  
 
= GPU Particle System =
 
= GPU Particle System =
Line 136: Line 161:
  
 
'''渲染引擎支持'''
 
'''渲染引擎支持'''
*D3D11/OpenGL。
+
*D3D11/OpenGL/OpenGLES。
  
 
= JudaTex Viewer =
 
= JudaTex Viewer =
Line 153: Line 178:
  
 
'''渲染引擎支持'''
 
'''渲染引擎支持'''
*D3D11/OpenGL/OpenGLES2。
+
*D3D11/OpenGL/OpenGLES。
 
+
= Model viewer =
+
[[File:Model_viewer.jpg|200px|thumb|right|Model Viewer]]
+
一个MeshML模型查看器,支持Skinned mesh、Normal map和PN Triangles。
+
 
+
'''难度'''
+
+
 
+
'''技术点'''
+
#GPU骨骼动画
+
#模型格式的读取
+
#Normal map的渲染
+
#PN Triangles算法
+
#D3D11 hardware tessellation
+
#Instanced tessellation
+
#Hull Shader/Domain Shader
+
 
+
'''需求'''
+
*Geforce FX以上或Radeon 9500以上。
+
 
+
'''渲染引擎支持'''
+
*D3D11/OpenGL/OpenGLES2。
+
  
 
= Motion Blur and Depth of Field =
 
= Motion Blur and Depth of Field =
Line 196: Line 199:
  
 
'''渲染引擎支持'''
 
'''渲染引擎支持'''
*D3D11/OpenGL/OpenGLES2。
+
*D3D11/OpenGL/OpenGLES。
  
 
= Ocean =
 
= Ocean =
Line 218: Line 221:
  
 
'''渲染引擎支持'''
 
'''渲染引擎支持'''
*D3D11/OpenGL/OpenGLES2。
+
*D3D11/OpenGL/OpenGLES。
 +
 
 +
= Order Independent Transparency =
 +
[[File:OIT.jpg|200px|thumb|right|OIT]]
 +
多种顺序无关的透明物体渲染。
 +
 
 +
'''难度'''
 +
 +
 
 +
'''技术点'''
 +
#Depth peeling
 +
#Per-pixel linked lists
 +
#Adaptive transparency
 +
 
 +
'''需求'''
 +
*Geforce 6600以上或Radeon 9500以上。
 +
 
 +
'''渲染引擎支持'''
 +
*D3D11/OpenGL/OpenGLES。
  
 
= Particle Editor =
 
= Particle Editor =
Line 237: Line 258:
  
 
'''渲染引擎支持'''
 
'''渲染引擎支持'''
*D3D11/OpenGL/OpenGLES2。
+
*D3D11/OpenGL/OpenGLES。
  
= PostProcessing =
+
= Post Processing =
 
[[File:Postprocessing.jpg|200px|thumb|right|Post Processing]]
 
[[File:Postprocessing.jpg|200px|thumb|right|Post Processing]]
 
演示[[后处理]]的能力。支持的特效有:
 
演示[[后处理]]的能力。支持的特效有:
Line 257: Line 278:
 
#Cartoon post process
 
#Cartoon post process
 
#深度和法线间断点的查找
 
#深度和法线间断点的查找
#MRT
 
  
 
'''需求'''
 
'''需求'''
Line 263: Line 283:
  
 
'''渲染引擎支持'''
 
'''渲染引擎支持'''
*D3D11/OpenGL。
+
*D3D11/OpenGL/OpenGLES。
  
= ProceduralTex =
+
= Scene Player =
[[File:Proceduraltex.jpg|200px|thumb|right|Procedural Texture]]
+
[[File:ScenePlayer.jpg|200px|thumb|right|Scene Player]]
在GPU上使用Perlin noise来产生多种[[Procedural texture]]。
+
场景播放器,可以执行预定义的动态场景。
  
 
'''难度'''
 
'''难度'''
容易
+
  
 
'''技术点'''
 
'''技术点'''
#Perlin noise
+
#Python脚本
#[[Procedural texture]]
+
#[[延迟渲染]]
  
 
'''需求'''
 
'''需求'''
*Geforce FX以上或Radeon 9500以上。
+
*Geforce 6600以上或Radeon 9500以上。
  
 
'''渲染引擎支持'''
 
'''渲染引擎支持'''
*D3D11/OpenGL/OpenGLES2。
+
*D3D11/OpenGL/OpenGLES。
 +
 
 +
= Reflection =
 +
[[File:Reflection.jpg|200px|thumb|right|Reflection]]
 +
屏幕空间实时反射。
 +
 
 +
'''难度'''
 +
 +
 
 +
'''技术点'''
 +
#双方向SSR
 +
 
 +
'''需求'''
 +
*Geforce 6600以上或Radeon 9500以上。
 +
 
 +
'''渲染引擎支持'''
 +
*D3D11/OpenGL/OpenGLES。
  
 
= Shadow cube map =
 
= Shadow cube map =
Line 298: Line 334:
  
 
'''渲染引擎支持'''
 
'''渲染引擎支持'''
*D3D11/OpenGL/OpenGLES2。
+
*D3D11/OpenGL/OpenGLES。
 +
 
 +
= Shadow cube map =
 +
[[File:Shadowcubemap.jpg|200px|thumb|right|Shadow cube map]]
 +
把传统的shadow map扩展到cube map上,模拟了全方向的点光源和光源的投射。另一个改进是加入了[[Variance shadow map]]。
 +
 
 +
'''难度'''
 +
 +
 
 +
'''技术点'''
 +
*全方向的shadow map
 +
*VSM
 +
*纹理投射
 +
 
 +
'''需求'''
 +
*Geforce FX 5600以上或Radeon 9500以上。推荐使用Geforce 6以上。
 +
 
 +
'''渲染引擎支持'''
 +
*D3D11/OpenGL/OpenGLES。
 +
 
 +
= SSSSS =
 +
[[File:SSSSS.jpg|200px|thumb|right|Screen space sub surface scattering]]
 +
屏幕空间[[次表面散射]]的半透明。
 +
 
 +
'''难度'''
 +
 +
 
 +
'''技术点'''
 +
#[[SSSSS]]
 +
#[[次表面散射]]
 +
 
 +
'''需求'''
 +
*Geforce 6以上或Radeon 9500以上。
 +
 
 +
'''渲染引擎支持'''
 +
*D3D11/OpenGL/OpenGLES。
  
 
= Sub-surface =
 
= Sub-surface =
Line 315: Line 386:
  
 
'''渲染引擎支持'''
 
'''渲染引擎支持'''
*D3D11/OpenGL/OpenGLES2。
+
*D3D11/OpenGL/OpenGLES。
  
 
= Text =
 
= Text =
Line 331: Line 402:
  
 
'''渲染引擎支持'''
 
'''渲染引擎支持'''
*D3D11/OpenGL/OpenGLES2。
+
*D3D11/OpenGL/OpenGLES。
  
 
= Video texture =
 
= Video texture =
Line 347: Line 418:
  
 
'''渲染引擎支持'''
 
'''渲染引擎支持'''
*D3D11/OpenGL/OpenGLES2。
+
*D3D11/OpenGL/OpenGLES。
  
 
'''已知问题'''
 
'''已知问题'''

Latest revision as of 00:35, 25 December 2014

在第一次执行之前,建议先运行引擎提供的KGEConfig来完成配置。

Area Lighting

Area Lighting

实时球形和管形面光源光照。

难度

技术

  1. 面光源

需求

  • Geforce 6600以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

Atmospheric Scattering

Atmospheric Scattering

基于物理的大气散射,可以模拟各种密度和各种吸收率的大气状况。

难度

技术点

  1. 大气散射

需求

  • Geforce 6600以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

Cascaded Shadow Map

Cascaded Shadow Map

两种高质量的大范围阴影渲染。

难度

技术点

  1. PSSM
  2. SDSM

需求

  • Geforce 6600以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

Caustics Map

Caustics Map

实时焦散生成。

难度

技术点

  1. Caustics
  2. 双面折射
  3. 全方向的shadow map

需求

  • Geforce 6600以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

Deferred Rendering

Deferred Rendering

Deferred rendering渲染框架。

难度

技术点

  1. Deferred Rendering
  2. GI
  3. SSVO
  4. FXAA
  5. 任意光源
  6. Soft shadow
  7. 文件打包系统

需求

  • Geforce 6600以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

Detailed surface

Detailed Surface

多种带细节的表面渲染技术。

难度 容易

技术点

  1. Bump mapping
  2. Parallax mapping
  3. Parallax occlusion mapping
  4. Displacement mapping
  5. Normal map压缩 (KlayGE 3.4.0之后)

需求

  • Geforce FX以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

Env Lighting

Env Lighting

实时基于物理的环境光照。

难度

技术

  1. 环境光源

需求

  • Geforce 6600以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

Global Illumination

Global Illumination

基于Splatting Indirect Illumination的实时全局光照。

难度

技术点

  1. Realtime GI
  2. Deferred Rendering
  3. Soft shadow

需求

  • Geforce 6以上或Radeon HD2400以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

GPU Particle System

GPU Particle System

基于GPU的粒子系统。

难度

技术点

  1. 粒子系统
  2. GPU多遍计算
  3. Vertex texture fetch
  4. Deferred particle

需求

  • Geforce 6以上或Radeon HD2400以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

JudaTex Viewer

Juda Texture Viewer

Juda texture查看器。

难度

技术点

  1. Juda texture
  2. 鼠标交互

需求

  • Geforce FX以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

Motion Blur and Depth of Field

Mition Blur and Depth of Field

运动模糊景深post process。可以调节焦平面和焦距范围。并演示了引擎中的instancing实现。在硬件支持instancing的时候会自动切换到硬件实现,否则使用CPU解开instance数据。

难度

技术点

  1. Motion Blur
  2. Depth of field
  3. Summed-Area Table
  4. 软件/硬件instancing
  5. Script engine
  6. UI

需求

  • Geforce 6600以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

Ocean

Ocean

演示水面的渲染。水面的运动通过在GPU上实时地做FFT来模拟。核心来自于NVIDIA的Demo。

难度

技术点

  1. 水面渲染
  2. Compute shader
  3. GPU上的FFT
  4. 反射贴图
  5. 镜头眩光
  6. 文件打包系统

需求

  • Geforce 6以上或Radeon HD2400以上。实时编辑需要Geforce 8以上或Radeon HD4以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

Order Independent Transparency

OIT

多种顺序无关的透明物体渲染。

难度

技术点

  1. Depth peeling
  2. Per-pixel linked lists
  3. Adaptive transparency

需求

  • Geforce 6600以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

Particle Editor

Particle Editor

粒子系统编辑器

难度

技术点

  1. 粒子系统
  2. 复杂的UI
  3. Soft particle
  4. Geometry shader

需求

  • Geforce FX以上或Radeon 9500以上。推荐使用Geforce 6以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

Post Processing

Post Processing

演示后处理的能力。支持的特效有:

  • Ascii Arts,把渲染的图像拟合成ascii字符的表示。
  • 卡通渲染。使用两遍的方法,第一遍得出几何位置,第二遍进行光照和勾边。
  • Tiling,砖块的效果。
  • HDR。
  • Night Vision,模拟夜视仪看到的效果。
  • Old Fashion,老照片效果。

难度

技术点

  1. post process
  2. 用GPU进行ascii匹配
  3. Cartoon post process
  4. 深度和法线间断点的查找

需求

  • Geforce 6600以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

Scene Player

Scene Player

场景播放器,可以执行预定义的动态场景。

难度

技术点

  1. Python脚本
  2. 延迟渲染

需求

  • Geforce 6600以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

Reflection

Reflection

屏幕空间实时反射。

难度

技术点

  1. 双方向SSR

需求

  • Geforce 6600以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

Shadow cube map

Shadow cube map

把传统的shadow map扩展到cube map上,模拟了全方向的点光源和光源的投射。另一个改进是加入了Variance shadow map

难度

技术点

  • 全方向的shadow map
  • VSM
  • 纹理投射

需求

  • Geforce FX 5600以上或Radeon 9500以上。推荐使用Geforce 6以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

Shadow cube map

Shadow cube map

把传统的shadow map扩展到cube map上,模拟了全方向的点光源和光源的投射。另一个改进是加入了Variance shadow map

难度

技术点

  • 全方向的shadow map
  • VSM
  • 纹理投射

需求

  • Geforce FX 5600以上或Radeon 9500以上。推荐使用Geforce 6以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

SSSSS

Screen space sub surface scattering

屏幕空间次表面散射的半透明。

难度

技术点

  1. SSSSS
  2. 次表面散射

需求

  • Geforce 6以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

Sub-surface

Sub-surface

次表面散射的实时渲染。

难度

技术点

  1. 次表面散射
  2. Bump map

需求

  • Geforce FX 5600以上或Radeon 9500以上。推荐使用Geforce 6以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

Text

Text

演示了基于signed distance field的字体显示方法

难度 容易

技术点

  1. Font

需求

  • Geforce FX以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

Video texture

Video Texture

演示了Show engine,解码后的视频作为纹理贴到3D物体上。其中用到的视频来自开源电影Big Buck Bunny

难度 容易

技术点

  1. DirectShow解码到纹理

需求

  • Geforce 4 Ti以上或Radeon 9200以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES。

已知问题

  • 在D3D11中无法全屏。