Last active
March 29, 2017 00:37
-
-
Save JBlackCat/7d297fd58254dcfdd471dd6687674ab9 to your computer and use it in GitHub Desktop.
Revisions
-
JBlackCat revised this gist
Mar 29, 2017 . 1 changed file with 8 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,6 +20,14 @@ void main() { const float tickLineThickness = 0.002; vec3 gridColor = vec3(0.5); // -------------------------------------- // -------------------------------------- // -------- Start Fancy Code ------------ // -------- "Code Here" ------------- // -------- End Fancy Code--------------- // -------------------------------------- // -------------------------------------- //Draw r grid lines for(float i = -1.0; i < 1.0; i +=tickWidth) { //i is the line coordinate; @@ -34,14 +42,6 @@ void main() { if(abs(p.y - i)< tickLineThickness) pixel = gridColor; } //[0,1] coordinat system axes if(abs(p.x) < pAxesThickness) pixel = pAxesColor; if(abs(p.y) < pAxesThickness) pixel = pAxesColor; -
JBlackCat revised this gist
Mar 28, 2017 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,9 +5,6 @@ void main() { vec2 r = vec2((gl_FragCoord.xy - 0.5*resolution.xy)/resolution.y) * 2.0; // Is [-1, 1] coordinate system vec2 p = vec2(gl_FragCoord.xy/resolution.xy); //[0,1] coordinate system //Set background color vec3 bgCol = vec3(0.0); // black vec3 pixel = bgCol; -
JBlackCat revised this gist
Mar 28, 2017 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,8 +5,8 @@ void main() { vec2 r = vec2((gl_FragCoord.xy - 0.5*resolution.xy)/resolution.y) * 2.0; // Is [-1, 1] coordinate system vec2 p = vec2(gl_FragCoord.xy/resolution.xy); //[0,1] coordinate system // //Maximum x value to maintain aspect ratio? //float xMax = iResolution.x/iResolution.y; //Set background color vec3 bgCol = vec3(0.0); // black -
JBlackCat revised this gist
Mar 28, 2017 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,9 @@ void main() { vec2 r = vec2((gl_FragCoord.xy - 0.5*resolution.xy)/resolution.y) * 2.0; // Is [-1, 1] coordinate system vec2 p = vec2(gl_FragCoord.xy/resolution.xy); //[0,1] coordinate system //Maximum x value to maintain aspect ratio? float xMax = iResolution.x/iResolution.y; //Set background color vec3 bgCol = vec3(0.0); // black vec3 pixel = bgCol; -
JBlackCat revised this gist
Mar 28, 2017 . 1 changed file with 19 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,6 +15,25 @@ void main() { vec3 pAxesColor = vec3(1.0, 0.412, 0.635); float pAxesThickness = 0.008; //Grid tick size const float tickWidth = 0.1; const float tickLineThickness = 0.002; vec3 gridColor = vec3(0.5); //Draw r grid lines for(float i = -1.0; i < 1.0; i +=tickWidth) { //i is the line coordinate; if(abs(r.x - i)< tickLineThickness) pixel = gridColor; if(abs(r.y - i)< tickLineThickness) pixel = gridColor; } //Draw p grid lines for(float i = -1.0; i < 1.0; i +=tickWidth) { //i is the line coordinate; if(abs(p.x - i)< tickLineThickness) pixel = gridColor; if(abs(p.y - i)< tickLineThickness) pixel = gridColor; } // -------------------------------------- // -------------------------------------- // -------- Start Fancy Code ------------ -
JBlackCat revised this gist
Mar 28, 2017 . 1 changed file with 9 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ //uniform vec2 resolution void main() { //coordinate systems vec2 r = vec2((gl_FragCoord.xy - 0.5*resolution.xy)/resolution.y) * 2.0; // Is [-1, 1] coordinate system @@ -13,11 +15,13 @@ void main() { vec3 pAxesColor = vec3(1.0, 0.412, 0.635); float pAxesThickness = 0.008; // -------------------------------------- // -------------------------------------- // -------- Start Fancy Code ------------ // -------- "Code Here" ------------- // -------- End Fancy Code--------------- // -------------------------------------- // -------------------------------------- //[0,1] coordinat system axes if(abs(p.x) < pAxesThickness) pixel = pAxesColor; -
JBlackCat revised this gist
Mar 28, 2017 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,13 @@ void main() { vec3 pAxesColor = vec3(1.0, 0.412, 0.635); float pAxesThickness = 0.008; // ----------------------------------- // ----------------------------------- // --------Fancy Code Here------------ // ----------------------------------- // ----------------------------------- //[0,1] coordinat system axes if(abs(p.x) < pAxesThickness) pixel = pAxesColor; if(abs(p.y) < pAxesThickness) pixel = pAxesColor; -
JBlackCat created this gist
Mar 28, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ void main() { //coordinate systems vec2 r = vec2((gl_FragCoord.xy - 0.5*resolution.xy)/resolution.y) * 2.0; // Is [-1, 1] coordinate system vec2 p = vec2(gl_FragCoord.xy/resolution.xy); //[0,1] coordinate system //Set background color vec3 bgCol = vec3(0.0); // black vec3 pixel = bgCol; vec3 rAxesColor = vec3(0.537, 1.0, 0.364); float rAxesThickness = 0.006; vec3 pAxesColor = vec3(1.0, 0.412, 0.635); float pAxesThickness = 0.008; //[0,1] coordinat system axes if(abs(p.x) < pAxesThickness) pixel = pAxesColor; if(abs(p.y) < pAxesThickness) pixel = pAxesColor; //[-1,1] coordinat system axes if(abs(r.x) < rAxesThickness) pixel = rAxesColor; if(abs(r.y) < rAxesThickness) pixel = rAxesColor; //Final output gl_FragColor = vec4(pixel, 1.0); }