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

Labels on landuse pattern getting cut off #31

Closed
sensescape opened this issue Dec 12, 2016 · 17 comments
Closed

Labels on landuse pattern getting cut off #31

sensescape opened this issue Dec 12, 2016 · 17 comments
Assignees

Comments

@sensescape
Copy link
Member

http://tangrams.github.io/refill-style/#8/36.671/-117.922

screen shot 2016-12-12 at 11 44 46 am

@nvkelso
Copy link
Member

nvkelso commented Dec 12, 2016

@bcamper Did this change recently?

@bcamper
Copy link
Member

bcamper commented Dec 12, 2016

Not intentionally :) But could see it having been a casualty of either some optimizations we made to shader rendering (maybe a state change is being missed) or fixes to alpha blending. I'll look into it.

@bcamper bcamper self-assigned this Dec 12, 2016
@sensescape
Copy link
Member Author

sensescape commented Dec 12, 2016

Adding a stroke/halo to the text fixes it:
screen shot 2016-12-12 at 3 24 31 pm

but text looks like this sometimes, over landuse pattern:
screen shot 2016-12-12 at 3 25 54 pm

screen shot 2016-12-12 at 3 27 07 pm

@bcamper
Copy link
Member

bcamper commented Dec 13, 2016

@patriciogonzalezvivo I haven't looked at this yet, but for the bottom example, with text over the dot pattern: do you think the alpha is interacting weirdly with the shader perhaps? Could you see what alpha is output from the shader?

@patriciogonzalezvivo
Copy link
Contributor

Weird... all this dot patterns don't have alpha: https://github.com/tangrams/refill-style/blob/gh-pages/refill-style.yaml#L1126-L1194 ... @sensescape do you know what layer or landuse style is interfering with what label layer ??

@patriciogonzalezvivo
Copy link
Contributor

patriciogonzalezvivo commented Dec 14, 2016

My apologize, @bcamper point that alpha is affected in this line https://github.com/tangrams/refill-style/blob/gh-pages/refill-style.yaml#L1141
I'm not sure why we were multiplying the alpha there... but I think doing this is better:

                color: |
                    color.rgb = mix(COLOR1, COLOR2, circle(tile(getTileCoords(),PATTERN_SCALE), DOT_SIZE));

The DOT_SIZE define should need to be adjusted.

Also as @bcamper point we should use a texture here... aastep which is use by circle was some performance cost...

Happy to introduce any of those changes: a. simplify the shader as is... b. replace it for a texture

Note: I feel that using a shader will be only justifiable if we want to apply a hill-shade effect using the dot size, like we did in TRON2.0

screen shot 2016-12-14 at 11 18 46 am

Also switching to tangram blocks will solve more of this kind of issues... some of the shader in this style are quite old. For example the above code have been improved before here http://tangrams.github.io/blocks/#polygons-dots

@patriciogonzalezvivo
Copy link
Contributor

@patriciogonzalezvivo
Copy link
Contributor

So... I fix the bug by avoiding using the alpha channel... this was the effect of making the dots a little bigger, because the alpha was "eating" the texture more than is colorated (alpha interpolation is different). Any how now DOT_SIZE need adjustments. @sensescape could you tweak it until makes sense for you.

Once that's done, and we have parameters we are happy with I can make texture of them : )

@bcamper
Copy link
Member

bcamper commented Dec 14, 2016

@sensescape: @patriciogonzalezvivo put the fix on the gh-pages branch, so you should see it once this gets merged there (or you could merge it back here but may just make things more complicated):

46b60c0

@patriciogonzalezvivo
Copy link
Contributor

thanks! and sorry for that

@bcamper
Copy link
Member

bcamper commented Dec 14, 2016

@sensescape I want to look into the issue with the California label (the original issue): can you show me the commit where you added the stroke, so I can compare before/after?

@sensescape
Copy link
Member Author

@sensescape
Copy link
Member Author

@sensescape
Copy link
Member Author

sensescape commented Dec 14, 2016

thanks! @patriciogonzalezvivo
I'm tweaking dots pattern on places-refactor branch : )

@bcamper
Copy link
Member

bcamper commented Dec 14, 2016

Actually it looks like the original problem was the same thing with weird alpha on the underlying dots shader, so it should also be fixed (if you want to remove the stroke later) by the same fix for that.

@sensescape
Copy link
Member Author

ok! thanks : )

@bcamper
Copy link
Member

bcamper commented Dec 14, 2016

Closing original issue, added #32 to optimize dot shaders to use textures instead as follow-up (which @patriciogonzalezvivo and I discussed).

@bcamper bcamper closed this as completed Dec 14, 2016
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

4 participants