Info |
Description |
|
Templates - contains two Direct3D template projects - you can use these projects as starting point
for you own Direct3D applications. There are two templates as one is using Win32 API only and other is using VCL library.
Both projects show "The Teapot" model and allows to resize window and go to fullscreen mode.
Download source with EXE.
|
|
VCLfullscreenD3D - this sample shows how to use Delphi VCL dialogs in Direct3D 9.0 fullscreen mode.
Download source with EXE.
|
|
MeshHierarchy - loading and saving hierarchical meshes - even with custom data
This sample shows how to load and save hierarchical meshes using D3DX9 functionality. Sample can load and save not only
"standart" data but also custom (user supplied) data.
Sample was used as testbed for testing correctness of D3DX9 header conversion for support of animated / hierarchical meshes.
But final decision was made what there are definetly some bugs hinded inside D3DX9.0 implementation. Or I'm really mad -
in that case mail me.
Demonstrated bits: inheritage of TD3DXFrame, ID3DXAllocateHierarchy, ID3DXLoadUserData, ID3DXSaveUserData and
usage of D3DXLoadMeshHierarchyFromX, D3DXSaveMeshHierarchyToFile.
Download source with EXE.
Note: to run this sample you will need any skinnedmesh - like tiny.x supplied with DirectX SDK.
You can find copy of it included in SkinnedMesh
DirectX9 SDK sample.
|
Info |
Description |
|
ParticleSystem1 - unidirectional generator sample
Main idea of this sample was to demonstrate right and wrong ways of generating uniform distribution of
unit length vectors - so end-points formed by these vectors forms sphere surface. But in process of providing
visual feedback for user some other interesting techniques appeared.
I try to list them below (in advanced - beginner order):
- Vertex shader assembler code for particle systems with particle size calculation.
- Stencil buffer / matrix operations for mirror rendering.
- Various frame buffer blending modes.
- Rendering graphs with with transformed and lit vertices.
- Usage of DrawPrimitiveUP D3DDevice method (for graph rendering).
Download source with EXE.
|
|
DebugRuntime sample
This simple application detect is Direct3D8 or Direct3D9 debug runtime activated.
It check registry key "HKEY_LOCAL_MACHINE\SOFTWARE\ Microsoft\Direct3D\LoadDebugRuntime"
for what.
Download source with EXE.
|
|
GifBlender2 sample
This sample is sequel to "GifBlender" sample, below you can find list
of changes:
- GIF's are rendered by blending two nearest frames of GIF animation on multitexture
capable hardware
- 3 different texture pipeline setups tested for best quality rendering result:
(a) simplest NVIDIA TNT class, (b) Matrox G400 class, (c) NVIDIA GeForce,
ATi Radeon - 3 stage setup.
- GIF handling/rendering moved to separate portable between applications Delphi class
- Usage of Ander's Melander TGifImage component is reduced to loading stage -
animation frames loaded to Direct3D textures, timing info retrieved to internal
data structure. All rendering and timing after that is handled by TD3D8GifImage
class.
This sample as "GifBlender" also uses
Ander Melander's TGIFImage component.
You can find Delphi6+ compatible version of TGifImage component
here on mine site.
Download source with EXE.
|
|
GifBlender sample
This simple sample show how to draw animated GIF on Direct3D texture using
Ander Melander's TGIFImage component.
You can find Delphi6+ compatible version of TGifImage component
here on mine site.
Download source with EXE.
|
|
WVPick sample
This sample is based on
MS DirectX SDK Pick sample demostrating how to "Pick" what triangle is pointed by
mouse pointer on rotating object. This sample goes further so object is rotated by both
WORLD and VIEW matrices (in original sample object was rotating only in VIEW space) AND
user can move object in view space by dragging it with right mouse button.
This sample requires DirectX 8.1 headers and libs.
Download source with EXE.
|
|
DepthColoring sample
Direct3D DepthColoring sample demonstrate how to convert depth information to color during
vertex processing by various techniques.
This effect generated in demo using one of 3 different methods:
- Good old texture matrix transformation using DX7 style fixed function
T&L and accessing small pre-rendered texture while pixel shading.
- Modern style DX8 VertexShader version of first method - 40% faster on
GF3 on complex meshes. Also accesses prerendered texture later.
- Calculating color (hue channel of HSL color model) completely in
vertex shader. Pros: no texture needed - ouputs standart diffuse color;
Cons: more complex calculations required - less vertex processing speed.
So, general recomendations: on hardware capable of VS use (2) else (1), if you
need many textures when (3) may be win for your setup. Methods can be switched in runtime.
This sample requires DirectX 8.1 headers and libs.
Download source with EXE.
|
|
DotProduct Bumpmapped Font rendering class
This sample requires DirectX 8.1 or higher.
Direct3D sample for DirectX 8.1 demostrating how to create and render
Dot product (Dot3) bumpmapped / modulated font. Font normal map generated
with D3DX8.1 function D3DXComputeNormalMap which itself requires height
map. So height map is generated from font bitmap by averaging intensivity
of 3x3 square of pixels.
Lighting is controlled by moving mouse cursor. Different blending modes can be switched at
runtime.
Download source with EXE.
|
|
Processing X-files with Direct3DX 8.x
In previous sample (generating X-files inside your program)
"human face" is looking unnatural - like it's brushed out of stone. After some
investigation I've discovered what normals in this model were calculated against single
triangles and not smoothed over the face. Probably it was modeller intention, but I decided
to correct this.
So this sample shows how to use D3DXComputeNormals and D3DXWeldVertices
functions of D3DX8 library to process meshes. On picture you can see (from left to right):
original mesh, after D3DXComputeNormals and after D3DXWeldVertices.
Sample allows you modify input parameters to processing functions in realtime, see
mesh statistics after processing, apply normal lighting or environment mapping on meshes,
visualize mesh normals (right "face" on picture) and save processed meshes to disk.
Sample comes in two compiled versions: against Direct3DX 8.0 and against Direct3DX 8.1.
So you can see difference between different versions (and it exists - DirectX 8.1 rocks).
Download source with EXE.
|
|
Generate X-File inside your program
Sample demonstrate how to fill ID3DXMesh object from D3DX8 helper classes
with your custom data and save final mesh to disk in either binary or text format. As user
data face_data.pas was taken, containing data in pascal arrays from
Jan Horm site. After generating files
in current directory sample loads generated text format x-file "FaceText.x"
and display it on screen.
Download source with EXE.
|
|
Yet another bitmap font format / now with alpha
These two samples demonstrate rendering of bitmap font format originally introduced by Nitro in
FontStudio font editor
and demonstrated in
OpenGL FontTest application.
Pros of font format: image with alpha channel, letter positions are stored in font file
itself; cons: big file size, FontStudio generates monospace fonts.
As shown in right picture DirectX font renderer class can be used to repeat all features of original OpenGL demo.
Font renderer is realized as class with functionality equivalent to CD3DFont from MS DirectX SDK
samples, so in addition to Nitro way of rendering text you can also draw text scaled to window
dimentions, pure 2D font (with positions pointed in 2D viewport window) and "pure" 3D rendering.
This is demostrated in other sample - slightly modified Text3D sample from MS DirectX 8.0 SDK - shown on left.
Note: If you ever wandered how to use memory mapped files - you may look in
NitroFnt.pas font loading routine.
Font renderer class is DirectX 8.0 and DirectX 8.1 compatible.
Download EXE's with source.
|
|
Rendering text with bitmap font (loaded from disk)
This example demonstrates use of TD3DTextureFont class which has syntax very close to CD3DFont from DirectX 8 SDK samples framework, but instead of GDI fonts uses monospace bitmap based font. Sample itself is modified version if Text3D DirectX SDK sample - this can really help you to switch using it from CD3DFont class.
DirectX 8.0 and DirectX 8.1 compatible.
Download it.
|