Thanks for the reply, I implemented the SSAO compositor to see how things will ends up, unfortunately it is not giving me the expected result. In other word I have a problem with it.
The first problem is a hug drop in FPS, I think this is related to the bad shaders configuration that I implemented.
The second problem is that the SSAO is not working as expected, when I slightly move the camera I see a distortion on the surface while there is no ambient occlusion working.
To give you an idea of what I did I just implemented the SSAO provided in this thread
http://www.ogre3d.org/tikiwiki/Simple+SSAO , then I derived my material from diffuse_template.
I guess my main problem here is that I'm using triplanar texturing, so what I basically did was this:
Triplanar texturing material:
Code:
import diffuse_template from "diffuse.material"
material TriplanarTexturing : diffuse_template
{
technique
{
pass
{
vertex_program_ref TriplanarTexturingVertexProgram
{
param_named_auto world world_matrix
param_named_auto viewProj viewproj_matrix
param_named_auto camPos camera_position
// 0.083333333 = 1/12.0
param_named textureScale float 0.083333333
param_named lightColor float3 1.3 1.3 1.3
param_named darkColor float3 0.2 0.2 0.2
//param_named dirToLight float3 0 0.957826285 -0.287347886
param_named_auto fogParams fog_params
param_named_auto light0.position light_position 0
param_named_auto light0.diffuseColour light_diffuse_colour 0
param_named_auto light0.attenuation light_attenuation 0
param_named_auto light1.position light_position 1
param_named_auto light1.diffuseColour light_diffuse_colour 1
param_named_auto light1.attenuation light_attenuation 1
param_named_auto light2.position light_position 2
param_named_auto light2.diffuseColour light_diffuse_colour 2
param_named_auto light2.attenuation light_attenuation 2
}
fragment_program_ref TriplanarTexturingFragmentProgram
{
param_named_auto fogColor fog_colour
param_named textureSize float 1024.0
param_named noOfTexturesPerDimension float 4.0
}
ambient 0 0 0 1
diffuse 0.65098 0.647059 0.596078 1
}
}
}
and then my main material that is applied to Polyvox volume is this:
ARNOLD.material
Code:
import * from "triplanarTexturing.material"
vertex_program Simple_Perpixel_Vert cg
{
source ARNOLD.cg
default_params
{
param_named_auto lightPosition light_position_object_space 0
param_named_auto eyePosition camera_position_object_space
param_named_auto worldviewproj worldviewproj_matrix
}
entry_point Simple_Perpixel_Vert
profiles vs_1_1 arbvp1
}
fragment_program Simple_PerPixel_Frag cg
{
source ARNOLD.cg
default_params
{
param_named_auto lightDiffuse light_diffuse_colour 0
param_named_auto lightSpecular light_specular_colour 0
param_named exponent float 127
//VERY high value, to produce large highlights
param_named ambient float4 0.0 0.0 0.0 1.0
//faint environment lighting
}
entry_point Simple_PerPixel_Frag
profiles ps_2_0 arbfp1
}
material Simple_Perpixel : TriplanarTexturing
{
technique
{
pass
{
vertex_program_ref TriplanarTexturingVertexProgram
{
}
fragment_program_ref TriplanarTexturingFragmentProgram
{
}
texture_unit
{
texture texatlas.tga 2d 5
}
}
}
}
void Ambient_vp(
float4 position : POSITION,
out float4 oPosition : POSITION,
out float4 colour : COLOR,
uniform float4x4 worldViewProj,
uniform float4 ambient)
{
oPosition = mul(worldViewProj, position);
colour = ambient;
}
vertex_program Ambient cg
{
source ARNOLD.cg
default_params
{
param_named_auto worldViewProj worldviewproj_matrix
param_named ambient float4 0.2 0.2 0.2 1.0
}
entry_point Ambient_vp
profiles vs_1_1 arbvp1
}