Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
ShenCiao committed Dec 9, 2023
2 parents 4907b9a + 585c53b commit fddb1c6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/Basics/Stamp/stampRound.frag
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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); // 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;
Expand Down
4 changes: 2 additions & 2 deletions docs/Basics/Stamp/stampSquare.frag
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -63,4 +63,4 @@ void main() {
}
outColor = currColor;
return;
}
}

0 comments on commit fddb1c6

Please sign in to comment.