- occlude_shdata.uniform("depth_ratio", depth_ratio, 1+depth_ratio);
- combine_shdata.uniform("depth_ratio", depth_ratio, 1+depth_ratio);
+ unsigned seed = 1;
+ float radius_divisor = (n-1)*(n-1);
+ Vector3 sample_points[32];
+ for(unsigned i=0; i<n; ++i)
+ {
+ Vector3 v(random(seed)-0.5f, random(seed)-0.5f, random(seed)-0.5f);
+ sample_points[i] = normalize(v)*(0.1f+0.9f*i*i/radius_divisor);
+ }
+ shdata.uniform3_array("sample_points", n, &sample_points[0].x);
+ shdata.uniform("n_samples", static_cast<int>(n));
+}
+
+void AmbientOcclusion::set_occlusion_radius(float r)
+{
+ shdata.uniform("occlusion_radius", r);
+}
+
+void AmbientOcclusion::set_depth_ratio(float)
+{