Support for 3d background: 2048px 6-side horizontal cubemap
Adding support for 2D texture that represents 6-sided cube (2048px per side) as a horizontal layout: [ +x ] [ -x ] [ +y ] [ -y ] [ +z ] [ -z ] This is the recommended representation of cube map as it is more efficient in terms of memory.
This commit is contained in:
@@ -273,7 +273,7 @@ public class AppInfo extends UnityPlayerActivity {
|
||||
}
|
||||
}
|
||||
|
||||
public static DecodedBitmap loadRawImage(String imagePath, int maxWidth, int maxHeight) {
|
||||
public static DecodedBitmap loadRawImage(String imagePath, int maxPixels) {
|
||||
Log.v(TAG, "Decoding image at " + imagePath);
|
||||
|
||||
try {
|
||||
@@ -290,8 +290,7 @@ public class AppInfo extends UnityPlayerActivity {
|
||||
// Calculate the largest inSampleSize value that is a power of 2 and keeps both
|
||||
// height and width smaller than the requested height and width.
|
||||
options.inSampleSize = 1;
|
||||
while ((height / options.inSampleSize) >= maxHeight
|
||||
|| (width / options.inSampleSize) >= maxWidth) {
|
||||
while (height / options.inSampleSize * width / options.inSampleSize > maxPixels) {
|
||||
options.inSampleSize *= 2;
|
||||
}
|
||||
Log.v(TAG, "Image sample size: " + options.inSampleSize);
|
||||
|
||||
Reference in New Issue
Block a user