Getting the viewport from GL is a JNI call, which is expensive. Using worldSpaceToScreenSpace or screenSpaceToWorldSpace multiple times per frame can make a serious impact on performance:
The examples below don't use the Renderer lib directly, but rather a copy of worldSpaceToScreenSpace slightly adjusted for my project's needs
Getting the viewport from GL is a JNI call, which is expensive. Using
worldSpaceToScreenSpace
orscreenSpaceToWorldSpace
multiple times per frame can make a serious impact on performance:The examples below don't use the Renderer lib directly, but rather a copy of
worldSpaceToScreenSpace
slightly adjusted for my project's needsNo caching:
Caching: