Hi there! now I have assigned 1.3 aspect ratio and created context menu for to select easily between effects. Shortcut is available with function keys too, F1-F10.
This is the end of the first lite version using glut. Is a lightweight version, I will use Qt for a complete and complex version in the future. Example of use:
>ModelViewer path/creatures/bigdady2
>ModelViewer path/creatures/bigdady2/otherName.obj
So easy, I will explain better in other moment but you only need OpenGL 2.0 support and a model with .mtl file with a correct format.

Aspect Ratio and Context Menu
To do normal mapping in Deferred Rendering is little dificult because you need to store in G-buffer tangent and binormal if you want, but it is easy to calculate. Or you can calculate TBN matrix per pixel with your 2D normal map stored in G-buffer. So I can’t do that because have high GPU consumption.
Other thing that you can to do is store in 8bit the result of “light power” calc in Geometry stage and then, use that in Lighting Stage. But “normal mapping” will be based in 1 light.
Anyway, we can do an approximation using a bling phong lighting and fast normal mapping calc:
// Calculate half vector
vec3 H = normalize( normalize(lightDirection) + normalize(eyePosition.xyz - pixelPosition.xyz));
// Calculate phong shading
float shininess = 100.0;
vec3 phong = pow(max(dot(H, normal.xyz), 0.0), shininess) * specular.rgb;
// Calculate normal mapping effect
float lightAmount = max(dot(normal.xyz, normalize(lightDirection)), 0.0);
-
-
Deferred with Normal Mapping
-
-
Deferred without Normal Mapping
Hi all!
A little update of specular effect. Now with support of RGB channel. I have a screenshot with edge detect anti-aliasing:

Specular RGB test with Edge Detect AA
Look, blue in metal and red in crystal… painted by Prompt
-
-
SSAO Adjust
-
-
SSAO Adjust
I’m adjusting the params of my SSAO shaders. I’m trying to have more darkness in occlusion zones and more clean the others fragments. So adjusting selective fragments I have more performance.
Hi all!
Today I’m testing new map, specular map in RGB (this is only white) with BigDady 2 model, see the crystal in the “face”:

Specular test 1

Specular test 2
Well now, the rendering process in screenshots, read more!
Read more…
Hi there!
I have now Big Dady 2 model fixed. The texture coords was inverted in V coord. Now I mix my deferred lighting implementation with SSAO. I have no specular map applied yet, but I have other problem here. Diffuse map of model has shadows like SSAO mixed with diffuse map. So the result is not awesome but looks really good.
-
-
Light with SSAO, no specular map applied
-
-
Light with SSAO, no specular map applied
-
-
Diffuse map mixed with shadows
I need other model
Diffuse map has bump wrinkle, shadows and normal mapping effect.
Hi there!
Today I see an error in SSAO calc, near of the camera you can see fake occlusion. This is definitely wrong. So now is fixed:
-
-
SSAO error
-
-
SSAO 16 samples
-
-
SSAO 8 samples
-
-
SSAO 4 samples
-
-
SSAO 2 samples
I tested different samples, I think 8 it is ok for normal GPU and 4 or 2 for slow GPUs. Is better to be SSAO with 2 or 4 samples than not to be. You can fix that with a blur downsampled x3 for example.
To be or not to be, this is the question
. In this case, to be, of course!
Hi there!
The next step with my SSAO is to use more complex model, in this case BigDady2 of biosock, thanks Llorens
I use the SSAO result and a blur shader with one 2x downsampled.

SSAO with Blur, BigDady2 model for learning purpose
- Original SSAO in fullscreen
- SSAO texture downsampled width and height >> 2
- Combine 1 + 2 * 0.5
The result is a soft texture without noise. This noise exist because I use only 16 samples per pixel in SSAO pass.
TODO: mix with Lighting Stage of Deferred Rendering architecture and specular map.
Today I begin my SSAO based in many website, papers and forums. This first approach has around 2ms of cost. But if the camera is near to objects app performance down drastically. By the way it’s ok for first day of coding.

SSAO bricks looking good
I need to do 2 things, render in less resolution and to do a vertical and horizontal blur, then mix with specular and color. I believe the effect is really good now processing only, ALBEDO, NORMAL and DEPTH (in clip space).
If I complete this version soon I will relax and play a few poker hands next week. I hope this weekend to be finished the first version of ModelViewer lite version without GUI, supporting, color map + alpha pixel discard, normal map, specular map, height map for parallax mapping and deferred rendering architecture.
-
-
SSAO my first test
-
-
SSAO with flickering
-
-
SSAO test 08
-
-
SSAO test 07
-
-
SSAO test 06
-
-
SSAO test 05
-
-
SSAO bricks looking good
I forget to apply the new texture coords in Normal Maping -_-
So… this is the result now:

Parallax Mapping Fixed
Before

Textured box