scenerygraphics / scenery

Flexible VR Visualisation for Volumetric and Geometric Data on the Java VM, powered by Kotlin and Vulkan.
https://scenery.graphics
GNU Lesser General Public License v3.0
128 stars 31 forks source link

BoundingGrid does not listen to scale #184

Closed kephale closed 6 years ago

kephale commented 6 years ago

If fitInto was called on the Node, then you get a result like this:

Also generating the BoundingGrid takes a surprisingly long time (multiple seconds) and completely blocks the thread.

screenshot from 2018-06-20 11-08-55

skalarproduktraum commented 6 years ago

I shall investigate. The amount of time taken results from the font generation, which only happens once though. They should be cached on-disk nevertheless...

kephale commented 6 years ago

I have a suspicion actually. I think its shader loading time.

skalarproduktraum commented 6 years ago

It's definitely the font rendering. It takes some time to generate the distance fields via OpenCL. I'll cache them to disk soon so they're not recalculated with each new start.

skalarproduktraum commented 6 years ago

Just tried to reproduce the issue with pure scenery and couldn't. The bounding grid adapts to scaling as well. Do you have the model file somewhere and could load it with ReadModelExample and see if the same odd behaviour occurs?

kephale commented 6 years ago

This happens with model: https://github.com/scenerygraphics/SciView/blob/master/src/main/resources/WieseRobert_simplified_Cip1.stl

To test in SciView, just add a BoundingGrid in: https://github.com/scenerygraphics/SciView/blob/master/src/main/java/sc/iview/commands/demo/MeshDemo.java

skalarproduktraum commented 6 years ago

Thanks, will try to reproduce!