Zanir » DX 8.1

Archive for the ‘DX 8.1’ Category

Program 22 – Horizon Mapping

06.01.2005

022_Horizon_MappingHorizon Mapping is sometimes name also self shadowing. The bump on surface cast shadows on surface. I used this article.

Program request pixel shader 1.1. Uses also ps 1.4.

source code and executable – 800kB

Program 21 – Many Per Pixel Lights with Stencil Shadow

29.12.2004

021_MPPL_ShadowProgram show stencil shadow on many lights. This is vertex lighting, per pixel lighting and per pixel lighting with offset mapping.

Program request hardware accelerated 8 bits stencil buffer. Uses also pixel shader 1.1 and 1.4.

source code and executable – 720kB

Program 20 – Stencil Shadow

22.12.2004

020_Stencil_ShadowProgram show stencil shadow and bump mapping with attenuation. I use z-fail algorithm which is described in Practical and Robust Shadow Volumes (.pdf) (2153 KB) document.

Program request hardware accelerated 8 bits stencil buffer. Uses also pixel shader 1.1.

source code and executable – 650kB

Program 19 – Offset Mapping

21.09.2004

019_Offset_Mapping_Offset_roomOffset mapping use new texture coordinations for sample base and normal map. These is computed from original texture coordinations with equation:

new_texture_coordinations = (0.04*height-0.02)*eye + original_texture_coordinations Read the rest of this entry »

Program 18 – Motion blur

15.09.2004

031_motion_blur_with_pbufferProgram uses pixel buffer, for rendering scene to texture. Motion blur is make with equation:
frame(t+1) = alpha*texture + (1-alpha)*frame(t)
Frame buffer doesn’t need clear. Frame buffer doesn’t contain z-buffer. Alpha is preset on 0.18. Texture has 1024 * 1024. Texture contain z-buffer. Program is equivalent to OpenGL program 31. On my graphical card however DX is fastest. DX 127 FSP, OpenGL 104 FSP.

source code and executable – 700kB

Program 17 – Many Per Pixel Lights

13.09.2004

017_Many_Per_Pixel_Lights_2Program uses pixel shaders for lighting scene with many point lights. Light have diffuse, specular and attenuation. One lights request one pass. Because not each triangle is lighting with all lights, each triangle is draw only for lights which lighting his. In program is possible to add light with push left mouse button. Count of lights in scene is limited by count of vertex shader constants. For GF3 and GF4 is maximum count of lights 45, for Radeon 8500 is 90. 017_Many_Per_Pixel_Lights_1

Request pixel shader 1.1. Uses also pixel shader 1.4.

source code and executable – 500kB

Program 16 – Per Pixel Lighting

23.08.2004

016_Per_Pixel_LightingProgram uses pixel shaders for lighting scene with one point light. Light have ambient, diffuse and specular factor.

- variable specular exponet
- cube map normalization
- attenuation with choice from 7 equation
- 3 various technique for attenuation

Request pixel shader 1.1. Uses also pixel shader 1.4.

source code and executable – 720kB

Program 15 – ASE Loader

26.07.2004

027_ASE_loader_0This program is approximately identical to OpenGL program 27.

There are:
- lighting with light-map, who was created with radiosity in 3ds max
- better collision
- gravitation and jumps
027_ASE_loader_1
source code and program – 712kB without jpeglibm.lib
model to 3ds max – 90kB

Program 14 – Bumped Cubic Environment Mapping

20.02.2004

014_Bumped_Cubic_Environment_Mapping_1014_Bumped_Cubic_Environment_Mapping_2

source code and executable – 810kB

Program 13 – Dynamical cube mapping

20.02.2004

023_Cube_Mapping

source code and program – 670kB