davidson16807 / tectonics.js

3d plate tectonics in your web browser
http://davidson16807.github.io/tectonics.js/
Creative Commons Attribution 4.0 International
204 stars 28 forks source link

Flipped altitude map palette by generalizing ScalarDisplay for two colors #23

Closed skepickle closed 6 years ago

davidson16807 commented 6 years ago

regarding the comment in the commit description: sealevel_mod only gets referenced by the shader code that's inserted by Displays. You can check out what happens in shader code in precompiled/view/fragment/template.glsl.c

If any of this looks wierd to you, it's because I wrote the shader code before I had any concept of the *Display classes. Plus I went the pragmatic route on a lot of things. I'm open to suggestions.

skepickle commented 6 years ago

I have no idea how shader code works, so you are way ahead of me on that stuff! I'll try to look at that file and maybe I can learn, but I'm not in any kind of mental-place to criticize that. lol.

davidson16807 commented 6 years ago

If you want to learn about shaders in general, this is what I read when it clicked, and this is how it works with Three.js. We're using shaders to offload some calculations to the GPU where speed is the concern. Actually, we probably don't need to do that so much anymore now that everything uses TypedArrays and its all blazing fast, but it still has its use