例子程序

From KlayGE
Revision as of 02:04, 11 December 2010 by Gongminmin (Talk | contribs)

Jump to: navigation, search

注意

如果要在没有安装Microsoft Visual C++ 2010的机器上运行二进制版本的例子,需要事先安装Microsoft Visual C++ 2010 Redistributable Package。

  • x86版本可以从[1]下载。
  • x64版本可以从[2]下载。

Deferred Shading

Deferred shading渲染框架。

技术点

  1. Deferred Lighting
  2. SSAO
  3. Adaptive Anti-alias
  4. 任意光源
  5. Soft shadow

需求

  • Geforce 6600以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL。

Depth peeling

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

技术点

  1. Depth peeling
  2. MRT
  3. UI

需求

  • Geforce 6600以上或Radeon 9500以上。

渲染引擎支持 D3D11/OpenGL。

Distance mapping

GPU Gems 2第八章中提到的distance mapping。在pixel shader中根据预处理的距离场进行局部球面光线跟踪。这里我做的扩展是可以表现出边缘的轮廓。

技术点

  1. Distance mapping
  2. 轮廓检测
  3. Normal map压缩 (3.4.0之后)

需求

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

渲染引擎支持

  • D3D11/OpenGL。

Fractal

在GPU中计算分形图形。

技术点

  1. 双缓存切换

需求

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

渲染引擎支持

  • D3D11/OpenGL/OpenGLES2。

GPU Particle System

基于GPU的粒子系统。

技术点

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

需求

  • Geforce 6以上或Radeon HD2400以上。

渲染引擎支持 D3D11/OpenGL。

JudaTex Viewer

Juda Texture查看器。

技术点

  1. Juda Texture
  2. 鼠标交互

需求

  • Geforce FX以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL。

Model viewer

一个MeshML模型查看器,支持Skinned mesh和Normal map。初始模型来自于http://www.cgrealm.cn。

技术点

  1. GPU骨骼动画
  2. 模型格式的读取
  3. Normal map的渲染
  4. UI

需求

  • Geforce FX以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES2。

Motion 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。

Ocean

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

技术点

  1. 水面渲染
  2. Compute shader
  3. GPU上的FFT
  4. 反射贴图
  5. 镜头眩光

需求

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

渲染引擎支持

  • D3D11/OpenGL。

Parallax

Parallax mapping,扩展了normal map技术。

技术点

  1. Parallax mapping
  2. Normal map压缩 (KlayGE 3.4.0之后)

需求

  • Geforce FX以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES2。

已知问题

  • 在ATI的卡上OpenGL插件显示全黑。

Particle Editor

粒子系统编辑器

技术点

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

需求

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

渲染引擎支持

  • D3D11/OpenGL。

PNTriangles

用D3D11的Tessellator实现了Curved PN Triangles,把低模在运行期细分成高模曲面。

技术点

  1. PN Triangles算法
  2. Tessellation
  3. Hull Shader/Domain Shader

需求

  • Geforce GTX 4系列以上或RadeonHD 5系列以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES2。

PostProcessing

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

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

技术点

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

需求

  • Geforce 6600以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL。

ProceduralTex

在GPU上使用Perlin noise来产生多种Procedural texture

技术点

  1. Perlin noise
  2. Procedural texture

需求

  • Geforce FX以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES2。

Refract

折射的演示。支持Fresnel和色散现象。

技术点

  1. 反射、折射和Fresnel
  2. 色散
  3. HDR渲染
  4. Tone mapping
  5. HDR纹理压缩
  6. 双面折射

需求

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

渲染引擎支持

  • D3D11/OpenGL。

Shadow cube map

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

技术点

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

需求

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

渲染引擎支持

  • D3D11/OpenGL。

Sub-surface

次表面散射的实时渲染。

技术点

  1. 次表面散射
  2. Bump map

需求

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

渲染引擎支持

  • D3D11/OpenGL。

Text

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

技术点

  1. Font

需求

  • Geforce FX以上或Radeon 9500以上。

渲染引擎支持

  • D3D11/OpenGL/OpenGLES2。

Vertex displacement

在vertex shader中用sin计算顶点和法线的偏移。

技术点

  1. 顶点偏移
  2. 通过导函数直接计算法线

需求

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

渲染引擎支持

  • D3D11/OpenGL/OpenGLES2。

Video texture

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

技术点

  1. DirectShow解码到纹理

需求

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

渲染引擎支持

  • D3D11/OpenGL/OpenGLES2。

已知问题

  • 在D3D11中无法全屏。