SSAO

Image space ambient occlusion or Screen space ambient occlusion, based on http://www.shalinor.com/code.html and http://rgba.scenesp.org/iq/computer/articles/ssao/ssao.htm

gpgpu forums

code for copy paste ... but more instructions...maybe change g_cKernelSize to 8 or 12...


//-----------------------------------------------------------------------------
// File: PP_SSAO.fx
//
// Desc: Effect file for image post-processing sample. This effect contains
// a single technique with a pixel shader that calculates simple SSAO
// uses full screen depth and normals
//-----------------------------------------------------------------------------
texture Albedo; // Here are normals
texture NormalMap; // Here is depth
//--------------------------------------------------------------------------------------
// Texture samplers
//--------------------------------------------------------------------------------------
sampler AlbedoSampler = sampler_state {
Texture = (Albedo);
MipFilter = LINEAR;
MinFilter = LINEAR;
MagFilter = LINEAR;
ADDRESSU = WRAP;
ADDRESSV = WRAP;
};
sampler NormalMapSampler = sampler_state {
Texture = (NormalMap);
MipFilter = NONE;
MinFilter = LINEAR;
MagFilter = LINEAR;
ADDRESSU = WRAP;
ADDRESSV = WRAP;
};

static const int g_cKernelSize = 24;
float2 PixelKernel[g_cKernelSize ] = {
{-0.326212f, -0.405805f},
{-0.840144f, -0.07358f},
{-0.695914f, 0.457137f},
{-0.203345f, 0.620716f},
{ 0.96234f, -0.194983f},
{ 0.473434f, -0.480026f},
{-0.519456f, 0.767022f},
{ 0.185461f, -0.893124f},
{ 0.507431f, 0.064425f},
{ 0.89642f, 0.412458f},
{-0.32194f, -0.932615f},
{-0.791559f, -0.597705f},
{ 0.326212f, -0.405805f},
{ 0.840144f, -0.07358f},
{ 0.695914f, 0.457137f},
{ 0.203345f, 0.620716f},
{-0.96234f, -0.194983f},
{-0.473434f, -0.480026f},
{ 0.519456f, 0.767022f},
{-0.185461f, -0.893124f},
{-0.507431f, 0.064425f},
{-0.89642f, 0.412458f},
{ 0.32194f, -0.932615f},
{ 0.791559f, -0.597705f}
};


float2 TexelKernel[g_cKernelSize]
< convertpixelstotexels512 = "PixelKernel">;


//float3 Settings (AOCreaseValues - Range, Bias, Averager, Unused)
float4 Settings = { 0.4196,-0.2510,4.8471,3.0627 };
float4 SettingsB = { 25.8824,1.0000,1.0000,1.0000 };

float4 PostProcessPS( float2 Tex : TEXCOORD0 ) : COLOR0
{
// Get center sample
float UVlr = 1/256;
float2 centeredUV = Tex;
float3 centerPos = tex2D(AlbedoSampler, centeredUV).xyz; // normals
float3 centerNormal = tex2D(NormalMapSampler, centeredUV).xyz; // depth
float4 totalGI = 1.0f;
float GI = 0.0f;

// Run through all taps
for (int i = 0; i < sampleuv =" centeredUV" samplepos =" tex2D(AlbedoSampler," tocenter =" samplePos" distance =" length(toCenter);" centercontrib =" saturate((dot(toCenter,centerNormal)" rangeattenuation =" 1-saturate(distance" totalgi =" float4(GI,GI,GI,1.0f);" vertexshader =" null;" pixelshader =" compile" zenable =" false;">

Software in three weeks !

It's impossible to write a scriptable multi purpuse framework/application in three weeks.
Believe me, i tried.
At least if you want to keep the person you care about.

4th law of robotics !

MS Robotics Studio is great ! .NET ! CCR ! PhysiX ! State !
Great tool for prototyping and programming !

And the CCR is out, and you can use it !

The concept behind is awesome. State driven. Transitions, Behavior, Orchestration !
Had the idea years ago to do something like that, but I could not do it so good.
So the concept stayed in a drawer. I used some of the ideas for building of discreet simulation environment and the framework behind it.
Now the basics are done, infrastructure is great !

Now I will:
Make simulation ... I wonder if it's possible ... hmmm ... I will dig in ...
Make a rendering engine, connect, then abuse my imagination.
Lets make unpredictable environments, lets do the neural networks, favorite swarms, GA, GP, lets make some AI ! Wolfram here I come...

CA for paralell prediction models and simulators you've never seen before. Distributed chess anyone ?

But play as a figure... I will play for pawn, Who will be the queen, who's the king ? doesn't matter... you'll be simulated anyhow, like 30 million times in a second. And pawn will win, of course.

Go ahead, try it, make something with it !

Sim

i have been working a lot on this simulator, the project is nearing its finish. Still has some issues (you can say bugs) and then some optimizations have to be done...