From bde14daeabbb70ac9adf874752a7395d29397bb6 Mon Sep 17 00:00:00 2001 From: Andreas Grois Date: Sat, 24 Mar 2018 10:07:18 +0100 Subject: Properly scale values added to importance map --- BuddhaTest/Shaders/BuddhaCompute.glsl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'BuddhaTest/Shaders') diff --git a/BuddhaTest/Shaders/BuddhaCompute.glsl b/BuddhaTest/Shaders/BuddhaCompute.glsl index b2af1e0..63b9000 100644 --- a/BuddhaTest/Shaders/BuddhaCompute.glsl +++ b/BuddhaTest/Shaders/BuddhaCompute.glsl @@ -65,7 +65,7 @@ void uintMaxIP(inout uvec3 modified, const uvec3 constant) uintMaxIP(modified[i],constant[i]); } -void addToImportanceMap(vec2 orbitParameter) +void addToImportanceMap(vec2 orbitParameter, uint value) { //as starting point values are in [-2:2], importance map has an aspect ratio of 2:1, as it is symmetric around x-axis. //float width = sqrt(float(2*(importanceMap.length() - 1))); @@ -77,7 +77,7 @@ void addToImportanceMap(vec2 orbitParameter) //now both components are between 0 and 1 uint xc = uint(clamp(scaled.x*100.0,0.0,100.0)); uint yc = uint(clamp(scaled.y*50.0,0.0,50.0)); - atomicAdd(importanceMapCache[xc+100*yc],1); + atomicAdd(importanceMapCache[xc+100*yc],value); } void addToColorOfCell(uvec2 cell, uvec3 toAdd) @@ -265,7 +265,7 @@ bool drawOrbit(in vec2 offset, in uint totalIterations, in uint scale, inout vec if(lastVal.x > imageRange[0] && lastVal.x < imageRange[2] && lastVal.y > imageRange[1] && lastVal.y < imageRange[3]) { addToColorAt(lastVal,scale*uvec3(i < orbitLength.r,i < orbitLength.g,i < orbitLength.b)); - addToImportanceMap(offset); + addToImportanceMap(offset, scale); } } iterationsLeftThisFrame -= (endCount - doneIterations); -- cgit v1.2.3