Current version: 0.45.1
>GeeXLab homepage

Current version: 1.30.0
>FurMark homepage

GPU Caps Viewer
Current version:
>GPU Caps Viewer homepage

GPU Shark
Current version:
>GPU Shark homepage

>JeGX's HackLab

Geeks3D's Articles
>GPU Memory Speed Demystified

>Multi-Threading Programming Resources

>GeForce and Radeon OpenCL Overview

>How to Get your Multi-core CPU Busy at 100%

>How To Make a VGA Dummy Plug

>Night Vision Post Processing Filter

PhysX FluidMark
Current version: 1.5.4
>FluidMark homepage

Current version: 0.3.0
>TessMark homepage

Current version: 0.3.0
>ShaderToyMark homepage
>ShaderToyMark Scores

Current Version: 1.23.0
>Libraries and Plugins
>Online Help - Reference Guide
>Codes Samples

Demoniak3D Old Building Demo

Release Date: January 26, 2008

Back To Demos Index

Stumble it! | | | |

1 - Images Gallery

2 - Downloads

3 - Making-Of

4 - Useful Links

5 - Credits

1 - Images Gallery

Demoniak3D Old Building Demo
Demoniak3D Old Building Demo
Demoniak3D Old Building Demo

2 - Downloads

Demoniak3D Old Building Demo
Win32 Executable + Source code
Zip Archive - (39804k)
Release Date: January 27, 2008

Unzip the archive and launch DEMO_Old_Building.exe. That's all! Demo's source code is localized in the DEMO_Old_Building_1280x1024.xml file.

For any bug report or feedback, please send an email to jegx[AT]ozone3d[DOT]net and add "[DEMO FEEDBACK]" to the subject. Vous can also post your feedbacks in the demo's topic: Demoniak3D Demo - Old Building.

Recommended configuration:
  • Operating System: Windows XP SP2 / Vista
  • Processor: Pentium III or AMD Athlon and up processor - 800 MHz and up.
  • Memory: 1Gb RAM and up
  • Graphics Controller: ATI Radeon (with the latest Catalyst drivers) or NVIDIA GeForce (with the latest Forceware drivers) with at least 256Mb of graphics memory.
  • Resolution: 1280x1024 - 32 bits/pixel

3 - Making-Of

Here is a quick making-of the Old Building demo.

3.1 - 3D model preparation

The start point is the modelization of the building. The modelization has been made with Moment of Inspiration (MoI) and finalized in Cinema4D by Steph3D.

Demoniak3D Old Building Demo - Modelling in MoI
Modelling in MoI

Once the modelization finished, one has to extract (and this word is weak!) the master-piece from C4D. To get that aim, we have used the Riptide plugin for C4D, that allows to export the model in OBJ.

The OBJ model of the building is then loaded in Hyperview3D (available soon so do not ask me for the moment where to download it) in order to check the export and mostly to save it in o3mff format to keep its content secret:

Demoniak3D Old Building Demo

Demoniak3D Old Building Demo

The o3mff format stores the object's geometry as well as the textures. For this demo, the textures have been baked in Cinema4D. That makes it possible to have a realistic rendering (that takes into account shadows and global illumination) at no cost since any calculation is done during the frame rendering.

We take advantage of Hyperview3D to get the materials's name of building's transparent surfaces (street lamp, windows). This is important because the demo needs to access to these materials to add reflection effects.

Demoniak3D Old Building Demo

Now that we have done the preparation work, we can start Demoniak3D demo coding.

3.2 - 3D model loading

Demoniak3D Old Building Demo
<model name="TheBuilding" 
	   use_vbo="TRUE" >
	s3tc="FALSE" />		   

3.3 - Infinite environment: the skybox

Demoniak3D Old Building Demo

The skybox loading code is localized in the <skybox> xml element.

3.4 - Reflection on windows: environmement mapping

In order to add more realism to the building's windows and street lamps (which appear white in the previous images), we're going to apply a simple sphere mapping GLSL shader. For mode detail on the sphere mapping technique, see: Spherical Environment Mapping.

The following shader is applyied to materials with transparent surfaces (vitre and vitre_lp in the demo's source code):

varying vec3 u, n;
void main()
	gl_Position = ftransform();		
	gl_TexCoord[0] = gl_MultiTexCoord0;
	u = normalize( vec3(gl_ModelViewMatrix * gl_Vertex) );
	n = normalize( gl_NormalMatrix * gl_Normal );
	gl_FrontColor = gl_Color;

varying vec3 u, n;
uniform sampler2D envMap;
void main (void)
	vec3 r = reflect( u, n );
	float m = 2.0 * sqrt( r.x*r.x + r.y*r.y + (r.z+1.0)*(r.z+1.0) );
	vec2 tc;
	tc.s = r.x/m + 0.5;
	tc.t = r.y/m + 0.5;

	vec4 env = texture2D( envMap, tc * 1.0) * 0.7;
	env.a = 0.0;
	gl_FragColor = gl_Color + env;

This shader uses the following environment texture:

Demoniak3D Old Building Demo

Demoniak3D Old Building Demo

3.5 - Small graphical interface

The next code allows the inclusion of a small library to manage the graphical user interface:

<include lib="lib_demo_interface.xml" />

Demoniak3D Old Building Demo

3.6 - Chimney's smoke: particle system

The particle system makes it possible to create every kind of interesting small graphic effects (of which the smoke). The secret lies in the choice of particle's texture and the tuning of blending coefficients:

Demoniak3D Old Building Demo

The smoke'code is localized in the <particle_system> element:

Demoniak3D Old Building Demo

3.7 - Camera animation: motion-path

The demo has an automatic mode: after five seconds of mouse non-activity, the camera switches to the automatic mode and the camera's trajectory follows the motion-path. This motion-path has been done with CameraPathEditor.

Demoniak3D Old Building Demo

3.8 - The touch of fun: the four-band equalizer

The four-band equalizer allows to see background music's variations by reading the audio buffer. the equalizer is created dynamically in LUA (see the function BuildEqualizer()). Then the audio buffer reading (HYP_Sound.GetSpectrumValue()) allows us to move vertices of each band.

Demoniak3D Old Building Demo

Here we are, this small making-of is over. Many details aren't covered on purpose because of the lack of time. But I'll anvser with pleasure to all your questions in the demo's thread: Old Building @ Demoniak3D Forum. For stuff related to Cinema4D modelization, please post here (only french messages are accepted): Vieil Immeuble @ Steph3D Forum.

4 - Useful Links

5 - Credits

Author:Jerome 'JeGX' Guinot
Contact:jegx [at] ozone3d [dot] net

=:[GFX 2D/3D]:=
Author:Stephane 'Steph3D' Laux
Contact:steph [at] steph3d [dot] net

Author:Virgill & Tasium
Music Name:Elements - (C)2001
Homepage:@ scenemusic

GeeXLab demos

GLSL - Mesh exploder

PhysX 3 cloth demo

Normal visualizer with GS

Compute Shaders test on Radeon

Raymarching in GLSL

>Texture DataPack #1
>Asus Silent Knight CPU Cooler
Page generated in 0.0036180019378662 seconds.