tangrams / refill-style

From Toner to Tangram
https://tangrams.github.io/refill-style
MIT License
34 stars 12 forks source link

Smooth waves shader at high zooms #5

Closed sensescape closed 8 years ago

sensescape commented 8 years ago

@bcamper @patriciogonzalezvivo Why is the shader not smooth at z17?

Here's how it looks at z15

screen shot 2016-02-09 at 5 01 20 pm

At z17 the edges look rough and uneven:

screen shot 2016-02-09 at 5 04 30 pm
sensescape commented 8 years ago
screen shot 2016-02-09 at 5 17 59 pm
sensescape commented 8 years ago

at z19

screen shot 2016-02-10 at 10 39 43 am
bcamper commented 8 years ago

@patriciogonzalezvivo ?

patriciogonzalezvivo commented 8 years ago

The problem is on this line: https://github.com/tangrams/refill-style/blob/gh-pages/refill-style.yaml#L691 commenting it will "solve" the problem... but also will hook the wave line pattern to screen coordinates. Before jumping and find a better strategy for this I have some questions:

i think we should start working in a more modular structure for the shaders... so we can re-use the modules (https://github.com/tangrams/tangram-sandbox/tree/gh-pages/modules/space) I made and fix this kind of behavior fewer times. That will be ok?

screen shot 2016-02-12 at 9 11 04 am screen shot 2016-02-12 at 9 10 55 am
sensescape commented 8 years ago

waves and waves 2 are basically the same, waves 2 is just slightly darker. I wanted to have more contrast between ground and water at higher zooms. I'm using waves up to z13, then it gets darker at z13 and up with waves2

stream-waves are used for the river lines:

screen shot 2016-02-10 at 3 43 33 pm

Yes, modular structure sounds good! Thanks!

bcamper commented 8 years ago

@patriciogonzalezvivo could you help with modularization? Basically structure it so we can pull some of the reusable bits out into other files, once we have file include functionality.

patriciogonzalezvivo commented 8 years ago

working on it

patriciogonzalezvivo commented 8 years ago

I have simplify version of it here: http://tangrams.github.io/tangram-play/?scene=https://gist.githubusercontent.com/anonymous/bfcf61663b6bc183d284/raw/6a820cc0a4d84266b753a3b00f17cedcc5e7ab8b/scene.yaml

Need some fine tunning... Should I merge it @sensescape ?? or you want to do it after doing the adjustments?

sensescape commented 8 years ago

ok merge. Thanks @patriciogonzalezvivo !

patriciogonzalezvivo commented 8 years ago

Let me know if you need assistance with it : )

patriciogonzalezvivo commented 8 years ago

Do I merge or you?

sensescape commented 8 years ago

you can merge

patriciogonzalezvivo commented 8 years ago

Done, can you check everything looks ok?

sensescape commented 8 years ago

waves pattern looks great!

but the coast stripes got thicker in line width.

previous:

screen shot 2016-02-12 at 1 14 10 pm

now:

screen shot 2016-02-12 at 1 14 14 pm
sensescape commented 8 years ago

Looks like it doubled in line-width. Where do I adjust the line-width?

patriciogonzalezvivo commented 8 years ago

I just push a fix... Is less efficient but more flexible

sensescape commented 8 years ago

nice! thank you! looks amazing

patriciogonzalezvivo commented 8 years ago

:+1: : D :+1:

sensescape commented 8 years ago

this is fixed

patriciogonzalezvivo commented 8 years ago

yay

sensescape commented 8 years ago

yay!