Hey community,
I have a general question, i have low poly photo realistic materialized 3d models in game. how much android devices are capable of 4k res textures in pbr materials? is there a way for game to get capabilities of the device it runs on then reduce texture sizes? can it happen automatically by engine capabilities if any, or is there a way in code to do it? like ex, when running on Nokia 9 reduce texture sizes to 1k but on galaxy ultra goes 4k. can you show me some links, or code around it?
Hi there, i would say i am not a texture geek, i think the engine hasn’t got the capability to do this, but you could do this using the Android SDK, check for your hardware compatibility by using the application context and then there should be a texture utility that can do this or something similar, i will search the android SDK for this and let you know !
thank you
By the way, you might find this interesting
thank you for the suggestions
meanwhile i tried with this approach
for (Material mat : maters) {
if (mat.getName().equals("desiredMat")) {
Texture normalMap = assetManager.loadTexture(new TextureKey("path.jpg",false));
Texture baseColorMap = assetManager.loadTexture(new TextureKey("path.jpg",false));
Texture lightMap =assetManager.loadTexture(new TextureKey("path.jpg",false));
Texture metallicRoughnessMap assetManager.loadTexture(new TextureKey("path.jpg",false));
Texture emissive = assetManager.loadTexture(new TextureKey("path.jpg",false));
mat.getTextureParam("EmissiveMap").getTextureValue().setImage(emissive.getImage());
mat.getTextureParam("EmissiveMap").getTextureValue().setKey(emissive.getKey());
mat.getTextureParam("BaseColorMap").getTextureValue().setImage(baseColorMap.getImage());
mat.getTextureParam("BaseColorMap").getTextureValue().setKey(baseColorMap.getKey());
mat.getTextureParam("NormalMap").getTextureValue().setImage(normalMap.getImage());
mat.getTextureParam("NormalMap").getTextureValue().setKey(normalMap.getKey());
mat.getTextureParam("MetallicRoughnessMap").getTextureValue().setImage(metallicRoughnessMap.getImage());
mat.getTextureParam("MetallicRoughnessMap").getTextureValue().setKey(metallicRoughnessMap.getKey());
mat.getTextureParam("LightMap").getTextureValue().setImage(lightMap.getImage());
mat.getTextureParam("LightMap").getTextureValue().setKey(lightMap.getKey());
System.out.println(mat.getParamsMap());
}
}
code worked
as long as aspect ratio 1:1 i use textures must stay right at their coordinates right (since i use 1:1 at original one)?
does this way ok with gltf models? am i missing something? can it mess with texture coordinates this way or safe? maybe this way i can make some utility classes that can also got setup with the prefix for desired naming convention in a string field to replace textures on path for desired device (use device profiling to dynamically load the appropriate texture(don’t know how)) or menu setting. does it need to clear cache or a restart for the sys graphic cache clearing.