|
multiple meshgroups: mutiple skins or merge textures?
#406164
08/14/12 19:04
08/14/12 19:04
|
Joined: Dec 2008
Posts: 1,218 Germany
Rackscha
OP
Serious User
|
OP
Serious User
Joined: Dec 2008
Posts: 1,218
Germany
|
Hi, as i need to change the texture of each side of a cube seperately at realtime, i thought about one group/texture per side to use ent_setskin.
But it seems that too many objects(200) with multiple textures have impact on FPS.
SO as the mesh shape is pretty simple, maybe using one skin for all cube sides and bliting the required tile when needed?
Or maybe using one texture, which includes all available tiles and shift the uv setting?
edit: the manual says that vec_foruv is replaced by ent_getvertex/ent_setvertex.
But for this function, it is (indirectly) written that it does not support UV modification o.O (as most properties of the contact struct are not described in the "used" part of the manualpage.
Last edited by Rackscha; 08/14/12 19:38.
MY Website with news of my projects: (for example my current Muliplayer Bomberman, GenesisPrecompiler for LiteC and TileMaster, an easy to use Tile editor) Sparetime-Development
|
|
|
Re: multiple meshgroups: mutiple skins or merge textures?
[Re: Rackscha]
#406171
08/14/12 19:51
08/14/12 19:51
|
Joined: Jul 2001
Posts: 6,904
HeelX
Senior Expert
|
Senior Expert
Joined: Jul 2001
Posts: 6,904
|
I would create for each cube two dummy skins and assign to 3 quads skin1 and to 3 other quads skin2. Then, I would create two materials for each entity (!), store the pointers in two skills (for later use) and assign these two materials via ent_mtlset to entSkin1 and entSkin2. Since each material can hold up to 4 BMAP* pointers which are accessible through mtlSkin1 ... mtlSkin4 in a shader, you can store 3 BMAP*s in Material 1 and 3 BMAP*s in Material 2 to cover all sides of your cube. Then, you write 2 shaders for the two segments of the cube (with 3 quads each), which map the mtlSkin1...mtlSkin3 to the sides of the cube, by evaluating the normals and blending accordingly (one pass; 3 texture fetches per pixel) or by writing 3 passes (one pass for each side, thus only one texture fetch per pixel). Thats it.
Last edited by HeelX; 08/14/12 19:52.
|
|
|
Re: multiple meshgroups: mutiple skins or merge textures?
[Re: HeelX]
#406172
08/14/12 20:32
08/14/12 20:32
|
Joined: Dec 2008
Posts: 1,218 Germany
Rackscha
OP
Serious User
|
OP
Serious User
Joined: Dec 2008
Posts: 1,218
Germany
|
okay, but this doesnt work for my dk dig terrain demo. As my 2x2 tile objects require more skins(4), by using this technique. So i end up with multiple skins aswell.
MY Website with news of my projects: (for example my current Muliplayer Bomberman, GenesisPrecompiler for LiteC and TileMaster, an easy to use Tile editor) Sparetime-Development
|
|
|
Re: multiple meshgroups: mutiple skins or merge textures?
[Re: Rackscha]
#406176
08/14/12 21:01
08/14/12 21:01
|
Joined: Dec 2008
Posts: 1,218 Germany
Rackscha
OP
Serious User
|
OP
Serious User
Joined: Dec 2008
Posts: 1,218
Germany
|
Mh, i see, it was a VERY bad idea to use one group for each cube size. FPS went down the road o.o.
But the shader method becomes a bit complicated for 2x2 cube meshes, i think
edit: but maybe a shader is the only way to skin a mesh without splitting it into to many groups :|
Last edited by Rackscha; 08/14/12 21:02.
MY Website with news of my projects: (for example my current Muliplayer Bomberman, GenesisPrecompiler for LiteC and TileMaster, an easy to use Tile editor) Sparetime-Development
|
|
|
Re: multiple meshgroups: mutiple skins or merge textures?
[Re: HeelX]
#406179
08/14/12 21:39
08/14/12 21:39
|
Joined: Dec 2008
Posts: 1,218 Germany
Rackscha
OP
Serious User
|
OP
Serious User
Joined: Dec 2008
Posts: 1,218
Germany
|
Yup, all meshes contain one group now, but splitted tiles for setting up the UV individually.
i created one material, which is assigned to each block, and renders the textures. i will try how fast it works when i setup the UV for each tile at creation.
MY Website with news of my projects: (for example my current Muliplayer Bomberman, GenesisPrecompiler for LiteC and TileMaster, an easy to use Tile editor) Sparetime-Development
|
|
|
|