Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate sand shader to the new shader styles set up #11

Open
sensescape opened this issue Feb 25, 2016 · 8 comments
Open

Integrate sand shader to the new shader styles set up #11

sensescape opened this issue Feb 25, 2016 · 8 comments

Comments

@sensescape
Copy link
Member

@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

screen shot 2016-02-25 at 3 25 01 pm

screen shot 2016-02-25 at 3 28 31 pm

@sensescape
Copy link
Member Author

Actually this other shader I'm testing out here looks more sand-like:
screen shot 2016-02-25 at 4 45 41 pm

Let's save this one for later, or use this shader for marshland or swamp, @nvkelso do we have marshland?

@patriciogonzalezvivo
Copy link
Contributor

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

@patriciogonzalezvivo
Copy link
Contributor

@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.

@patriciogonzalezvivo
Copy link
Contributor

1
@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.

@bcamper
Copy link
Member

bcamper commented Feb 26, 2016

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.

@bcamper bcamper reopened this Feb 26, 2016
@bcamper
Copy link
Member

bcamper commented Feb 26, 2016

@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)?

@patriciogonzalezvivo
Copy link
Contributor

@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?

@sensescape
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants