Thursday, January 18, 2007

Rooting out the problems. Setting up a Home recording studio for guitarists - Part 2

In the previous part ( Setting up a Home recording studio for Guitarists - Part 1 ), I ended listing out what the problems were to be not able to produce a studio quality song. Here they are again.

1) Significant amount Noise & distortion in the song.

2) Acoustic guitar track sounds anything but Acoustic.

3) Lead guitar don't have the Rocking punch in them. They sound 'obviously synthesized'

4) In the guitar solos, especially the second solo, sometimes it sounds like I was playing Off-scale wrong notes. In fact, it was irritating to listen that I had turned down volume of the
lead guitar at some locations near song ending.

There was another major issue (which is the harder to fix than rest) is 'Guitar Playing Skills' :)
This, I am in the process of fixing which I will talk about later :)



1) Significant amount Noise & distortion in the song.

There are more than many reasons for this.

- Poor quality guitar pickups & circuitry. My GB&A guitar has three single coil pickups, S-S-S configuration( see the image below), which is quite common with most stratocaster clones. But the main problem is that they are stock GB&A pickups of extremely poor quality(Pic to the right). This can be fixed to certain extent by replacing them with expensive pickups from DeMarzio or Seymore Duncan. But, its only possible to fit in Single-Coil pickups, where as what suit my purpose are Humbucker pickups.

(Bridge picup of my guitar -> )














( Above : S-S-S All single coil configuration on a Fender Stratocaster)


There is more hardware in the guitar that contributes to tone & quality. Volume / Tone knobs, etc. Needless to say, my guitar has extremely bad hardware for its price. Volume knob is useless. The circuits that modify guitar tone add in a shit load of noise when i set tone towards
trebile which is where most of the lead pieces sound good..

Oh, the best of all. Even the pickup selector adds into the noise contribution. I dont know what
I was thinking but, I tried the pickup selector tricks that Jimi Hendrix used to do all the time.
Well, two months later it went for a toss. I can still change change active pickup but, not in middle of a solo, as the switching generates noise like I just broke a microphone.

( WIP : This article is not complete yet )

Monday, January 15, 2007

Screenshots of my first Opengl rendering Engine

The best way to get into Game Industry is to have a good demo/screenshots. This applies for both programmers and artists (mandatory in case of artists).

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
10) Some kind of Scripting to describe rendering of surfaces (Similar to Quake3 Shader script)

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 ?

Thursday, January 11, 2007

Biological machines

"We are complex, elegant, sophisticated biological machines. But we are Out-Of-Date machines. We are about 40,000 years old."
- Mystery

Monday, January 8, 2007

Setting up a Home recording studio for guitarists - Part 1

This article(and others in the series) is about setting up a home recording studio at home for Beginner Musicians(Guitarists for the most part) , enthusiasts & those aiming to produce music at home for commercial purposes. Especially the one man army music makers (like me ;) )

If you had started learning guitar/composition months back with an acoustic guitar, and have no idea about scales & such, this might not be that useful at the moment. Still, its prolly good to know.

If you are going to buy your first electric soon.. Then its a must read.

If you already have an electric, can glide your fingers across the fret board & thinking of getting 'proper' instrument.. Then you are going to thank me at the end of this series :) LOL..

Ok. Lets begin.

I have been intensely into learning Music theory, Guitar, Song writing ( Instrumental Rock ) & Recording for about an year now..

I bought my first electric guitar rig in October, 2005. Well, I bought the purpose of learning rock solo stuff (lead guitar) and had no plans whatsoever to record songs.. Everything was fine until I learned stuff to a level & started recording my own songs.

Here is my first decent song I recorded with the above two gear, PC, and a couple of other software which I detailed out below.

http://www.4shared.com/file/6099269/1422ecaa/myworld_full.html

Now, all the equipment / tools used to make it.

GB&A Electric guitar ( Rs. 8,500 )



This is a Korean made, straight clone of the Fender Stratocaster Guitar. I bought this in Hyderabad and I heard you can get this for 7,000 in Bombay.

Its more than enough for learning purposes & is far better than Indian made shit like Givson, etc.

It got decent tone for its price.
- 3 Single Coil pickups
- 4-way pickup selector, 1 volume knob
- 2 Tone Knobs
- 6 String, 22 Frets

Its got a Tremolo bridge, which is Unusable because of its
tuning instability.

I will get to the problems a little later..


Digitech RP200A ( Rs. 10,500 /- )

This is quite a successful product from Digitech, and is made in USA. I must say its worth it for the price, but for one major fuck up.

Seemingly a very simple interface with just 3 knobs, it has a wide range of Effects & Amp models. With about 40 Presets, 40 free slots for user configurable presets, this can be used to get
any kind of sound reasonably close. Metallica, Satriani, GnR, and lot of popular stuff.

Its body is Rock solid Steel. Robust.
The Expression pedal is just awesome.

But, the two up-down blue buttons at the bottom, are made of plastic, and at the moment of writing this both of them arent working. Its impossible to access presets now. I can only modify sounds manually using the turn knobs.
I recommend this for any beginner, casual player, but be careful with the preset selector knobs.

Software ( Recording & Mixing )
My Guitar is connected to RP200A, its' output to PC through Line-In Jack. I recorded & Mixed the tracks using Acoustica MixCraft

It has an easy & simple interface with lots of recording & mixing options & supported features.

While its UI has major scope for improvements, & comes with a bunch of effects, it supports VST & DirectX Effect plugins which means you can do A LOT of other stuff which the application cant natively. I used a cool VST effect pack that is a lot better than default effects of MixCraft. They are free to download here ( Kjaerhus Audio Classic Series )


Software ( Drums )
Composed & Generated the Drums track
using Acoustica BeatCraft.

It is an extremely easy to use & kick ass Drums Pattern/Loop/Track editor. It comes with live
recorded samples of each individual item in a drum kit. Like Foot-Bass, Snare, Cymbal, etc.
of various drum kits from Funk, Ambient Rock to
Hard Rock genres.

It also supports VST / Dx plugins just like Mixcraft. So there is room for a lot of creativity.

And the problems begin..

Taking the song MyWorld as example, lets see what fucked with my mind..

1) Significant amount Noise & distortion in the song.

2) Acoustic guitar track sounds anything but Acoustic.

3) Lead guitar don't have the Rocking punch in them. They sound 'obviously synthesized'

4) In the guitar solos, especially the second solo, sometimes it sounds like I was playing Off-scale wrong notes. In fact, it was irritating to listen that I had turned down volume of the
lead guitar at some locations near song ending.

( to be continued )

First Post

First Blog.. First post.. I will be using this to share thoughts & ideas on game development, music, philosophy, society and others..