Drongle McMahon Posted June 16, 2011 Share Posted June 16, 2011 The mesh asset format is described in a wiki page. Understanding it can help to explain some otherwise perplexing things. So I made this picture for myself, that may be useful for others. It may also be inaccurate, so I would welcome any suggestions for corrections or improvements, or even a reasoned rejection of the whole thing. I will incorporate corrections by replacing the image here, so that it stays at the top.This is now the updated version incorporating suggestions and corrections.Anyone is free to use this however they wish. 4 Link to comment Share on other sites More sharing options...
Dain Shan Posted June 17, 2011 Share Posted June 17, 2011 Thanks a lot .. i tag that near my screen for the future ^^ Link to comment Share on other sites More sharing options...
Gaia Clary Posted June 17, 2011 Share Posted June 17, 2011 may i propose a small change ? I think a triangle has always exactly 3 vertices ? Link to comment Share on other sites More sharing options...
Drongle McMahon Posted June 17, 2011 Author Share Posted June 17, 2011 Yes. That's why there are three numbers. I do like that, but it doesn't show that there is a vertex list. I think that is important. The vertices are not confined within a triangle. Some vertices are referenced by two or more triangles. So it's not quite right. Something in between is needed, I think. Whatabout this ... Link to comment Share on other sites More sharing options...
Gaia Clary Posted June 17, 2011 Share Posted June 17, 2011 I like that version. It gives more detailed information about the vertices and their relations to triangles and answers one more question (max. verts per mesh) some more remarks: From the discussion in the other thread we learn that one vertex is potentially counted multiple times. From the schema you provide, it looks more like each vertex is counted once independent from its reusage in multiple faces. And also the dependency of vertex count from the UV map is not adressed here i guess ? [edit]: i think i understand now: A vertex is reused only if position, vertex normal AND UV position match. So your map now indeed answers all questions (sort of...) Link to comment Share on other sites More sharing options...
Drongle McMahon Posted June 17, 2011 Author Share Posted June 17, 2011 Yes. That is the one that always needs explaining, and the picture doesn't make it explicit. I coldn't think of a way of doing that, although it is implied by the shared vertex. Maybe I will add some words. Link to comment Share on other sites More sharing options...
Gaia Clary Posted June 17, 2011 Share Posted June 17, 2011 Here is an attempt for a simple explanation and after writing it i think some informal images would help a lot ;-) Each vertex contains actually 3 values: The vertex position A vertex normal A UVmap position In principle this information has to be maintained for each triangle corner inependent on whether the vertex is reused in multiple triangles or not. this is so because the vertex can be located at different postions on the UV map for different triangles. Also the vertex nromal depends strongly on how the associated triangle is placed in 3D space. But sometimes a shared vertex can use the same UV coordinates AND the same vertex normal. in such cases (and only then!) a vertex description can be shared among multiple triangles. This happens especially in 2 cases: If multiple faces with shared vertices lay exactly in the same plane, then the vertex normals are all identical. If smoooth shading is enabled, then all vertex normals point into the same direction inependent on how the associated triangles are placed. One extreme example is a simple cube. In that case we have 12 triangles (2 per side) and that makes up for 36 vertex descriptors. But on each corner we find only 3 different vertex normals (because the faces are positioned in xy-plane, xz-plane and yz-plane and so each vertex normal can only have one of 3 values). Hence we find 8 corners with 3 vertex normals each. That sums up to 3*8 = 24 vertex normals. Consequently the list of vertices can be reduced by eliminating the dupliate descriptors and we end up with only 24 descriptors instead of 36. If we enable smooth shading, then the vertex normals of all vertices on a corner point into the same direction. So we end up with exactly 8 face normals and this we will also see only 8 vertex descriptors. 1 Link to comment Share on other sites More sharing options...
Drongle McMahon Posted June 17, 2011 Author Share Posted June 17, 2011 Almost, except that there are only 6 different face normals in the smoothed cube, There are 8 vertex normals (each of which is the sum of the three adjoining quad face normals at a vertex). Face normals are not stored (or used by opengl, as far as I know). The faces of a flat shaded triangle just have three identical vertex normals. I need to check one other thing with Runitai - there do seem to be separate vertex lists for each LOD, but does the 64K limit (necessary for 16 bit indices in triangle lists) apply separately to each, or to the sum of all of them? I also left out the vertex weighting and the havok private and physics cost info, but I think I will leave it that way so that it's just for static meshes and vaguely comprehensible data. Link to comment Share on other sites More sharing options...
Gearsawe Stonecutter Posted June 17, 2011 Share Posted June 17, 2011 question. I know in 3DSMax UV mapping does have a XYZ (UVW). I am just guessing SL ignores the Z or it is ignored by the exporter? Link to comment Share on other sites More sharing options...
Drongle McMahon Posted June 17, 2011 Author Share Posted June 17, 2011 I have wondered about the W before, but have no real idea what it does. I did read something about it being used in transformations to give the texture a perspective transformation. I would guess it is ignored, but I really don't know. Runitai, are you there? Help! Link to comment Share on other sites More sharing options...
Dain Shan Posted June 17, 2011 Share Posted June 17, 2011 As far as i understand it, you only need the W vector for things like Volumentric textures .. I read a text about it .. now its really REALLY hard to understand for me I cant find the link anymore. But i know that at least in maya there is a a whole set of funcions for that. Link to comment Share on other sites More sharing options...
Gearsawe Stonecutter Posted June 17, 2011 Share Posted June 17, 2011 I used it for making scupts a long time ago when they first came out. I would bake a 3D texture on to the object. You can do all sorts of fun things with it. But hey never know for when we get an advance texture system for SL it might be used. Link to comment Share on other sites More sharing options...
guY Ralior Posted June 17, 2011 Share Posted June 17, 2011 After two days of intense reading I think I am finally starting to get it Thank you much for that diagram it helped me to understand much better. As I was reading all of these things before it was hard to put it together how it pertained to one individual upload, that made things much more concise. Thank you. Link to comment Share on other sites More sharing options...
DanielRavenNest Noe Posted June 17, 2011 Share Posted June 17, 2011 Volumetric textures are for things like clouds that would vary in all three dimensions rather than two for surface mapped textures. There are some other obscure uses for the W axis in UVW space. W is perpendicular to the UV plane. If you think of the texture map as a piece of paper on a desk, the W axis is a pencil pointing up from the paper. The W value is used in some graphics engine to give the *rotation* of the texture about the W axis. If it is a single value, it rotates the texture as a whole. If it is a mapped value per pixel, it would represent a *distortion* of the texture. I have not seen that actually used anywhere. UVW coordinates can represent your model texture coordinates in such a way it can be rotated in three dimensions, changing the mapping as projected onto the UV plane. This allows interesting, but complicated, changes in real time in a world or game. For example, you can have one model of a rock, and one texture for it, but by varying the UVW rotation angles randomly, get instances of the rock that look different. I have not seen this used anywhere either. Link to comment Share on other sites More sharing options...
guY Ralior Posted June 17, 2011 Share Posted June 17, 2011 If I understand you correctly in your latter description you would be able to use textures similar to those billboards that are different pictures from different angles? That seems like it would be kinda useful in certain situations, I am surprised it hasn't been used. [edited] reply supposed to be to Daniel Link to comment Share on other sites More sharing options...
Dain Shan Posted June 17, 2011 Share Posted June 17, 2011 Thanks for the pointer I got my knowledge about the W coordinate from here http://en.wikipedia.org/wiki/Shadow_mapping So also from this paper http://www.markmark.net/cloudsim/harrisGH2003.pdf Seems the W vector or value could be used for a lot of different functions, depending on the engine or the Apllication you use for creating scenes. Link to comment Share on other sites More sharing options...
Helium Loon Posted June 20, 2011 Share Posted June 20, 2011 The W coordinate from UVW textures really goes back to the old days of 3D rendering..... In order to speed up the code (and simplify the data structures), the programmers often re-used the 'vertex' structure for holding UV texture info (rather than create a new structure that only held two floating point values. Since it had a third parameter, it gave them a way to hold an extra bit of data for whatever they might need it for. And if they kept it at zero, most of the standard vertex functions that might be used (and defined in a 'vertex' object, like distance, etc.) will work on the texture space as well. Later, when volumetric textures and procedural textures were developed, the W parameter became an additional dimension, allowing for textures which changed based on the W parameter. This was also used heavily in ray-tracing and other graphics where objects were solid (and lend themselves to procedural texturing well), instead of polygonal. Link to comment Share on other sites More sharing options...
Lindens Runitai Linden Posted June 20, 2011 Lindens Share Posted June 20, 2011 Drongle McMahon wrote: Almost, except that there are only 6 different face normals in the smoothed cube, There are 8 vertex normals (each of which is the sum of the three adjoining quad face normals at a vertex). Face normals are not stored (or used by opengl, as far as I know). The faces of a flat shaded triangle just have three identical vertex normals. I need to check one other thing with Runitai - there do seem to be separate vertex lists for each LOD, but does the 64K limit (necessary for 16 bit indices in triangle lists) apply separately to each, or to the sum of all of them? I also left out the vertex weighting and the havok private and physics cost info, but I think I will leave it that way so that it's just for static meshes and vaguely comprehensible data. The 64k limit applies to each submesh separately. Also, vertex weight data is in the LoD block -- the "skin" data block contains a list of joint names and bind matrices to match up to joint indices in the weight data. Link to comment Share on other sites More sharing options...
Lindens Runitai Linden Posted June 20, 2011 Lindens Share Posted June 20, 2011 Drongle McMahon wrote: I have wondered about the W before, but have no real idea what it does. I did read something about it being used in transformations to give the texture a perspective transformation. I would guess it is ignored, but I really don't know. Runitai, are you there? Help! It is ignored -- actually, I think if it shows up in the .dae file, UVs won't parse with our importer. Anybody got a .dae with 3D texture coordinates to test? Link to comment Share on other sites More sharing options...
Scope Posted June 21, 2011 Share Posted June 21, 2011 All I see in that image is a doorway into a number vortex. Gimme a few years. Link to comment Share on other sites More sharing options...
Drongle McMahon Posted June 24, 2011 Author Share Posted June 24, 2011 OK. I am replacing the image in the OP with the latest version which incorporates Runitai's corrections. Later I will replace all the other versions with a placeholder so that I can delete them from my image allocation. Link to comment Share on other sites More sharing options...
Nalates Urriah Posted March 13, 2012 Share Posted March 13, 2012 I added the OP image to the wiki... :matte-motes-grin: Link to comment Share on other sites More sharing options...
Drongle McMahon Posted March 13, 2012 Author Share Posted March 13, 2012 Good. I hope it helps people. Feel free to use any of my graphs there as well if they would be useful. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now