About Store Forum Documentation Contact



Post Reply 
ANDROID - (pixel density) Could not render target error
Author Message
cat555 Offline
Member

Post: #1
ANDROID - (pixel density) Could not render target error
Hi,

I've been testing rendering pixel density (D.density(...)) with Nexus 7, and when using pixel density greater than certain threshold it gives me an error an app closes.

For example, with 1.75 app closes with "could not render target" error in logcat.

I've tested with an LG G2 Mini and works fine with this value... so i see that this may vary across devices...

My question is, how can i pre-check if the device supports some needed value, so i can use it after? For example, my intention is to give options to users... example, choose quality between low (0.75), medium (1), high (1.25), very high (1.5). So, how can i first check if the options will actually work on the device? I just want to show valid options, to avoid unwanted crashes...

Thanks!
12-11-2014 06:09 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: ANDROID - (pixel density) Could not render target error
Hello!

There's no easy way to detect that, as render targets are allocated on demand during rendering phases.

Perhaps you could try analyzing the device resolution, nexus 7 is high res (1920x1080), if you get these resolutions then don't offer higher pixel densities.
You could also try comparing it to D.maxTexSize.
If screen render target size * pixel density size > D.maxTexSize then perhaps the RT creation will fail.

I'll check if this code can be placed into the engine.
12-12-2014 12:50 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #3
RE: ANDROID - (pixel density) Could not render target error
Hello!

I've just commited this change:
https://github.com/Esenthel/EsenthelEngi...7bf9414bc7

Please let me know if that solves the issue.
12-12-2014 01:16 AM
Find all posts by this user Quote this message in a reply
cat555 Offline
Member

Post: #4
RE: ANDROID - (pixel density) Could not render target error
Hi,

It's working fine smile and having integrated in the engine without having to make any checks on my code side is even better wink

Thanks for your effort and quickness!!!
12-12-2014 11:49 AM
Find all posts by this user Quote this message in a reply
Post Reply