MrWibble,
I was thinking that a 3d texture (very sparsely populated, e.g. only has data for grid cells intersected by level geometry) would be one way to avoid the mapping problem. So, is there a way to efficiently approximate that using standard 2d textures?
What if you look at all geometry using an orthographic projection onto the xy, xz, and yz planes - consider that the initial mapping onto 3 different megatextures. They're not immediately usable since overhangs and such will result in triangles overlapping each-other in these projections, so: for each of the 3 textures, translate around sections of the projected geometry until no section overlaps another (I didn't think very hard about how to do this step, but it seems pretty doable). That gives you the megatextures, but you'd still need a way to figure out which blocks of them are visible from a given viewpoint since the translations employed earlier mean you can't map a view pyramid into a simple polygon in texture space... Also, I'm not sure whether each of the textures would have equal weight when it comes to rendering - I guess you could use the surface normal of a triangle to determine which of the three textures to "prefer".
I was thinking that a 3d texture (very sparsely populated, e.g. only has data for grid cells intersected by level geometry) would be one way to avoid the mapping problem. So, is there a way to efficiently approximate that using standard 2d textures?
What if you look at all geometry using an orthographic projection onto the xy, xz, and yz planes - consider that the initial mapping onto 3 different megatextures. They're not immediately usable since overhangs and such will result in triangles overlapping each-other in these projections, so: for each of the 3 textures, translate around sections of the projected geometry until no section overlaps another (I didn't think very hard about how to do this step, but it seems pretty doable). That gives you the megatextures, but you'd still need a way to figure out which blocks of them are visible from a given viewpoint since the translations employed earlier mean you can't map a view pyramid into a simple polygon in texture space... Also, I'm not sure whether each of the textures would have equal weight when it comes to rendering - I guess you could use the surface normal of a triangle to determine which of the three textures to "prefer".
Last edited by a moderator: