[question] Changing splat texture names based on pageX/Z

fantasticsid

09-09-2008 08:35:26

I'm in the process of developing a new set of pipeline programs with which to splat terrain. The fragment program is handed a bunch of 1024x1024 (or 2048x2048, depending on page size and texture size) textures, which contain an atlas of texture/normal/diffuse maps, with coverage (per texture) stored in the alpha channel.

The Cg code itself works. I've tested it and it seems to be marginally faster (and a hell of a lot more flexible) than a 1-coverage/4 tex/4 norm/4 diff fragment program which I've *erm* adapted from the PSSplattingShaderLit code.

My question, then, is actually rather simple. Given that materials are already being generated per-page (the coverage map(s) per-page are treated in the way which i'd like to treat each texture I hand to the material,) is it possible to indicate to PLSM2 that it should append the page X and Z values to each texture name before binding them to the per-page splat material?

TIA,

Sid