Difference between revisions of "Samples"

From KlayGE
Jump to: navigation, search
 
(32 intermediate revisions by 2 users not shown)
Line 1: Line 1:
'''Note'''
+
Before running these samples for the first time, it's recommended to run [[KGEConfig/en|KGEConfig]], to complete the configuration first.
If you want to run samples on a PC without Microsoft Visual C++ 2010 installed, you need to install Microsoft Visual C++ 2010 Redistributable Package first.
+
*Vcredist x86 can be downloaded from [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=a7b7a05e-6de6-4d3a-a423-37bf0912db84].
+
*Vcredist x64 can be downloaded from [http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=bd512d9e-43c8-4655-81bf-9350143d5867].
+
  
Before running these samples for the first time, it's recommended to run [[KConfig]], which is provided by [[KlayGE]], to complete the configuration first.
+
= Area Lighting =
 +
[[File:AreaLighting.jpg|200px|thumb|right|Area Lighting]]
 +
Real-time sphere and tube area lighting.
  
= Deferred Rendering =
+
'''Techniques'''
[[File:Deferredrendering.jpg|200px|thumb|right|Deferred Rendering]]
+
#Area Lighting
Deferred rendering rendering framework.
+
 
 +
'''Requirements'''
 +
*Geforce 6600+ or Radeon 9500+.
 +
 
 +
'''Rendering plugin supported'''
 +
*D3D11/OpenGL/OpenGLES.
 +
 
 +
= Atmospheric Scattering =
 +
[[File:AtmosphericScattering.jpg|200px|thumb|right|Atmospheric Scattering]]
 +
Physically-based atmospheric scattering. It can simulate atmospheric in different density and absorption.
  
 
'''Techniques'''
 
'''Techniques'''
#Deferred Rendering
+
#Atmospheric scattering
#SSAO
+
#Adaptive Anti-alias
+
#Arbitrary light source
+
#Soft shadow
+
#[[Packing System]]
+
  
 
'''Requirements'''
 
'''Requirements'''
Line 22: Line 25:
  
 
'''Rendering plugin supported'''
 
'''Rendering plugin supported'''
*D3D11/OpenGL.
+
*D3D11/OpenGL/OpenGLES.
  
= Depth peeling =
+
= Cascaded Shadow Map =
[[File:Depthpeeling.jpg|200px|thumb|right|Depth Peeling]]
+
[[File:CascadedShadowMap.jpg|200px|thumb|right|Cascaded Shadow Map]]
Order independent transparency rendering.
+
Two kinds of high quality large-scale shadow rendering.
  
 
'''Techniques'''
 
'''Techniques'''
#Depth peeling
+
#PSSM
#MRT
+
#SDSM
#UI
+
  
 
'''Requirements'''
 
'''Requirements'''
Line 37: Line 39:
  
 
'''Rendering plugin supported'''
 
'''Rendering plugin supported'''
*D3D11/OpenGL.
+
*D3D11/OpenGL/OpenGLES.
  
= Distance mapping =
+
= Caustics Map =
[[File:Distancemapping.jpg|200px|thumb|right|Distancemapping]]
+
[[File:CausticsMap.jpg|200px|thumb|right|Caustics Map]]
Distance mapping from [http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter08.html chapter 8 of GPU Gems 2]. In pixel shader, precomputed distance field is used to do local sphere ray tracing. The extension here is the silhouette can be presented well.
+
Realtime caustics generation.
  
 
'''Techniques'''
 
'''Techniques'''
#Distance mapping
+
#Caustics
#Silhouette detection
+
#Dual-face Refraction
#Normal map compression (since 3.4.0)
+
#Omnidirectional shadow map
  
 
'''Requirements'''
 
'''Requirements'''
*Geforce FX+ or Radeon 9500+. Geforce 6+ recommanded.
+
*Geforce 6600+ or Radeon 9500+.
  
 
'''Rendering plugin supported'''
 
'''Rendering plugin supported'''
*D3D11/OpenGL.
+
*D3D11/OpenGL/OpenGLES.
  
= Fractal =
+
= Deferred Rendering =
[[File:Fractal.jpg|200px|thumb|right|Fractal]]
+
[[File:Deferredrendering.jpg|200px|thumb|right|Deferred Rendering]]
Calculate fractal on GPUs.
+
Deferred rendering rendering framework.
  
 
'''Techniques'''
 
'''Techniques'''
#Ping-pong buffers
+
#Deferred Rendering
 +
#[[Global illumination|GI]]
 +
#SSVO
 +
#[[FXAA/en|FXAA]]
 +
#Arbitrary light source
 +
#Soft shadow
 +
#[[Packing system]]
  
 
'''Requirements'''
 
'''Requirements'''
*Geforce FX+ or Radeon 9500+. Geforce 6+ recommanded.
+
*Geforce 6600+ or Radeon 9500+.
 +
 
 +
'''Rendering plugin supported'''
 +
*D3D11/OpenGL/OpenGLES.
 +
 
 +
= Detailed surface =
 +
[[File:DetailedSurface.jpg|200px|thumb|right|Detailed Surface]]
 +
Multiple detailed surface rendering techniques.
 +
 
 +
'''Techniques'''
 +
#Bump mapping
 +
#Parallax mapping
 +
#Parallax occlusion mapping
 +
#Displacement mapping
 +
#Normal map compression (since [[KlayGE/en|KlayGE]] 3.4.0)
 +
 
 +
'''Requirements'''
 +
*Geforce FX+ or Radeon 9500+.
 +
 
 +
'''Rendering plugin supported'''
 +
*D3D11/OpenGL/OpenGLES.
 +
 
 +
'''Known issues'''
 +
*The texture is not right in OpenGL plugin on ATI's card.
 +
 
 +
= Env Lighting =
 +
[[File:EnvLighting.jpg|200px|thumb|right|Env Lighting]]
 +
Real-time physically based environment lighting.
 +
 
 +
'''Techniques'''
 +
#Environment Lighting
 +
 
 +
'''Requirements'''
 +
*Geforce 6600+ or Radeon 9500+.
  
 
'''Rendering plugin supported'''
 
'''Rendering plugin supported'''
*D3D11/OpenGL/OpenGLES2.
+
*D3D11/OpenGL/OpenGLES.
  
 
= Global Illumination =
 
= Global Illumination =
Line 80: Line 121:
  
 
'''Rendering plugin supported'''
 
'''Rendering plugin supported'''
D3D11/OpenGL.
+
*D3D11/OpenGL/OpenGLES.
  
 
= GPU Particle System =
 
= GPU Particle System =
Line 96: Line 137:
  
 
'''Rendering plugin supported'''
 
'''Rendering plugin supported'''
D3D11/OpenGL.
+
*D3D11/OpenGL/OpenGLES.
  
 
= JudaTex Viewer =
 
= JudaTex Viewer =
Line 110: Line 151:
  
 
'''Rendering plugin supported'''
 
'''Rendering plugin supported'''
*D3D11/OpenGL.
+
*D3D11/OpenGL/OpenGLES.
 
+
= Model viewer =
+
[[File:Model_viewer.jpg|200px|thumb|right|Model Viewer]]
+
A MeshML model viewer, which support skinned mesh and normal map. The model is from http://www.cgrealm.cn.
+
 
+
'''Techniques'''
+
#GPU skinning
+
#MeshML reading
+
#Normal map rendering
+
#UI
+
 
+
'''Requirements'''
+
*Geforce FX+ or Radeon 9500+.
+
 
+
'''Rendering plugin supported'''
+
*D3D11/OpenGL/OpenGLES2.
+
  
 
= Motion Blur and Depth of Field =
 
= Motion Blur and Depth of Field =
Line 133: Line 158:
  
 
'''Techniques'''
 
'''Techniques'''
#[[Motion Blur]]
+
#[[Motion blur]]
 
#[[Depth of field]]
 
#[[Depth of field]]
 
#Summed-Area Table
 
#Summed-Area Table
Line 144: Line 169:
  
 
'''Rendering plugin supported'''
 
'''Rendering plugin supported'''
*D3D11/OpenGL.
+
*D3D11/OpenGL/OpenGLES.
  
 
= Ocean =
 
= Ocean =
Line 157: Line 182:
 
#Fog
 
#Fog
 
#Lens flare
 
#Lens flare
#[[Packing System]]
+
#[[Packing system]]
  
 
'''Requirements'''
 
'''Requirements'''
Line 163: Line 188:
  
 
'''Rendering plugin supported'''
 
'''Rendering plugin supported'''
*D3D11/OpenGL.
+
*D3D11/OpenGL/OpenGLES.
  
= Parallax =
+
= Order Independent Transparency =
[[File:Parallax.jpg|200px|thumb|right|Parallax]]
+
[[File:OIT.jpg|200px|thumb|right|OIT]]
Parallax mapping, extend from normal map.
+
Order independent transparency rendering.
  
 
'''Techniques'''
 
'''Techniques'''
#Parallax mapping
+
#Depth peeling
#Normal map compression (since [[KlayGE]] 3.4.0)
+
#Per-pixel linked lists
 +
#Adaptive transparency
  
 
'''Requirements'''
 
'''Requirements'''
*Geforce FX+ or Radeon 9500+.
+
*Geforce 6600+ or Radeon 9500+.
  
 
'''Rendering plugin supported'''
 
'''Rendering plugin supported'''
*D3D11/OpenGL/OpenGLES2.
+
*D3D11/OpenGL/OpenGLES.
 
+
'''Known issues'''
+
*The texture is not right in OpenGL plugin on ATI's card.
+
  
 
= Particle Editor =
 
= Particle Editor =
Line 193: Line 216:
  
 
'''Requirements'''
 
'''Requirements'''
*Geforce FX+ or Radeon 9500+. Geforce 6+ recommanded.
+
*Geforce FX+ or Radeon 9500+. Geforce 6+ recommended.
  
 
'''Rendering plugin supported'''
 
'''Rendering plugin supported'''
*D3D11/OpenGL.
+
*D3D11/OpenGL/OpenGLES.
 
+
= PNTriangles =
+
[[File:Pn_triangles.jpg|200px|thumb|right|PNTriangles]]
+
Implement Curved PN Triangles algorithm by D3D11's tessellator. Low-poly model is tessellated to high-poly model at runtime.
+
 
+
'''Techniques'''
+
#PN Triangles algorithm
+
#Tessellation
+
#Hull Shader/Domain Shader
+
 
+
'''Requirements'''
+
*Geforce GTX 4xx+ or RadeonHD 5xxx+.
+
 
+
'''Rendering plugin supported'''
+
*D3D11/OpenGL/OpenGLES2.
+
  
 
= PostProcessing =
 
= PostProcessing =
Line 234: Line 242:
  
 
'''Rendering plugin supported'''
 
'''Rendering plugin supported'''
*D3D11/OpenGL.
+
*D3D11/OpenGL/OpenGLES.
  
= ProceduralTex =
+
= Procedural texture =
 
[[File:Proceduraltex.jpg|200px|thumb|right|Procedural Texture]]
 
[[File:Proceduraltex.jpg|200px|thumb|right|Procedural Texture]]
Various [[procedural texture]] generation by perlin noise on GPUs.
+
Various [[procedural texture]] generation by simplex noise on GPUs.
  
 
'''Techniques'''
 
'''Techniques'''
Line 248: Line 256:
  
 
'''Rendering plugin supported'''
 
'''Rendering plugin supported'''
*D3D11/OpenGL/OpenGLES2.
+
*D3D11/OpenGL/OpenGLES.
  
= Refract =
+
= Reflection =
[[File:Refract.jpg|200px|thumb|right|Refract]]
+
[[File:Reflection.jpg|200px|thumb|right|Reflection]]
Refraction rendering. Fresnel and dispersion are supported.
+
Real-time screen space reflection.
  
 
'''Techniques'''
 
'''Techniques'''
#Reflection, refraction and fresnel
+
#Dual-directional SSR
#Dispersion
+
#HDR rendering
+
#[[Tone mapping]]
+
#HDR texture compression
+
#Dual face refraction
+
  
 
'''Requirements'''
 
'''Requirements'''
*Geforce FX+ or Radeon 9500. Geforce 6+ recommanded.
+
*Geforce 6600+ or Radeon 9500+.
 +
 
 +
'''Rendering plugin supported'''
 +
*D3D11/OpenGL/OpenGLES.
 +
 
 +
= Scene Player =
 +
[[File:ScenePlayer.jpg|200px|thumb|right|Scene Player]]
 +
A script driven scene player.
 +
 
 +
'''Techniques'''
 +
#Python script
 +
#[[Deferred rendering]]
 +
 
 +
'''Requirements'''
 +
*Geforce 6600+ or Radeon 9500+.
  
 
'''Rendering plugin supported'''
 
'''Rendering plugin supported'''
*D3D11/OpenGL.
+
*D3D11/OpenGL/OpenGLES.
  
 
= Shadow cube map =
 
= Shadow cube map =
 
[[File:Shadowcubemap.jpg|200px|thumb|right|Shadow cube map]]
 
[[File:Shadowcubemap.jpg|200px|thumb|right|Shadow cube map]]
Expand the traditional shadow map to cube map. Simulate the omnidirectional point light and texture projection. The other improvement is the usage of [[Variance Shadow Map]].
+
Expand the traditional shadow map to cube map. Simulate the omnidirectional point light and texture projection. The other improvement is the usage of [[Variance shadow map]].
  
 
'''Techniques'''
 
'''Techniques'''
Line 278: Line 295:
  
 
'''Requirements'''
 
'''Requirements'''
*Geforce FX 5600+ or Radeon 9500+. Geforce 6+ recommanded.
+
*Geforce FX 5600+ or Radeon 9500+. Geforce 6+ recommended.
  
 
'''Rendering plugin supported'''
 
'''Rendering plugin supported'''
*D3D11/OpenGL.
+
*D3D11/OpenGL/OpenGLES.
  
= Sub-surface =
+
= SSSSS =
 +
[[File:SSSSS.jpg|200px|thumb|right|Screen space sub surface scattering]]
 +
Screen space [[sub surface scattering]] and translucency.
 +
 
 +
'''Techniques'''
 +
#[[SSSSS]]
 +
#[[Sub surface scattering]]
 +
 
 +
'''Requirements'''
 +
*Geforce 6+ or Radeon 9500+.
 +
 
 +
'''Rendering plugin supported'''
 +
*D3D11/OpenGL/OpenGLES.
 +
 
 +
= Sub Surface =
 
[[File:Subsurface.jpg|200px|thumb|right|Sub-surface]]
 
[[File:Subsurface.jpg|200px|thumb|right|Sub-surface]]
Real-time rendering of [[sub-surface scattering]].
+
Real-time rendering of [[sub surface scattering]].
  
 
'''Techniques'''
 
'''Techniques'''
#[[Sub-surface scattering]]
+
#[[Sub surface scattering]]
 
#Bump map
 
#Bump map
  
 
'''Requirements'''
 
'''Requirements'''
*Geforce FX 5600+ or Radeon 9500+. Geforce 6+ recommanded.
+
*Geforce FX 5600+ or Radeon 9500+. Geforce 6+ recommended.
  
 
'''Rendering plugin supported'''
 
'''Rendering plugin supported'''
*D3D11/OpenGL.
+
*D3D11/OpenGL/OpenGLES.
  
 
= Text =
 
= Text =
Line 308: Line 339:
  
 
'''Rendering plugin supported'''
 
'''Rendering plugin supported'''
*D3D11/OpenGL/OpenGLES2.
+
*D3D11/OpenGL/OpenGLES.
 
+
= Vertex displacement =
+
[[File:Vertexdisplacement.jpg|200px|thumb|right|Vertex displacement]]
+
Calculate position and normal displacement in vertex shader.
+
 
+
'''Techniques'''
+
#Vertex displacement
+
#Directly compute normal by derivative function.
+
 
+
'''Requirements'''
+
*Geforce 4 Ti+ or Radeon 9200+.
+
 
+
'''Rendering plugin supported'''
+
*D3D11/OpenGL/OpenGLES2.
+
  
 
= Video texture =
 
= Video texture =
Line 335: Line 352:
  
 
'''Rendering plugin supported'''
 
'''Rendering plugin supported'''
*D3D11/OpenGL/OpenGLES2.
+
*D3D11/OpenGL/OpenGLES.
  
 
'''Known issues'''
 
'''Known issues'''

Latest revision as of 23:33, 24 December 2014

Before running these samples for the first time, it's recommended to run KGEConfig, to complete the configuration first.

Area Lighting

Area Lighting

Real-time sphere and tube area lighting.

Techniques

  1. Area Lighting

Requirements

  • Geforce 6600+ or Radeon 9500+.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

Atmospheric Scattering

Atmospheric Scattering

Physically-based atmospheric scattering. It can simulate atmospheric in different density and absorption.

Techniques

  1. Atmospheric scattering

Requirements

  • Geforce 6600+ or Radeon 9500+.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

Cascaded Shadow Map

Cascaded Shadow Map

Two kinds of high quality large-scale shadow rendering.

Techniques

  1. PSSM
  2. SDSM

Requirements

  • Geforce 6600+ or Radeon 9500+.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

Caustics Map

Caustics Map

Realtime caustics generation.

Techniques

  1. Caustics
  2. Dual-face Refraction
  3. Omnidirectional shadow map

Requirements

  • Geforce 6600+ or Radeon 9500+.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

Deferred Rendering

Deferred Rendering

Deferred rendering rendering framework.

Techniques

  1. Deferred Rendering
  2. GI
  3. SSVO
  4. FXAA
  5. Arbitrary light source
  6. Soft shadow
  7. Packing system

Requirements

  • Geforce 6600+ or Radeon 9500+.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

Detailed surface

Detailed Surface

Multiple detailed surface rendering techniques.

Techniques

  1. Bump mapping
  2. Parallax mapping
  3. Parallax occlusion mapping
  4. Displacement mapping
  5. Normal map compression (since KlayGE 3.4.0)

Requirements

  • Geforce FX+ or Radeon 9500+.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

Known issues

  • The texture is not right in OpenGL plugin on ATI's card.

Env Lighting

Env Lighting

Real-time physically based environment lighting.

Techniques

  1. Environment Lighting

Requirements

  • Geforce 6600+ or Radeon 9500+.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

Global Illumination

Global Illumination

Realtime global illumination based on Splatting Indirect Illumination.

Techniques

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

Requirements

  • Geforce 6+ or Radeon HD2400+.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

GPU Particle System

GPU Particle System

GPU-based particle system.

Techniques

  1. Particle system
  2. Multi-pass rendering
  3. Vertex texture fetch
  4. Deferred particle

Requirements

  • Geforce 6+ or Radeon HD2400+.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

JudaTex Viewer

Juda Texture Viewer

Juda Texture viewer.

Techniques

  1. Juda Texture
  2. Mouse Interaction

Requirements

  • Geforce FX+ or Radeon 9500+.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

Motion Blur and Depth of Field

Mition Blur and Depth of Field

Motion blur and depth of field post process. Focus plane and focus range can be adjusted. This sample also demonstrate the instancing technique. It switchs to hardware instancing if the hardware supports it, or else instance data are expanded on CPUs.

Techniques

  1. Motion blur
  2. Depth of field
  3. Summed-Area Table
  4. Software/hardware instancing
  5. Script engine
  6. UI

Requirements

  • Geforce 6600+ or Radeon 9500+.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

Ocean

Ocean

Demonstrate the water rendering. Water movement is simulated by GPU real-time FFT operation. The kernel is from NVIDIA's demo.

Techniques

  1. Water rendering
  2. Compute shader
  3. FFT on GPUs
  4. Reflection mapping
  5. Fog
  6. Lens flare
  7. Packing system

Requirements

  • Geforce 6xxx+ or Radeon HD2xxx+. Realtime editing requires Geforce 8xxx+ or Radeon HD4xxx+.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

Order Independent Transparency

OIT

Order independent transparency rendering.

Techniques

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

Requirements

  • Geforce 6600+ or Radeon 9500+.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

Particle Editor

Particle Editor

Particle system editor.

Techniques

  1. Particle system
  2. Complex UI
  3. Soft particle
  4. Geometry shader

Requirements

  • Geforce FX+ or Radeon 9500+. Geforce 6+ recommended.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

PostProcessing

Post Processing

Demonstrate the post processing, including:

  • Ascii Arts, fitting the image to ascii characters.
  • Cartoon rendering with two pass rendering. The first pass renders geometry, the second pass calculates lighting and edge.
  • Tiling.
  • HDR.
  • Night Vision.
  • Old Fashion, looks like old picture.

Techniques

  1. Post process
  2. Ascii fitting on GPUs
  3. Cartoon post process
  4. Depth and normal discontinuous detection
  5. MRT

Requirements

  • Geforce 6600+ or Radeon 9500+.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

Procedural texture

Procedural Texture

Various procedural texture generation by simplex noise on GPUs.

Techniques

  1. Perlin noise
  2. Procedural texture

Requirements

  • Geforce FX+ or Radeon 9500+.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

Reflection

Reflection

Real-time screen space reflection.

Techniques

  1. Dual-directional SSR

Requirements

  • Geforce 6600+ or Radeon 9500+.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

Scene Player

Scene Player

A script driven scene player.

Techniques

  1. Python script
  2. Deferred rendering

Requirements

  • Geforce 6600+ or Radeon 9500+.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

Shadow cube map

Shadow cube map

Expand the traditional shadow map to cube map. Simulate the omnidirectional point light and texture projection. The other improvement is the usage of Variance shadow map.

Techniques

  1. Omnidirectional shadow map
  2. VSM
  3. Texture projection

Requirements

  • Geforce FX 5600+ or Radeon 9500+. Geforce 6+ recommended.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

SSSSS

Screen space sub surface scattering

Screen space sub surface scattering and translucency.

Techniques

  1. SSSSS
  2. Sub surface scattering

Requirements

  • Geforce 6+ or Radeon 9500+.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

Sub Surface

Sub-surface

Real-time rendering of sub surface scattering.

Techniques

  1. Sub surface scattering
  2. Bump map

Requirements

  • Geforce FX 5600+ or Radeon 9500+. Geforce 6+ recommended.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

Text

Text

Demonstrate signed distance field based font system.

Techniques

  1. Font

Requirements

  • Geforce FX+ or Radeon 9500+.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

Video texture

Video Texture

Demostrate show engine. Decoded video can be mapped to 3D objects as texture. The video is from a open source movie Big Buck Bunny.

Techniques

  1. DirectShow decode to texture

Requirements

  • Geforce 4 Ti+ or Radeon 9200+.

Rendering plugin supported

  • D3D11/OpenGL/OpenGLES.

Known issues

  • Can't switch to full screen in D3D11.