refill-style
refill-style copied to clipboard
Integrate sand shader to the new shader styles set up
@patriciogonzalezvivo @bcamper @nvkelso
I'm testing out this new sand shader for beaches, could you help me optimize it with the new shader set-up?
Not sure yet if this works out visually on the map, testing it out. Also maybe there's a better way to write it so that I can give it 2 shades of gray (a light and a dark) and it can work within that range? But I also like that I can assign it the 7 shades of gray here. What do you think?
Right now it's commented out. But you can turn it on here: https://github.com/tangrams/refill-style/blob/gh-pages/refill-style.yaml#L6097-L6104
New shader: https://github.com/tangrams/refill-style/blob/gh-pages/refill-style.yaml#L351-L358
https://github.com/tangrams/refill-style/blob/gh-pages/refill-style.yaml#L844-L909
Actually this other shader I'm testing out here looks more sand-like:

Let's save this one for later, or use this shader for marshland or swamp, @nvkelso do we have marshland?
Hello @sensescape! This is looking great!
In line 907 ( https://github.com/tangrams/refill-style/blob/gh-pages/refill-style.yaml#L907 ), please use getTileCoord() (available in this style https://github.com/tangrams/refill-style/blob/gh-pages/refill-style.yaml#L361-L376) instead of TileCoord(). They do the same thing, but the getTileCoord() is consistent and interdependent to the rest of the library of modules
@sensescape the sand pattern looks great!
We should think on a more efficient way to make it that doesn't relay on snoise(). Simplex noise is more of on the side of an expensive function to use (in three dimensions use four times the random()). And here (https://github.com/tangrams/refill-style/blob/gh-pages/refill-style.yaml#L912-L918) we are using it 7 times that's makes 28 calls to random(). I think at the scale the overall pattern is use we can resolve it with one single random() function. I will make an example of it.
@sensescape from this shader (http://editor.thebookofshaders.com/?log=160226134359) you just need line number 22. And mix in the style generative-random in order to use the random() function present here https://github.com/tangrams/refill-style/blob/gh-pages/refill-style.yaml#L460
For the st you should keep using getTileCoord(). Let's try that and see if brings tile boundaries weirdness.
Hey @sensescape @patriciogonzalezvivo -- re-opening this issue to make sure we track and any new shaders. Even if we're using different ones from what @sensescape originally proposed (sounds like you have an alternate one you'd like to use?), we should make sure they're reviewed and optimized. This issue seems a fine place to to do that.
@patriciogonzalezvivo can you help make sure all references to TileCoords are removed, and we only rely on modelPosition (even if it's wrapped in another function to make it a varying)?
@bcamper I did that last time I was simplifying the code. The TileCoord() is use only where I just point it. @sensescape I could do the changes in PR if you don't mind?
Sure, go ahead. Thanks @patriciogonzalezvivo ! I really like the example image you just posted above. That looks really good, we could use that shader instead.