Per-Pixel Displacement

Category: Shaders
Author: Jonathan Kreuzer
Publish Date: July 30, 2006


Description :

Screenshot
displacement shader screenshot

Files: Fallback Chain : Fallback Reasons: Inputs: Diffuse Map, Height Map, Normal Map (1024x1024 diplayed at 256x256)
maps

Specular intensity map is taken from the Normal Map alpha channel.
An optional Overlay Map is supported, but only for the Diffuse Map.

Height Map Creation:

Limitations:

3D Textures are not supported. They could be used to store a distance map, or to avoid the texture stretching problem with the diffuse map. I chose to avoid them because of their size -- in a full game texture memory quickly becomes an issue.

Source:

This is the Cg source for the displacement shader for anyone interested. They will need to be changed to work outside CW3D but this might give readers a better idea of the inner workings.
Note : these contain macros that are replaced by code to compile variations of the shader.


3D Kingdoms Creator Documentation © 2006