Blended Skins : Multi-pass or unique?
by Gareth Fouche · in Torque Game Engine Advanced · 02/02/2008 (2:59 am) · 5 replies
Hi,
I'm currently looking into implementing dynamic blended skins in TGEA, the sort of thing where you have a base face texture then blend on scars and suchlike.
Now I'm no expert on graphics rendering so I wanted to get the opinions of actual experts. Which way is more efficient, to set it up as multiple rendering passes, or to create a new single bitmap with all the layers pre-baked into it? The first way adds more rendering passes but minimizes texture memory usage and stage state swaps, whereas the second does it in one pass but has a unique texture per pass. I know that changing rendering states is expensive but I'm wondering if one of these techniques is massively more efficient than the other?
For example, lets say you will have about 20 NPCs on screen at one time, each with 2 dynamic textures (head and body) , with the head having say 4 textures total and the body 2, for a total of 6 (base textures included). This seems to me to be quite a few rendering passes. Is it more efficient than each NPC having 2 unique textures? That IS 40 textures, which is also quite a lot. Can anyone give me any insight into this issue?
Another aspect is things like normal maps. They could complicate matters quite a bit in the first case, with multi-pass rendering.
Thanks in advance,
Gareth
I'm currently looking into implementing dynamic blended skins in TGEA, the sort of thing where you have a base face texture then blend on scars and suchlike.
Now I'm no expert on graphics rendering so I wanted to get the opinions of actual experts. Which way is more efficient, to set it up as multiple rendering passes, or to create a new single bitmap with all the layers pre-baked into it? The first way adds more rendering passes but minimizes texture memory usage and stage state swaps, whereas the second does it in one pass but has a unique texture per pass. I know that changing rendering states is expensive but I'm wondering if one of these techniques is massively more efficient than the other?
For example, lets say you will have about 20 NPCs on screen at one time, each with 2 dynamic textures (head and body) , with the head having say 4 textures total and the body 2, for a total of 6 (base textures included). This seems to me to be quite a few rendering passes. Is it more efficient than each NPC having 2 unique textures? That IS 40 textures, which is also quite a lot. Can anyone give me any insight into this issue?
Another aspect is things like normal maps. They could complicate matters quite a bit in the first case, with multi-pass rendering.
Thanks in advance,
Gareth
#2
Also, wouldn't that use up all the texture units you would otherwise use for, say, bump/specular mapping?
And what is the cost of using 6 textures in one pass? Negligible? Moderately costly?
Still, you make a good point. I could simple impose some limits on the number of textures you can blend together then do it in one pass. That may be the best solution.
02/02/2008 (4:03 am)
Well, you then have to target a specific shader model, excluding a portion of your market with older gfx cards. As an indie that might be unwise? I'd like a slightly more generic solution. Also, wouldn't that use up all the texture units you would otherwise use for, say, bump/specular mapping?
And what is the cost of using 6 textures in one pass? Negligible? Moderately costly?
Still, you make a good point. I could simple impose some limits on the number of textures you can blend together then do it in one pass. That may be the best solution.
#3
And yes it would use it up. But what prevents you doing this blend into a rendertarget that you then forward to the "regular" material
cost: Atlas does it all the time, so it seems like they are payable.
The other option is: why don't you just use the regular "8 texture stages" for blending?
texture[0] - texture[7] in the materials.
02/02/2008 (5:03 am)
Well, show me the SM 1.1 model hardware that is capable of running TGEA at all. With running I mean on an acceptable performance.And yes it would use it up. But what prevents you doing this blend into a rendertarget that you then forward to the "regular" material
cost: Atlas does it all the time, so it seems like they are payable.
The other option is: why don't you just use the regular "8 texture stages" for blending?
texture[0] - texture[7] in the materials.
#4
02/02/2008 (8:44 am)
Would it be better to wait until the update being that there will be a Directx8 layer, right? Doesn't that mean well be able to use the FFP As well? That is what I'm hoping, that this will make fallback easier to write and implement.
#5
@ Marc : That makes no sense to me. Turn off all the shader features and TGEA will run perfectly fine on SM 1.1 won't it? If you want to turn on all the shininess, sure, but at the end of the day the features you use determine the basic minimum platform, not so?
Atlas does it? I thought it had a single prebaked megatexture? I haven't researched further into it since I use the Legacy terrain.
However I think I am just going to do it in one pass with about 4 textures blended together. Thats a decent blended skin and still leaves space for normal maps and suchlike for later pixel shader versions.
02/02/2008 (9:39 am)
Nope, not better to wait. No offence meant Bobby but too many people sit around waiting for GG to fix everything for them. Whatever they implement in the future, having done it in the current version of TGEA will make it that much simpler to implement in the next version. Working things out for yourself is invaluable experience I find. ;) @ Marc : That makes no sense to me. Turn off all the shader features and TGEA will run perfectly fine on SM 1.1 won't it? If you want to turn on all the shininess, sure, but at the end of the day the features you use determine the basic minimum platform, not so?
Atlas does it? I thought it had a single prebaked megatexture? I haven't researched further into it since I use the Legacy terrain.
However I think I am just going to do it in one pass with about 4 textures blended together. Thats a decent blended skin and still leaves space for normal maps and suchlike for later pixel shader versions.
Torque 3D Owner Marc 'Dreamora' Schaerer
Gayasoft
What prevents you, given the fact you target Shader Model 2+, using all 6 (up to 8) and blend them in 1 go down onto a dynamic base texture.