GLSL Hacker
Current version: 0.8.2
»GLSL Hacker homepage
»GLSL Hacker Overview

FurMark
Current version: 1.18.0
»FurMark homepage
»FurMark 1.9.x Submissions

GPU Caps Viewer
Current version: 1.31.0
»GPU Caps Viewer homepage
»GPU DB Submissions

GPU Shark
Current version: 0.9.10
»GPU Shark homepage


Blogs
»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.2
»FluidMark homepage
»FluidMark 1.4.x Submissions

GeeXLab
Current version: 0.4.0
»GeeXLab homepage
»GeeXLab Overview

TessMark
Current version: 0.3.0
»TessMark homepage

ShaderToyMark
Current version: 0.3.0
»ShaderToyMark homepage
»ShaderToyMark Scores

Demoniak3D
Current Version: 1.23.0
»Demoniak3D
»Download
»Libraries and Plugins
»Demos
»Online Help - Reference Guide
»Codes Samples

3D Graphics Search Engine:

The Geeks Of 3D

 



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" 
	   filename="data/building_v1.o3mff" 
	   lighting="FALSE" 
	   texturing="TRUE" 
	   use_vbo="TRUE" >
	   
	<loading_option
	load_texture="TRUE" 
	load_normal_map="FALSE" 
	pixel_format="RGB_BYTE" 
	auto_gen_mipmaps="FALSE" 
	compute_vertices_normals="FALSE" 
	compute_tangent_space_vectors="FALSE" 
	average_vertices_normals="FALSE" 
	free_pixmap_after_upload="TRUE" 
	s3tc="FALSE" />		   
</model>


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.

OpenGL.org

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

[Vertex_Shader]
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;
}

[Pixel_Shader]
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


=:[CODE]:=
Author:Jerome 'JeGX' Guinot
Contact:jegx [at] ozone3d [dot] net
Homepage:www.ozone3d.net


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


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


GLSL Hacker demos


GLSL - Mesh exploder


PhysX 3 cloth demo


Normal visualizer with GS


Compute Shaders test on Radeon


Raymarching in GLSL



Geeks3D latest news


Geeks3D forum news


Misc
»Texture DataPack #1
»Asus Silent Knight CPU Cooler
Page generated in 0.0067780017852783 seconds.