From 177f7a345c615e5934af16c97abde59127113b4c Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 8 May 2021 20:37:50 +0300 Subject: [PATCH] Increase ambient occlusion max samples to 128 --- builtin_data/_ambientocclusion.glsl | 2 +- source/effects/ambientocclusion.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin_data/_ambientocclusion.glsl b/builtin_data/_ambientocclusion.glsl index 4cc74e18..ecdaed7a 100644 --- a/builtin_data/_ambientocclusion.glsl +++ b/builtin_data/_ambientocclusion.glsl @@ -1,4 +1,4 @@ -const int max_samples = 32; +const int max_samples = 128; uniform CameraTransform { diff --git a/source/effects/ambientocclusion.cpp b/source/effects/ambientocclusion.cpp index 430ac0ba..c35e5771 100644 --- a/source/effects/ambientocclusion.cpp +++ b/source/effects/ambientocclusion.cpp @@ -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 sample_points(n); for(unsigned i=0; i(i)/n; -- 2.45.2