]> git.tdb.fi Git - libs/gl.git/commitdiff
Increase ambient occlusion max samples to 128
authorMikko Rasa <tdb@tdb.fi>
Sat, 8 May 2021 17:37:50 +0000 (20:37 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 9 May 2021 07:53:57 +0000 (10:53 +0300)
builtin_data/_ambientocclusion.glsl
source/effects/ambientocclusion.cpp

index 4cc74e18c26962f5db7b10a238d38a9cf8f0ba36..ecdaed7a46256e1101cc5b332d8ad2001f6b499c 100644 (file)
@@ -1,4 +1,4 @@
-const int max_samples = 32;
+const int max_samples = 128;
 
 uniform CameraTransform
 {
index 430ac0ba86556747005fb046ce5a3e32aaaddb7d..c35e5771de1d76f3a7ea95e8ab9c2125f7156754 100644 (file)
@@ -67,10 +67,10 @@ float AmbientOcclusion::radical_inverse(unsigned n)
 
 void AmbientOcclusion::set_n_samples(unsigned n)
 {
-       if(n<1 || n>32)
+       if(n<1 || n>128)
                throw out_of_range("AmbientOcclusion::set_n_samples");
 
-       Vector3 sample_points[32];
+       vector<Vector3> sample_points(n);
        for(unsigned i=0; i<n; ++i)
        {
                float r = static_cast<float>(i)/n;