Atlasing addon for StaticGeometry?

What it says on the tin: a place to discuss proposed new features.
Post Reply
User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 605
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 4
Contact:

Atlasing addon for StaticGeometry?

Post by AshMcConnell » Wed Aug 25, 2010 8:55 am

Hi Folks,

I'm not sure that Atlasing is a word, but anyway you know what I mean :P

I was thinking that it would be useful to combine textures in StaticGeometry if their materials were very similar except for the texture being used. This would hopefully reduce the batchcount further.

Would this be possible to do? Perhaps I'm being a little naive?

All the best,
Ash
0 x

User avatar
volca
Gnome
Posts: 393
Joined: Thu Dec 08, 2005 9:57 pm
Contact:

Re: Atlasing addon for StaticGeometry?

Post by volca » Mon Aug 30, 2010 12:29 pm

I think this is best done offline - there are probably too many "Ifs" in my opinion - the materials have to be similar (how do I compare?), the geometry has to be unwrapped, etc. The implementation itself would not be that hard to do though (meaning if your meshes/materials are prepared properly, this should be simple). Anyway, if you'd need this without any coding, just atlas the textures in the first place where possible, merge similar materials into one. Static geometry will then use the same VBO for all those.
0 x
Image

User avatar
AshMcConnell
Silver Sponsor
Silver Sponsor
Posts: 605
Joined: Fri Dec 14, 2007 11:44 am
Location: Northern Ireland
x 4
Contact:

Re: Atlasing addon for StaticGeometry?

Post by AshMcConnell » Tue Aug 31, 2010 4:23 pm

Hi Volca,

Thanks for the reply. You are probably right.

Is there some standard Atlas class in Ogre? I am sure I saw a Ogre::Atlas class before, but I can't find it now in the source. Perhaps it was in Canvas. After the textures are atlased how difficult is it to modify the texture co-ords of the mesh to match up?

All the best,
Ash
0 x

User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 1
Contact:

Re: Atlasing addon for StaticGeometry?

Post by Wolfmanfx » Tue Aug 31, 2010 4:47 pm

There is a atlas class in particle universe, canvas, gorilla and vektrix. Maybe a unified atlas could unify them :)
0 x

User avatar
volca
Gnome
Posts: 393
Joined: Thu Dec 08, 2005 9:57 pm
Contact:

Re: Atlasing addon for StaticGeometry?

Post by volca » Tue Aug 31, 2010 5:34 pm

AshMcConnell wrote:After the textures are atlased how difficult is it to modify the texture co-ords of the mesh to match up?
This depends on your meshes - if you have the meshes unwrapped (that is if the texturing coordinates never go out of 0-1.0f range), it is a simple thing to do. If not, this is not entirely trivial - you have to create new triangles to avoid the texture wrapping. This is the thing - I am not sure if it is a good idea to do this online, but it probably depends on the application.

I'd be interested to know if the unwrapping could be avoided by a vertex/pixel shader, without runtime penalization, with some careful thought (for example extra set of UV coordinates in vertex definition that would be used to describe the texture's atlas placement?) - maybe someone else will know better than me...

Writing a texture atlas seems to be popular these days I see :D

Edit: By unwrapping I of course mean to get rid of tiling. Sorry by the wrong choice of wording.
0 x
Image

Post Reply