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

Port dots styles to use texture #32

Open
bcamper opened this issue Dec 14, 2016 · 14 comments
Open

Port dots styles to use texture #32

bcamper opened this issue Dec 14, 2016 · 14 comments
Assignees

Comments

@bcamper
Copy link
Member

bcamper commented Dec 14, 2016

We can simplify and improve performance of the dots-based styles by making them sample from a dot texture (that can be further modified in the shader as needed).

@patriciogonzalezvivo
Copy link
Contributor

patriciogonzalezvivo commented Dec 14, 2016

Porting to uniforms 9898573#diff-2ae5458fe5491a29a9703b5a93751300R1131

@bcamper What about PATTERN_SCALE and DOT_SIZE is ok to add uniforms for those?

@patriciogonzalezvivo
Copy link
Contributor

Mmmm... I just notice that all those dots have white [1.,1.,1.] as background... is ok @sensescape if I hard code that and use remaining uniform space for DOT_SIZE and PATTERN_SCALE cc @bcamper

@patriciogonzalezvivo
Copy link
Contributor

  • Assuming background is always white a1b463a

  • DOT_SIZE and PATTERN_SCALE are now uniforms

Next step making the texture! @bcamper I have two ways to go here:

Seams the first one is slightly more expensive but more reusable. Also I would love to use some blocks for this... are we ok for adding tangram-blocks?? cc @nvkelso @bcamper

@bcamper
Copy link
Member Author

bcamper commented Dec 14, 2016

It might be worth trying both approaches to see what the performance/size difference is. Maybe start with a single dot.

But I'd like all the dependencies for refill in the project itself -- it's been difficult for me to deal with all the imports in Tron (though it was a good experiment), and I'm not yet convinced we want to bring that complexity to other house styles, so I'd rather keep it as an embedded style in here for now.

@patriciogonzalezvivo
Copy link
Contributor

👍

@bcamper
Copy link
Member Author

bcamper commented Dec 14, 2016

In general, performance is more important for these house styles than flexibility. Since a second dot texture probably won't add much size, I would likely prefer that (let's check the size?).

You can also make a generic version for Blocks, with a single texture, and keep an optimized version in this file.

@patriciogonzalezvivo
Copy link
Contributor

patriciogonzalezvivo commented Dec 14, 2016

Cool... @sensescape could you confirmam that the DOT_SIZE in the gh_pages version is what you want? Once we switch to textures will be harder to tweak

@sensescape
Copy link
Member

@patriciogonzalezvivo ok! reviewing the dot sizes

@patriciogonzalezvivo
Copy link
Contributor

thanks!

@patriciogonzalezvivo
Copy link
Contributor

sooo... I tried with fixed size dot textures... and seams they don't scale right... so I'm taking the other approach: ONE SDF TO RULE THEM ALL!

@sensescape
Copy link
Member

sorry about this mess, so many dots! looks like I'm using them all
park-dots1 mixes dots — DOT_SIZE: .1
dots-rev mixes pattern-dots
tiny-dots mixes dots3 — DOT_SIZE: .125
medium-dots mixes dots-medium —DOT_SIZE: .25

@patriciogonzalezvivo
Copy link
Contributor

@sensescape THANKS! I hope you don't mind I simplify the names in this commit a1b463a some stiles where only call by just another style

@sensescape
Copy link
Member

yes, please @patriciogonzalezvivo
the names were confusing me, i was mixing all the dots up, didn't make much sense! thanks!

@patriciogonzalezvivo
Copy link
Contributor

All changes are here #33 ready for review and merge : )

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