Question

As far as I'm aware, the upper resolution limit for textures in Stage3D is 2048 x 2048 pixels. This causes a problem for the planets in a space game I'm developing; when the 'camera' gets to a certain distance, individual pixels are clearly visible. I know I can change how the shaders render the texture to, effectively, blur the texture, but that's not what I want to do. I'm also aware of mipmapping, but that uses reduced resolution images, still with a maximum of 2048 pixels square.

I'm interested in knowing how to 'up' the resolution of the texture as the camera gets nearer. Is the only option to draw the planet in more than one 'piece', or is there some other way to have more pixel detail drawn?

Was it helpful?

Solution

Stage3D limits the texture size to 2048x2048 because not all GPUs can handle bigger textures. So naturally you can't use larger textures. If that isn't big enough for you (it's understandable that you can't fit a whole planet in a 2048x2048 texture) you have three options:

1) Use multiple textures. You can pass more than one texture to the fragment shader.

2) Use smarter uv mapping. You can for example use a small tiling area for grass, rock, dirt, water etc. and map them to correct locations on the globe.

3) Use some Level of Detail (LOD) system. For example, when the camera gets closer to the sphere, swap the model into a more detailed one which contains only the area visible to the player. The texture used by the more detailed model doesn't need to cover the whole globe and can therefore be more detailed.

Depending on the size of your planet, one of these might be enough, or you might need all of them.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top