Crazy shader idea... possible?

Falagard

07-04-2006 22:27:53

Okay, I haven't thought this all the way through, so I have no idea if it's feasible ;-)

Imagine you're trying to increase the number of textures you can use for splatting in a single pass on a card that supports ps 2.0 shaders with 8 texture units. What if you took a large 1024x1024 texture and had 4 different textures areas in it, such as grass, sand, rock, dirt, so that you can bind a single texture that actually has 4 texture types in it, and an alpha composite map that has the splatting info for those 4 textures. Okay, so the first problem that comes up is UV coordinates since you can't easily do that right? Well, what if you stored an index in the alpha splatting map, and in the pixel shader moved over by an offset value into the detail texture. Is that possible, to use a pixel value from one channel to determine the uv of the pixel value to look up in another texture?

I'm not sure if I'm explaining it correctly, but the basic idea is that you might have 3 textures which each have 4 textures inside them, so that's a total of 12 potential textures. Or hey... what about volumetric textures? :-D And a composite map, that for each pixel, lets you blend up to 4 textures. So imagine for each pixel you could decide which 4 textures to blend?

I'm not sure if it's doable, but... it'd be cool if something could be done like that.

For example, imagine the composite map contained 3 splats in RGB and a lookup table in A or something.

tuan kuranes

08-04-2006 07:35:17

Didn't succed in texture altas splats... as it need to handle a sort of "modulo" and mipmaping working ok. But tried that in the early shaders day, in ps1, directly in asm. Perhaps ps3 and high level language shader would make it this possible.
Tried 3d textures works but was dead slow when tried.