Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
js
README.md
app.js
index.html

README.md

day 002

project link

three.js | shader

  猗与漆沮,潜有多鱼。有鳣有鲔,鲦鲿鰋鲤。以享以祀,以介景福。

Catfish,Cod,Salmon,Trout,Halibut...Awww countless fishes, we are so blessed.

learned today

Patterns section from the book of shaders.

Seperate the entire space into brick zones using fract();


 vec2 tile(vec2 _st, float _zoom){
    _st *= _zoom;
    return fract(_st);
}

Using modular function to detect odd and even section, combining with step(), give each zone an index number.

//  Scale the coordinate system by 2x2
   _st *= 2.0;

// Give each cell an index number // according to its position float index = 0.0;
index += step(1., mod(_st.x,2.0)); index += step(1., mod(_st.y,2.0))*2.0;

// | // 2 | 3 // | //-------------- // | // 0 | 1 // |

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.