Open bcamper opened 7 years ago
Porting to uniforms
https://github.com/tangrams/refill-style/commit/9898573d8d3aebb8d1ec376478b971b84024a057#diff-2ae5458fe5491a29a9703b5a93751300R1131
@bcamper What about PATTERN_SCALE
and DOT_SIZE
is ok to add uniforms
for those?
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
Assuming background is always white https://github.com/tangrams/refill-style/commit/a1b463a50dbfc0f3ce89c859a5294a30de7baba9
DOT_SIZE
and PATTERN_SCALE
are now uniforms
Next step making the texture! @bcamper I have two ways to go here:
aastep
to clamp it according DOT_SIZE
(u_dot_size
).25
(https://github.com/tangrams/refill-style/blob/turbo_dots/refill-style.yaml#L1146) and .125
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
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.
👍
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.
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
@patriciogonzalezvivo ok! reviewing the dot sizes
thanks!
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!
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
@sensescape THANKS! I hope you don't mind I simplify the names in this commit https://github.com/tangrams/refill-style/commit/a1b463a50dbfc0f3ce89c859a5294a30de7baba9 some stiles where only call by just another style
yes, please @patriciogonzalezvivo the names were confusing me, i was mixing all the dots up, didn't make much sense! thanks!
All changes are here https://github.com/tangrams/refill-style/pull/33 ready for review and merge : )
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).