If a guy is interested in 3D Graphics area of game(engine) development, its best recommended to make a rendering engine with features matching current technology standards or better. Instead of loading it with an array of rendering techniques that work okie dokie, its better to put in few but fast & consistently working features.
When I started writing a full-fledged game engine, I first wanted to get in a minimal set of features of all sub-systems of a game engine. Basic rendering, physics, game-play, AI, etc. But half-way down the development path, it became obvious that its a colossal task that takes specialization in each area. It was not that it was beyond capabilities, but, at the end of it, everything would be bare minimum, given that the entire developer period is just 8-10 months.
Half way down the line, gathered an in depth grasp of various sub-systems in a game engine(which had proved an advantage a lot later in professional development). From there, thee thought was 'Lets write one sub-system but write it damn good'. And graphics engine part was the choice.
This was when Direct3D 8 hardware arrived, but, most of the games then were Direct3D 7 based ( Hardware TnL, Multi-texture Combiners ). There were many Quake3, Unreal Tournament(UT 1.0 - 1.8) engine based games back then. So, Quake3 Arena engine was taken (Rendering part only of course, :) as a bench-mark & code rendering features that were not there in Quake3 at 80% of its' rendering only speed(disabled audio, collision & physics(no clip = 1), AI( no bots), No networking (local map)).
Per-pixel lighting & bump mapping were obvious features, but because a D3D 8 pixel shader hardware was way to expensive back then ( Geforce 3, etc. ). Had to work with Geforce 4 Mx 400. Though later on, some shader based techniques have been implemented in the engine using using nVidia GeForce Register Combiners ( This engine used OpenGL, which allowed to access nVidia specific hardware features ) but they would only work on nVidia Geforce series cards only. Actually, nVidia implementation of pixel shader 1.0, 1.4 & 2.0 on Geforce3/4 /5 Fx series cards took the path of beefing up, programmable multi-texture combiner units, more and more complex hardwiring, which had caused problems for them, & further ATI taking the route of implementing shader units with proper general instruction execution units in their 9xxx series GPUs. Anyways..
Ok, here are the rendering features. Some of them were already in Quake3 and some were not.
1 ) OpenGL Rendering
At that point there were more community resources online on Opengl than Direct3D, and
I could code it straight up with default installation of Visual Studio 6 without downloading
a 200 MB SDK. Also, I must mention that I did not have the luxury of a Dial up internet connection back then. I could surf for 1 to 3 hours in a day, gather articles, tutorials, whatever
I can find and fit onto floppy disks to copy at home & read them.. :(
2 ) First person, 3rd person Camera.
Simplistic FPS camera model with Collision detection.
3 ) .3DS, .ASE format static Model rendering
4 ) .MD3 Vertex Animation, Skeletal Animation
.MD3 format was written by ID-software for Quake3. Skeletal animation code had
major bugs, so I stripped it out.
5 ) Seem-Less Indoor / Outdoor rendering
Took Delta-Force Land warrior rendering as goal
6 ) Terrain rendering
Early plan was to implement a continuous LOD terrain using ROAM, which was a complex algorithm and couldn't manage time for it. So, instead wrote a simple algo of mine which is similar to Patch-LOD
7 ) Bill-boards & Animated Sprites.
Texture frame animation for Flames, Lens-flare, etc
8 ) Indoor Rendering with multi-texture shaders & BSP(Binary Spacial Partitioning) based culling.
9 ) Lighting
- Light-Map global illumination for static Lighting.
- Hardware Vertex Lighting ( HW TnL ) for dynamic lighting for all Video cards
- Per-Pixel lighting / Bump-mapped ( Register Combiners ) for dynamic lighting on nVidia Geforce cards
Example Shader Code: ( Comments start with '//' )
// BeginShader command prepares rendering
// Each render-pass / texture-stage is defined in between { and }
BeginShader "textures/loc_wood/wood_table_gloss"
{ // Render Pass 1
map "textures/loc_wood/wood_table_gloss.jpg"
blendMode add // Additive blending
}
{ // Pass 2. Environment map
map "textures/loc_env/villa1_env.jpg"
blendFunc src_color one // Custom blend function
depthWrite // Enable writes to Z-Buffer(
tcGen sphereMap // Generate Spherical Mapping texture co-ordinates
}
EndShader
11) Video textures. Ability to use videos of formats like AVI, WMA, etc. as textures on surfaces. Added AVI & Quake3 ROQ format real-time video play back, but didn't get time to play sound track of those videos. Quake3 engine could render them (ROQ) in real time but, they did not intend to use it in game. So, it was not exposed in Radiant / Shader Script. When this coded it, there was no game back then that did Video textures as texture in Perspective scenes.
12) Environment mapping.
Quake3 had only supported Spherical environment maps. This engine supported both Spherical & Cube-Map env mapping
World-Editor problem
The first major issue was a World Editor, to make the indoor geometry, position meshes & lights, generate radiosity light-maps, etc. Now writing a world editor is serious shit. Can take more than a year or two, unless its a John Carmack or Tim-Sweeney. So, it was decided to use Quake3 engine's world editor Q3-Radiant to make indoors. It was a very good decision because Quake3 BSP world format is open & documented well online. It does BSP, PVS computation, Radiosity based global illumination light maps and many other things ( Many Thanks to Carmack & ID Software for their source code releases, open policies, etc for learners).
Optimization.
This is where that engine did well. Spent a significant amount of time to make it run as
close to Quake3 speed ( I knew its stupid to aim for a speed equal to carmack's code. This guy tells Video card manufacturers & Driver coders how to make their hardware run quake3 faster ). The aim was to reach 90%, but managed to reach 80%. ( "Its the last 10% that takes the longest - Paul Steed" )
- Optimized Vector, Matrix, Quaternion & other core engine with 3DNow & SSE assembly code.
- S3TC & DXT Compressed textures
- Compiled Vertex Arrays
- Hardware specific optimizations. Like uploading geometry in AGP memory using nVidia's NVFence Extension for GeForce cards.
- Good coding practices & Careful line by line optimization of C++ code.
Anyways, here are the screenies. I did the level-design part myself. Indoors, Lighting,
some textures (photoshop tinkering), Shader scripts, etc. Some models & a lot of textures were taken from other games (Hushhh.. I wish raven artists don't check these :D Let me a tleast
give due credit. Mostly from Soldier of Fortune 2 .pak files. Since neither this engine nor those content were ever used for a commercial purpose, they probably they wont mind.. It helped not limit the engine's appeal due to immature art )
Hospital ward with Lighting & Diffuse textures combined
Alpha / Transparency Sorting ( Alpha blended plant ( quad) behind translucent mirror )

Glass door Without Shaders

Glass door With shader ( Translucency, reflections of plants behind the camera, onto the glass )
Shader Script:
// Hospital ward glass door shader
BeginShader "textures/loc_doors/hospdoors"
transparent // this enables alpha-sorting
onlyVertexLighting // No light-maps on this surface. Use vertex lighting
cullMode none // disable back-face culling
{
map "textures/loc_doors/hospdoors.tga"
blendMode alphaTrans
depthWrite
}
{
map "textures/loc_env/hosp2_env.jpg"
blendFunc SRC_COLOR ONE
tcGen sphereMap
}
EndShader
Result of above script

ICU room Lighting Only

ICU Room with Lighting Modulated2X with Diffuse textures and additive shaders ( Glowing Tube light )

Living Room

Living room with Lots of shaders in a single frame render

Poster in the room without Shaders

Poster in the room with Shaders & Reflections

AVI video texture on the TV ( Michael jackson black or white video ). Added another layer on the shader for environment mapping to get the reflections on TV-Glass.

Here is the shader for above video texture
BeginShader "textures/loc_avi/mj_avi"
// First pass is the video texture itself.. without lighting
noLightMap
{
aviMap "avi/mj.avi" // Name & path of video file to use as texture
scaleFrameRate 0.88 // Slow down the frame-rate to 88%
blendMode none
}
// Add a reflective env-map map on it to get glass-screen feel
{
map "textures/loc_env/villa1_env.jpg"
blendFunc src_color one
depthWrite
tcGen sphereMap
}
EndShader
Flame animation using multiple texture animation

Water Ripples & Alpha Sorting ( 3 layers )

Made this bed model entirely with BSP Brushes in Radiant. Table lamps are meshes though.

Kitchen room. I know, the design looks a bit wierd. Not bad for a programmer huh !!

Kitchen Lighting Only

Kitchen Lighting * Base Textures + Shaders

Next Part : What a current/next generation demo should be like ?


10 comments:
thats a kool display of the works u hav done... well a senior like u is sure showin me the way how to display wht i hav done... thanks senior....
What impress is more than the work is that circumstances under which this work is done.
Nobody had clue about the game development industry and all you get is critique everywhere. Still the vision lead to this work..
Good work.. :)
Guys, thanks for your comments. :)
As I already said sometime back in Orkut, this is awesome. Really shows the skills you have. And it also doesn't look blotchy or messed up. Very nice indeed. :)
Hey their. I must say this is really really awesome work. And i came to notice that you have a really deep knowledge in CG. I really appriciate your interest and your skills. Congrats for your achivements and all the best for your future. I must say That "You are a master of tommorrow".
Hey Man, I have been into rendering engine development, and I know it first handed, what it takes to learn this shit. Brains and Hard work combined and still its not likely for most people to come up with something like this.
What amazes me the most is that this is your first engine, and such a short time for even a team to deliver this. On top, you created these fabulous 3d scenes all by yourself. Unbelievable.
You are truly an inspiration.
i want to develep tat.. how can i.. ?? there is no code no software no language mentioned.. so where it is developed and how??
Hi Sumit,
i want to develep tat.. how can i.. ?? there is no code no software no language mentioned..
I wrote it in VC++. As in C++ over Win32, and used VS.Net IDE. All the shaders were written in the Shader script created for this engine.
so where it is developed and how??
Developed in Hyderabad. Once, I got a job in Game Industry, I couldn't continue its' development. I will release the Source code free.(under ZLib license)
plz release it. under any license. i promise i can take it to heights. and its for the help of mankind. no profits!!(atleast on my side). but do let me know either here or at friggere.Sumit@gmail.com thanx in advance.. for ur help.
Hey,
Sounds great that you know all about your stuff! Its intriguing when you speak to someone who knows what they speak about, as oppose to reciting it from someone else they learned from. I can see you are very experienced and with your credentials it is quite obvious that you will make it far in life, or have already made it far in life :)
Post a Comment