Archive

Archive for the ‘Video Games’ Category

ModelViewer, Deferred Rendering pipeline

November 5th, 2009 Prompt No comments

Ups, I have no uploaded this video…

No Siesta Studios Viewer with a demo model big dady 2.

It video show my Deferred Rendering pipeline.

Video:
- Only Diffuse map
- Normal Mapping
- Deferred Rendering: Geometry Stage; albedo, normals, SSAO and specular RGB
- Deferred Rendering: Lighting Stage, point light
- Deferred Rendering: Post-Procesing Stage, Edge Detect Antialiasing.

:)

Categories: Graphics, Programming, Video Games Tags:

Aspect Ratio and Context Menu

September 12th, 2009 Prompt 1 comment

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

Aspect Ratio and Context Menu

Categories: GUI, Graphics, Programming Tags:

Deferred Rendering and Normal Mapping

September 12th, 2009 Prompt No comments

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);
Categories: Graphics, Programming Tags:

Specular RGB and Edge Detect AA

September 8th, 2009 Prompt 2 comments

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

Specular RGB test with Edge Detect AA

Look, blue in metal and red in crystal… painted by Prompt :roll:

Categories: Graphics, Programming Tags:

Adjusting SSAO

September 8th, 2009 Prompt No comments

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.

Categories: Graphics, Programming Tags:

Deferred Lighting + specular map – normal map

September 7th, 2009 Prompt No comments

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 1

Specular test 2

Specular test 2

Well now, the rendering process in screenshots, read more!

Read more…

Categories: Graphics, Programming Tags:

Deferred Lighting + SSAO – Specular – Normal mapping

September 6th, 2009 Prompt No comments

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.

I need other model :)

Diffuse map has bump wrinkle, shadows and normal mapping effect.

Categories: Graphics, Programming Tags:

Fixing and testing samples with SSAO

September 2nd, 2009 Prompt No comments

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:

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 :P . In this case, to be, of course!

Categories: Graphics, Programming Tags:

SSAO downsampled with blur

September 1st, 2009 Prompt No comments

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

SSAO with Blur, BigDady2 model for learning purpose

  1. Original SSAO in fullscreen
  2. SSAO texture downsampled width and height >> 2
  3. 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.

Categories: Graphics, Programming Tags:

SSAO without optimization

August 31st, 2009 Prompt No comments

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

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.

Categories: Graphics, Programming Tags: