From e4c7163e9d6a2065b601cb048f3c64e193c2f387 Mon Sep 17 00:00:00 2001 From: Zhongyue GUAN <79921457+AliceZhongyueGUAN@users.noreply.github.com> Date: Fri, 8 Dec 2023 19:33:36 +0800 Subject: [PATCH 1/4] Formula change --- docs/Basics/Stamp/stampRound.frag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Basics/Stamp/stampRound.frag b/docs/Basics/Stamp/stampRound.frag index d798168..bf0b683 100644 --- a/docs/Basics/Stamp/stampRound.frag +++ b/docs/Basics/Stamp/stampRound.frag @@ -33,7 +33,7 @@ void main() { // The quadratic equation float a, b, c, delta; a = 1.0 - pow(cosTheta, 2.0); - b = - 2.0 * (r0 * cosTheta + pLocal.x); + b = 2.0 * (r0 * cosTheta - pLocal.x); c = pow(pLocal.x, 2.0) + pow(pLocal.y, 2.0) - pow(r0, 2.0); delta = pow(b, 2.0) - 4.0*a*c; if(delta <= 0.0) discard; From e25724b09b0af46de41b358a068c50fe83c33f39 Mon Sep 17 00:00:00 2001 From: Zhongyue GUAN <79921457+AliceZhongyueGUAN@users.noreply.github.com> Date: Sat, 9 Dec 2023 16:37:40 +0800 Subject: [PATCH 2/4] Color issue solved --- docs/Basics/Stamp/stampRound.frag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Basics/Stamp/stampRound.frag b/docs/Basics/Stamp/stampRound.frag index bf0b683..8e5301e 100644 --- a/docs/Basics/Stamp/stampRound.frag +++ b/docs/Basics/Stamp/stampRound.frag @@ -56,7 +56,7 @@ void main() { // The main loop to sample and blend color from the footprint. int MAX_i = 128; float currIndex = startIndex; - vec4 currColor = vec4(0.0); + vec4 currColor = vec4(0.0,0.0,0.0,1e-10); for(int i = 0; i < MAX_i; i++){ float currStampLocalX = interval * (currIndex - index0); float currStampRadius = r0 - cosTheta * currStampLocalX; From d278e051870e9060284f81ab3bae9683a161a976 Mon Sep 17 00:00:00 2001 From: Zhongyue GUAN <79921457+AliceZhongyueGUAN@users.noreply.github.com> Date: Sat, 9 Dec 2023 16:40:04 +0800 Subject: [PATCH 3/4] Color issue solved with comment --- docs/Basics/Stamp/stampSquare.frag | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Basics/Stamp/stampSquare.frag b/docs/Basics/Stamp/stampSquare.frag index c45369d..ff94e19 100644 --- a/docs/Basics/Stamp/stampSquare.frag +++ b/docs/Basics/Stamp/stampSquare.frag @@ -46,7 +46,7 @@ void main() { if(startIndex > endIndex) discard; int MAX_i = 128; float currIndex = startIndex; - vec4 currColor = vec4(0.0); + vec4 currColor = vec4(0.0,0.0,0.0,1e-10); // set alpha as 1e-10 to avoid numerical error for(int i = 0; i < MAX_i; i++){ float currStampLocalX = interval * (currIndex - index0); vec2 pToCurrStamp = pLocal - vec2(currStampLocalX, 0.0); @@ -63,4 +63,4 @@ void main() { } outColor = currColor; return; -} \ No newline at end of file +} From 585c53be887a9fb73498ab7da897054e0c506f18 Mon Sep 17 00:00:00 2001 From: Zhongyue GUAN <79921457+AliceZhongyueGUAN@users.noreply.github.com> Date: Sat, 9 Dec 2023 16:40:43 +0800 Subject: [PATCH 4/4] color issue solved with comment --- docs/Basics/Stamp/stampRound.frag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Basics/Stamp/stampRound.frag b/docs/Basics/Stamp/stampRound.frag index 8e5301e..42e8d8f 100644 --- a/docs/Basics/Stamp/stampRound.frag +++ b/docs/Basics/Stamp/stampRound.frag @@ -56,7 +56,7 @@ void main() { // The main loop to sample and blend color from the footprint. int MAX_i = 128; float currIndex = startIndex; - vec4 currColor = vec4(0.0,0.0,0.0,1e-10); + vec4 currColor = vec4(0.0,0.0,0.0,1e-10); // set alpha as 1e-10 to avoid numerical error for(int i = 0; i < MAX_i; i++){ float currStampLocalX = interval * (currIndex - index0); float currStampRadius = r0 - cosTheta * currStampLocalX;