Ambient occlusion, is it possible?

  • Tiberius

Bruce, I'll have a go at parallax mapping today, shouldn't be too difficult.

Nice, thanks Cam :tongue:

Was looking at the Cg toolkit, a shader in there for reflect mapping, would that be possible to do if the stuff for bump mapping is already in there? It seems to need more vectors than Racer passes, I'm not good with the vector/matrix stuff so really hit a dead end there.
 
I don't like the
Code:
*max(lightColor,lightAmbient)
;

My atmosphere.cg is using
Code:
*lightColor + lightAmbient
instead. I'm not sure which is physically more accurate but this works decently for me. They're both float3s and I'm not sure how max(float3,float3) works so I avoided it. Maybe it returns (max(1.r,2.r), max(1.g,2.g), max(1.b,2.b)) triplet?


I think there's a bug in the dyn_refl_bump shader when it adds the bump vector to the normal but I can't get my head around the vector addition bumpmapping uses. The texture seams on my RX7 light up when it's facing certain ways (eg. between hood and side) even though the bumpmap is perfectly flat in both areas, and I get this weird low resolution noise on the default Lamborghini which seems to somehow rotate the specular lighting:confused:
 
Bump :D

I found this web-page which looked quite interesting.

http://www.gamerendering.com/category/lighting/ssao-lighting/

They talk about the depth map and a normal map which I *think* Racer might support in passing to the shaders now.

They also talk about the normal map randomiser for the sampling and provide one too (what Mitch talked about but never offered iirc)


Has anyone tried anything with HBSSAO, or SSHBAO as Mitch called it hehe...?

It'd be nice to get this working now. It's almost 30 months later and GPU's should easily be able to cope with this kinda effect generally now.

Just with v0.9 around the corner and the graphics world generally moving along like a rocket in the real-time space, it'd be good to keep Racer progressing as much as possible.

If AO done like this is effective enough it opens up a large scope for using different techniques to render/uv map items without shading baked in as much or at all, which then opens up other avenues to content creation. Ie, making things better more easily!


Hmmmm... gonna have a play later but just thought I'd post it up for now :D


Cheers

Dave
 
Hey Dave, you mentioned in another thread about a DOF FS shader, I couldn't find that on my version... if there is something using a depth buffer already then basic SSAO algorithms should be implementable without an update for Racer.
 
racer\data\renderer\fullscreen_shaders_hdr\bloom_shadows_dof_f.cg

That is the one I enabled in the fs_filter1 entry in racer.ini and I get an ok DOF effect...

Code:
// CSM Shadowmapping + Bloom + Colorgrade
// HDR version
 
#include "../common/constants.cg"
#include "../common/hdr.cg"
#include "../common/utils.cg"
#include "bloom.cg"
#include "common_fs.cg"
 
struct VertOut
{
  float4 pos : POSITION;
  float4 col : COLOR0;
  float2 tc0 : TEXCOORD0;
};
 
struct FragOut
{
  float4 col : COLOR;
};
 
 
 
float BlurTexture(sampler2D tex, float2 vin, float blur, sampler2D depthMap)
// With Z sampling
{
  return tex2D(tex,vin).a;
 
}
 
 
float ComputeDepthBlur (float depth)
{
    float4 vDofVars = float4(0,0,1,1);
   
    float f;
   
    if (depth < 0.997)
        {
            f = (depth-1)/(0.7-0.9);;//(depth - vDofVars.y)/(vDofVars.y - vDofVars.x);   
        } else
        {
            //scale to 0...1
            f = (1-depth)/(0.7-0.9);//(depth - vDofVars.y)/(vDofVars.z - vDofVars.y);
           
            //clamp far to max blur
            //f = clamp (f, 0, 0.5);
        }
    return f;// * 0.5f + 0.5f;
}
   
 
 
float4 DOFFilter (float2 tc0, sampler2D sceneMap, float depthVar)
{
 
    float2 pixelSizeLow = float2(0.0007, 0.0013);
    float2 pixelSizeHigh = float2(0.0005, 0.0009);
   
    float2 vMaxCoC = float2(2.0, 25.0);
 
    float4 cOut;
    float discRad;
    float discRadLow;
    float centerDepth;
   
    float lowScale = 1.84;
   
    cOut = tex2D(sceneMap, tc0);
    //float4 cDepth = tex2D(depthMap, tc0);
   
    //depthVar = 0;
   
    cOut.a = depthVar;//cDepth.a;
    centerDepth=cOut.a;
   
    //convert depth into blur radius
    discRad = abs(cOut.a * vMaxCoC.y - vMaxCoC.x);
    discRadLow = discRad * lowScale;
    cOut=0;
   
    for(int t=0; t<16; t++)
        {
            //compute tap coords
            float2 coordLow = tc0 + (pixelSizeLow * poissonDisk[t] * discRadLow);
            float2 coordHigh = tc0 + (pixelSizeHigh * poissonDisk[t] * discRad);
           
            //fetch high res tap
            float4 tapLow = tex2D (sceneMap, coordLow);
            float4 tapHigh = tex2D (sceneMap, coordHigh);
           
            //mix high and low taps
            float tapBlur = abs(tapHigh.a * 2.0 - 1.0); //put blur into 0...1
            float4 tap = lerp(tapHigh, tapLow, tapBlur);
           
            //SMARTblur
            tap.a = (tap.a >= centerDepth) ? 1.0 : abs(tap.a * 2.0 - 1.0);
           
            cOut.rgb += tap.rgb * tap.a;
            cOut.a += tap.a;
        }
    return (cOut / cOut.a);
}
 
 
 
FragOut main(
  VertOut vin,
  uniform sampler2D sceneMap    : TEXUNIT0,
  uniform sampler2D velocityMap : TEXUNIT1,
  /// Z in TEXUNIT5
  uniform sampler2D bloomMap1  : TEXUNIT2,
  uniform sampler2D bloomMap2  : TEXUNIT3,
  uniform sampler2D bloomMap3  : TEXUNIT4,
//#ifdef CSM_MRT
  uniform sampler2D depthMap    : TEXUNIT5,
  uniform sampler2D shadowMap  : TEXUNIT6,
  uniform sampler3D gradeMap    : TEXUNIT7,
//#else
  //uniform sampler3D gradeMap    : TEXUNIT6,  // 3D texture for color grading
//#endif
  uniform float alpha,              // Amount of blur
  uniform float exposure
)
{
  FragOut fout;
 
  float4 ambientColor,
        sdColor;                // Specular+diffuse
  float4 color;
 
#ifdef CSM_MRT
  // Original color
  ambientColor=tex2D(sceneMap,vin.tc0);
  sdColor=tex2D(shadowMap,vin.tc0);
 
  float shadowAmount=BlurTexture(shadowMap, vin.tc0,smBlurAmount,depthMap);
  color=ambientColor+shadowAmount*sdColor;
#else
  // Single render-target (RT)
  color=tex2D(sceneMap,vin.tc0);
#endif
 
  float4 depthColor=tex2D(depthMap,vin.tc0);
  float4 bloomColor=BloomCombineMaps3(bloomMap1,bloomMap2,bloomMap3,vin.tc0);
  color=BloomMix(color,bloomColor);
 
// Show the 3 bloom stages and the end-result in 1 view
/*if(vin.tc0.y>0.5)
{
if(vin.tc0.x>0.666)color=tex2D(bloomMap3,vin.tc0);
else if(vin.tc0.x>0.333)color=tex2D(bloomMap2,vin.tc0);
else color=tex2D(bloomMap1,vin.tc0);
}*/
 
    float depthV = ComputeDepthBlur(depthColor);
 
    float4 DOFtest = DOFFilter(vin.tc0, sceneMap, depthV);
 
  // HDR -> LDR tonemap
  //color.rgb=ToneMapHDR(color,exposure);
  DOFtest.rgb=ToneMapHDR(DOFtest,exposure);
 
  // Color grading
  color.rgb=ColorGrade(color.rgb,gradeMap);
 
 
 
  //fout.col.rgb=color;
  // Motion blur blend
  //fout.col.a=alpha;
  fout.col.rgb = DOFtest.rgb;
  //fout.col.rgb = depthV;
  fout.col.a = alpha;
 
  return fout;
}

I guess it's this bit then?

float depth

If I put fout.col.rgb = depth, and col.a = 1, will that then in theory just draw the frame as the depth map (to test it?)

Thanks

Dave
 
In theory that should test it, yeah. I'll save a copy and try it later when I have some time, I definitely didn't get that file with 0.8.40.
 
I just over-write old versions, so I have no idea where this came from then... I know Cam was working on a DOF shader but I was certain this one wasn't the one he sent me, I don't think he even sent me it...

But maybe he did...

It's pretty old though.

It's also not working at all like expected any more in Racer... hehe, maybe the depth map is not in again!? Who knows... I'm not that good at this stuff :D

Dave
 
Well there went 40mins of my life with no results :D

I think half the issue is the shaders Mitch write were pre-CSM implement, and also back then pre-HDR implement.

So I either get an over-bright scene which I can't make dark even with really low environment values, or I get it looking right but I fear the AO element is being washed totally out because it's applied in LDR (ie, the intensity is really low)


I've tried un-commenting the appropriate bits so we just see the AO or the depth map, but that didn't work either...


It does run at 20fps vs 90fps or so, so it's certainly working, but I have no idea how to make just the AO show up on it's own... or the depthMap for that matter...

Hmmm

Dave
 
And I'm sure I've just spotted the old issue again with shadows.

I thought it was fixed but it looks like the shadow map is sharp at the end of the car you are not looking from, and it's blurry closest to the camera. If you move to the other end of the car the shadow is then blurry there, and sharp where you just came from.

Basically it's backwards.

Is anyone else seeing that?


Pretty sure depthMap isn't being passed too, I just removed it from the default fs_filter1 shader entirely and the rendering looked exactly the same as with it there...??


I think before we waste too much time it's worth asking Ruud what is going on again here. That DOF script did work about 1yr ago but it not working now makes me think perhaps the depthMap has been de-activated again!?


Hmmm

Dave
 
The depthMap might be texunit6 now? Not sure... It got/gets moved around depending on CSM IIRC.

Heh, reading through this thread it seems we got a lot of our wishes granted by Ruud, thanks!

I don't think Tiberius is still around is he? I was gonna have another shot at parallax mapping...
 
racer\data\renderer\fullscreen_shaders_hdr\bloom_shadows_dof_f.cg

That is the one I enabled in the fs_filter1 entry in racer.ini and I get an ok DOF effect...

Code:
// CSM Shadowmapping + Bloom + Colorgrade
// HDR version
 
#include "../common/constants.cg"
#include "../common/hdr.cg"
#include "../common/utils.cg"
#include "bloom.cg"
#include "common_fs.cg"
 
struct VertOut
{
  float4 pos : POSITION;
  float4 col : COLOR0;
  float2 tc0 : TEXCOORD0;
};
 
struct FragOut
{
  float4 col : COLOR;
};
 
 
 
float BlurTexture(sampler2D tex, float2 vin, float blur, sampler2D depthMap)
// With Z sampling
{
  return tex2D(tex,vin).a;
 
}
 
 
float ComputeDepthBlur (float depth)
{
    float4 vDofVars = float4(0,0,1,1);
 
    float f;
 
    if (depth < 0.997)
        {
            f = (depth-1)/(0.7-0.9);;//(depth - vDofVars.y)/(vDofVars.y - vDofVars.x); 
        } else
        {
            //scale to 0...1
            f = (1-depth)/(0.7-0.9);//(depth - vDofVars.y)/(vDofVars.z - vDofVars.y);
         
            //clamp far to max blur
            //f = clamp (f, 0, 0.5);
        }
    return f;// * 0.5f + 0.5f;
}
 
 
 
float4 DOFFilter (float2 tc0, sampler2D sceneMap, float depthVar)
{
 
    float2 pixelSizeLow = float2(0.0007, 0.0013);
    float2 pixelSizeHigh = float2(0.0005, 0.0009);
 
    float2 vMaxCoC = float2(2.0, 25.0);
 
    float4 cOut;
    float discRad;
    float discRadLow;
    float centerDepth;
 
    float lowScale = 1.84;
 
    cOut = tex2D(sceneMap, tc0);
    //float4 cDepth = tex2D(depthMap, tc0);
 
    //depthVar = 0;
 
    cOut.a = depthVar;//cDepth.a;
    centerDepth=cOut.a;
 
    //convert depth into blur radius
    discRad = abs(cOut.a * vMaxCoC.y - vMaxCoC.x);
    discRadLow = discRad * lowScale;
    cOut=0;
 
    for(int t=0; t<16; t++)
        {
            //compute tap coords
            float2 coordLow = tc0 + (pixelSizeLow * poissonDisk[t] * discRadLow);
            float2 coordHigh = tc0 + (pixelSizeHigh * poissonDisk[t] * discRad);
         
            //fetch high res tap
            float4 tapLow = tex2D (sceneMap, coordLow);
            float4 tapHigh = tex2D (sceneMap, coordHigh);
         
            //mix high and low taps
            float tapBlur = abs(tapHigh.a * 2.0 - 1.0); //put blur into 0...1
            float4 tap = lerp(tapHigh, tapLow, tapBlur);
         
            //SMARTblur
            tap.a = (tap.a >= centerDepth) ? 1.0 : abs(tap.a * 2.0 - 1.0);
         
            cOut.rgb += tap.rgb * tap.a;
            cOut.a += tap.a;
        }
    return (cOut / cOut.a);
}
 
 
 
FragOut main(
  VertOut vin,
  uniform sampler2D sceneMap    : TEXUNIT0,
  uniform sampler2D velocityMap : TEXUNIT1,
  /// Z in TEXUNIT5
  uniform sampler2D bloomMap1  : TEXUNIT2,
  uniform sampler2D bloomMap2  : TEXUNIT3,
  uniform sampler2D bloomMap3  : TEXUNIT4,
//#ifdef CSM_MRT
  uniform sampler2D depthMap    : TEXUNIT5,
  uniform sampler2D shadowMap  : TEXUNIT6,
  uniform sampler3D gradeMap    : TEXUNIT7,
//#else
  //uniform sampler3D gradeMap    : TEXUNIT6,  // 3D texture for color grading
//#endif
  uniform float alpha,              // Amount of blur
  uniform float exposure
)
{
  FragOut fout;
 
  float4 ambientColor,
        sdColor;                // Specular+diffuse
  float4 color;
 
#ifdef CSM_MRT
  // Original color
  ambientColor=tex2D(sceneMap,vin.tc0);
  sdColor=tex2D(shadowMap,vin.tc0);
 
  float shadowAmount=BlurTexture(shadowMap, vin.tc0,smBlurAmount,depthMap);
  color=ambientColor+shadowAmount*sdColor;
#else
  // Single render-target (RT)
  color=tex2D(sceneMap,vin.tc0);
#endif
 
  float4 depthColor=tex2D(depthMap,vin.tc0);
  float4 bloomColor=BloomCombineMaps3(bloomMap1,bloomMap2,bloomMap3,vin.tc0);
  color=BloomMix(color,bloomColor);
 
// Show the 3 bloom stages and the end-result in 1 view
/*if(vin.tc0.y>0.5)
{
if(vin.tc0.x>0.666)color=tex2D(bloomMap3,vin.tc0);
else if(vin.tc0.x>0.333)color=tex2D(bloomMap2,vin.tc0);
else color=tex2D(bloomMap1,vin.tc0);
}*/
 
    float depthV = ComputeDepthBlur(depthColor);
 
    float4 DOFtest = DOFFilter(vin.tc0, sceneMap, depthV);
 
  // HDR -> LDR tonemap
  //color.rgb=ToneMapHDR(color,exposure);
  DOFtest.rgb=ToneMapHDR(DOFtest,exposure);
 
  // Color grading
  color.rgb=ColorGrade(color.rgb,gradeMap);
 
 
 
  //fout.col.rgb=color;
  // Motion blur blend
  //fout.col.a=alpha;
  fout.col.rgb = DOFtest.rgb;
  //fout.col.rgb = depthV;
  fout.col.a = alpha;
 
  return fout;
}

I guess it's this bit then?

float depth

If I put fout.col.rgb = depth, and col.a = 1, will that then in theory just draw the frame as the depth map (to test it?)

Thanks

Dave
Yeah, that looks like my code...no one else would be stupid enough to comment out the ifdefs!
 
Yeah, looks like it's in TEXUNIT6 now.

I'm a little unclear on what the 'csm' actually is since as you mentioned the ifdefs are commented out and apparently my system's using the #else section.

ir9JI.jpg


Fixed it up and it's running again in 0.8.40.
Code:
#ifdef CSM_MRT
  uniform sampler2D depthMap    : TEXUNIT5,
  uniform sampler2D shadowMap  : TEXUNIT6,
  uniform sampler3D gradeMap    : TEXUNIT7,
#else
  uniform sampler3D gradeMap    : TEXUNIT5,  // 3D texture for color grading
  uniform sampler2D depthMap    : TEXUNIT6,
I think this is how it goes. I also made colorGrading work, to the extent it already works (ie. this really shouldn't be causing sepia tone based on the hue but does)
 
I've been trying for the past 2 hours to get the depthmap to show up with no dice...what the hell?

And yeah, I dunno what's going on with the ifdefs, maybe something to do with racer Pro?

Now all we need for a photomode is to be able to modify shader values in realtime so we can adjust exposure and the CoC values in the DoF shader :D

So all I need to change to get the DoF working is those defs above?


###EDIT###

AARGH!!

So I drove forward a little and my screen went from being white to having the depth buffer nicely linearised in front of me...what the hell?
 
Yeah, depth buffer seems to kick in after about 15 seconds of driving. Kind of a pain. (you also need to enable it in Racer.ini, I think, it's motion_blur.depth_of_field=1)


I wasn't entirely happy with your functions so I wrote my own.
Code:
// CSM Shadowmapping + Bloom + Colorgrade
// HDR version

#include "../common/constants.cg"
#include "../common/hdr.cg"
#include "../common/utils.cg"
#include "bloom.cg"
#include "common_fs.cg"

struct VertOut
{
  float4 pos : POSITION;
  float4 col : COLOR0;
  float2 tc0 : TEXCOORD0;
};

struct FragOut
{
  float4 col : COLOR;
};



float BlurTexture(sampler2D tex, float2 vin, float blur, sampler2D depthMap)
// With Z sampling
{
  return tex2D(tex,vin).a;

}


float ComputeDepthBlur (float depth, float k)
{
    float4 vDofVars = float4(0,0,1,1);
    // k is the target depth
    float f;
    depth = (1-depth);
    // note that k is 1/target
    k = (1-k);
    // approximating a thin lens system here.
    // assuming an ideal image plane at v0
    float v0 = 1.0;
    // first, calculate the focal length of the lens
    // or rather, the inverse of it
    float foc = k + 1/v0;
    // now we can calculate the actual imaging plane for our depth
    float vx = foc - depth;
    // one more constant comes into play
    float d = 100.0; // d is aperture width.
    f = d*abs(1/foc * (v0-1/foc))*abs(1-v0*vx);
    // and as before vx is actually 1/length, to avoid doing a bunch of inverses.
    /*if (depth < k)
        {
            f = (depth-k)/(0.7-0.9);;//(depth - vDofVars.y)/(vDofVars.y - vDofVars.x);
        } else
        {
            //scale to 0...1
            f = (k-depth)/(0.7-0.9);//(depth - vDofVars.y)/(vDofVars.z - vDofVars.y);

            //clamp far to max blur
        }*/
    //f = abs((depth-k)/depth)*0.8;
    f = clamp (f, 0, 7.0);
    return f;// * 0.5f + 0.5f;
}



float4 DOFFilter (float2 tc0, sampler2D sceneMap, float depthVar)
{

    float2 pixelSizeLow = float2(0.0007, 0.0013);
    float2 pixelSizeHigh = float2(0.0005, 0.0009);

    float2 vMaxCoC = float2(0.0, 25.0);

    float4 cOut;
    float discRad;
    float discRadLow;
    float centerDepth;

    float lowScale = 1.84;

    cOut = tex2D(sceneMap, tc0);
    //float4 cDepth = tex2D(depthMap, tc0);

    //depthVar = 0;

    cOut.a = depthVar;//cDepth.a;
    centerDepth=cOut.a;

    //convert depth into blur radius
    discRad = abs(cOut.a);
    //discRad = abs(cOut.a*vMaxCoC.y - vMaxCoC.x);
    discRadLow = discRad * lowScale;
    cOut=0;

    for(int t=0; t<16; t++)
        {
            //compute tap coords
            float2 coordLow = tc0 + (pixelSizeLow * poissonDisk[t] * discRadLow);
            float2 coordHigh = tc0 + (pixelSizeHigh * poissonDisk[t] * discRad);

            //fetch high res tap
            float4 tapLow = tex2D (sceneMap, coordLow);
            float4 tapHigh = tex2D (sceneMap, coordHigh);

            //mix high and low taps
            float tapBlur = abs(tapHigh.a * 2.0 - 1.0); //put blur into 0...1
            float4 tap = lerp(tapHigh, tapLow, tapBlur);

            //SMARTblur
            tap.a = (tap.a >= centerDepth) ? 1.0 : abs(tap.a * 2.0 - 1.0);

            cOut.rgb += tap.rgb * tap.a;
            cOut.a += tap.a;
        }
    return (cOut / cOut.a);
}



FragOut main(
  VertOut vin,
  uniform sampler2D sceneMap    : TEXUNIT0,
  uniform sampler2D velocityMap : TEXUNIT1,
  /// Z in TEXUNIT5
  uniform sampler2D bloomMap1  : TEXUNIT2,
  uniform sampler2D bloomMap2  : TEXUNIT3,
  uniform sampler2D bloomMap3  : TEXUNIT4,
#ifdef CSM_MRT
  uniform sampler2D depthMap    : TEXUNIT5,
  uniform sampler2D shadowMap  : TEXUNIT6,
  uniform sampler3D gradeMap    : TEXUNIT7,
#else
  uniform sampler3D gradeMap    : TEXUNIT5,  // 3D texture for color grading
  uniform sampler2D depthMap    : TEXUNIT6,
#endif
  uniform float alpha,              // Amount of blur
  uniform float exposure
)
{
  FragOut fout;

  float4 ambientColor,
        sdColor;                // Specular+diffuse
  float4 color;

#ifdef CSM_MRT
  // Original color
  ambientColor=tex2D(sceneMap,vin.tc0);
  sdColor=tex2D(shadowMap,vin.tc0);

  float shadowAmount=BlurTexture(shadowMap, vin.tc0,smBlurAmount,depthMap);
  color=ambientColor+shadowAmount*sdColor;
#else
  // Single render-target (RT)
  color=tex2D(sceneMap,vin.tc0);
#endif

  float4 depthColor=tex2D(depthMap,vin.tc0);
  float4 bloomColor=BloomCombineMaps3(bloomMap1,bloomMap2,bloomMap3,vin.tc0);
  color=BloomMix(color,bloomColor);

// Show the 3 bloom stages and the end-result in 1 view
/*if(vin.tc0.y>0.5)
{
if(vin.tc0.x>0.666)color=tex2D(bloomMap3,vin.tc0);
else if(vin.tc0.x>0.333)color=tex2D(bloomMap2,vin.tc0);
else color=tex2D(bloomMap1,vin.tc0);
}*/

    float depthV = ComputeDepthBlur(depthColor,tex2D(depthMap,float2(0.5f,0.5f)));
    //float depthV = ComputeDepthBlur(depthColor,0.91f);

    float4 DOFtest = DOFFilter(vin.tc0, sceneMap, depthV);

  // HDR -> LDR tonemap
  //color.rgb=ToneMapHDR(color,exposure);
  DOFtest.rgb=ToneMapHDR(DOFtest,exposure);

  // Color grading
  //color.rgb=ColorGrade(color.rgb,gradeMap);
  DOFtest.rgb = ColorGrade(DOFtest.rgb,gradeMap);


  //fout.col.rgb=color;
  // Motion blur blend
  //fout.col.a=alpha;
  fout.col.rgb = DOFtest.rgb;
  //fout.col.rgb = depthV;
  fout.col.a = alpha;
  //fout.col.rgb=depthColor;
  //fout.col.rgb=10f*(depthColor-0.9);
  return fout;
}

I grabbed the calculations from this GPUGems chapter.

The thing is, being more accurate, it's also extremely subtle in most situations. DOF really doesn't come up a lot unless the aperture is crazy huge.

Or if you do a closeup of something.
BlKOD.jpg


To tweak the size of the depth of the field, tune 'float d=100.0'. If you bump it up to say 500.0, you'll get a more visible dof, because the actual in-focus depth will be much narrower.

The code's also been changed to do auto-focus to the center of the screen, if you're wondering. So you shouldn't need to tweak it much in realtime, except to get different depth effects.


That old issue where some loads will have ~30% fps seems to be back, although not related to the fs shader per se.
 
Nice work hehe. I don't get a lot of what is in these fs shaders, quite a bit seems redundant. It'll be good to streamline it a bit if possible, and get it tidy maybe.

Anyone care to have a shot at AO then hehe :)

I'll be playing again tonight to see what I can come up with... I hope I can get it over 20fps though, I prefer my 90fps :) guessing that was just because it was unoptimised code Mitch posted right back when AO was still fairly new and he was just getting into the technique etc.

Cheers

Dave
 
I got it to work...but then when I tried to optimise it (there was some weird banding in the AO pass due to the depth map) I ended up breaking it...

Then I stumbled on to a shader that does a bit of GI too, so I'll have a go at implementing that, it still only uses the SS normals and depth map.
 
SSAO is prob fine for our needs, hbao maybe for 'photomode' hehe.

Not sure how GI would work, but I guess there are a million and one implements available. Wouldn't the best system be IBL ref cube maps generated at given intervals around a track at load/runtime, or tod change interval?! Then just put AO over the top?? That would in theory get you radiosity too, just interpolate between cube map influences, hmmm... Hmmm...

Dave
 

Latest News

Are you buying car setups?

  • Yes

  • No


Results are only viewable after voting.
Back
Top