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

0.2.0: depthWrite disable in map image tiles prevents use of transparent objs on top #99

Open
antont opened this issue Dec 3, 2014 · 7 comments

Comments

@antont
Copy link

antont commented Dec 3, 2014

using an obj with transparent material on top of the map with images doesn't work -- the background shows through the map. apparently as it has depthWrite disabled.

we encountered this when using a 2d heatmap texture (generated with heatmap.js) on top of the map.

made a simple workaround: use a little altitude to sort the image tiles instead. works well for us as a quick hack/fix for now in playsign/vizicities@vizicities:0.2.0...mapImageDepthHack

however didn't make a pullreq as that just changes one hack with another (with other downsides) but just noting for info.

@robhawkes
Copy link
Member

This is an interesting quirk, thanks for bringing it to my attention. Transparency is something we definitely need so a fix has to be found.

The original ViziCities used to use altitude to sort the layers but this starts to fail when zooming out and results in all sorts of z-buffering issues. Hopefully there's a middle-ground we can find.

Out of interest, is the heatmap example online anywhere? I'm really interested in seeing what you've done with it.

@antont
Copy link
Author

antont commented Dec 9, 2014

Yes the heatmap usage is online - not greatest configuration and now as a bit of a wip-on-the-side thing at:
http://130.206.81.111/fidemo-santander/ . if you zoom in close to the area with the sensors you see also the heatmap there (it uses temperature values from the sensors which are otherwise visualized with the objs).

.. is now also merged in our demo project's master branch but not used in the default conf there yet. that's anyhow where the code was refactored in vizi 0.1 -> 0.2 porting: https://github.com/playsign/fidemo/blob/master/js/client/BlueprintOutputHeatmap.js

the z-fight issue we fixed now as a quick first remedy just by setting the camera near clip distance further: "Fix z-fighting, camera.near 30" by @tapanij: playsign/fidemo@1c0c497

@robhawkes
Copy link
Member

Nice! I like the demo, the heatmaps are a cool addition that I want to explore for some visualisations myself. Would you mind if I used and credited some of your code to create a more generic heatmap output that isn't predefined for Santander or to use temperature?

Regarding the z-fighting, I still see it quite badly on the map tiles when I zoom out and orbit the camera. I suppose you could cap the camera zoom if people don't need to zoom that far. Hopefully we can find a more robust solution that doesn't require forcing tiny differences in the altitude for each layer (I always found that introduced lots of trouble in the past).

@robhawkes
Copy link
Member

I've been doing a little research and came across these issues in Three.js which might be useful:

@antont
Copy link
Author

antont commented Dec 10, 2014

oh I don't think you saw the version with the fix yet: http://130.206.81.111/fidemo/

the version configured for santander & the heatmap is a bit older, didn't have that camera near conf yet.

that's the current master of this demo project, very much WIP and there's many things going on but I think you should see there how that fixes / works around the z-fight prob.

and by all means do feel free to work on making the heatmap thing generic. that's our plan too and we'll also need that if need it in the current Helsinki config as well but that is not happening yet -- I'll tell immediately if someone here will start it.

@robhawkes
Copy link
Member

Ah nice, that demo is awesome – love the effect when you click on the map!

I'm still not a fan of using altitude fix as it puts a noticeable gap between the layers and introduces problems when you want to zoom in nice and close (things aren't actually placed on the ground any more). Plus it isn't a reliable fix, it still can cause z-fighting at certain zooms anyway.

Hopefully we can find another approach that doesn't require physically separating the layers but still allowing for transparency. I hope one of the links above can help there and I'll look into them when I get a moment.

@brianchirls
Copy link
Contributor

I'm not entirely sure what's going on in this demo, but it's pretty badass.
Kippis!

On Wed, Dec 10, 2014 at 2:33 AM, Toni Alatalo notifications@github.com
wrote:

oh I don't think you saw the version with the fix yet:
http://130.206.81.111/fidemo/

the version configured for santander & the heatmap is a bit older, didn't
have that camera near conf yet.

that's the current master of this demo project, very much WIP and there's
many things going on but I think you should see there how that fixes /
works around the z-fight prob.

and by all means do feel free to work on making the heatmap thing generic.
that's our plan too and we'll also need that if need it in the current
Helsinki config as well but that is not happening yet -- I'll tell
immediately if someone here will start it.


Reply to this email directly or view it on GitHub
#99 (comment)
.

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