Jump to content

Large Mesh vs High Quality Textures?


Syle Devin
 Share

You are about to reply to a thread that has been inactive for 4396 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I am having trouble working with UV maps and getting high quality textures.In my mesh build I have large meshes and then other meshes with many sectionst hat take up all the possible UV map space. Combined with the sl texture limit size of 1024, or was it 512, I cannot seem to manage high quality textures like I could with prim builds. Is there anyway to achieve what I am tryign to get at?

 

 

Link to comment
Share on other sites

There's absolutely nothing you can do on a prim build that you can't also do on a mesh build.  There's a ton you can do with meshes that you couldn't dream of doing with prims, though.  So, don't dispair.  Chances are you just haven't quite wrapped your head around the basic workings yet.

You can have up to eight textures on any single mesh object, for example.  That's far more than you can put on most single prims.  However, if that's not enough, you can always break your single mesh into a collection of smaller ones.

You can also repeat textures, rotate them, offset them, across the mesh surface, just like you can across any prim surface.  Good UV mapping allows you to take this even further, and apply it in more clever ways, than you ever could with just the in-world parameterics.

As for your particular build, it's hard to give specific guidance without seeing pictures, of course. 

 

To answer your question about maximum texture size, it's 1024x1024.

Link to comment
Share on other sites

I am not yet making a real house, just figuring out how I want to do one out of mesh, and have been wondering much the same thing about how to get, say, a floor texture that has baked AO and, say, a plank floor, or brick wall - I know how to assign textures, but can't figure out how I would align the textures if they were baked. If that makes sense.

Link to comment
Share on other sites

Sorry about that, I thought I had said what I am using. I am working with blender 2.6. I think I understand using multiple materials but what about using multiple uv maps? I have not tested it out yet but I have searched and I don't think it can be done? Atleast I wouldn't think you can have multiple uv maps with different ratios because some faces would overlap?

 

Here is what I am working with. The textures from the bowling floor spread out 25x5 meters in SL.  I would normally repeat the same texture on a prim but I cannot do that if I want to keep it all on one uv instead of seperate textures on their own vertice groups.

 

Untitled.png

Link to comment
Share on other sites


Syle Devin wrote:

Sorry about that, I thought I had said what I am using. I am working with blender 2.6. I think I understand using multiple materials but what about using multiple uv maps? I have not tested it out yet but I have searched and I don't think it can be done? Atleast I wouldn't think you can have multiple uv maps with different ratios because some faces would overlap?

You can't use multiple UV maps, but you can re-use the entire UV map space up to eight times, once per material. You can also extend UV islands beyond the boundaries of the underlying image space because the texture will be repeated infinitely in all four directions. You can visualize the effect in Blender's UV/Image Editor by pressing N (to reveal the properties sidebar) and then clicking the Repeat checkbox in the Display section.

Overlapping UV islands within the same material domain are useful if you want to map a tileable texture to multiple parts of a mesh while keeping a uniform size and aspect ratio everywhere. For example, to use the same floor tile for all floors of a three-story building, select all the floor faces on all three levels, assign a common material index to them, switch the 3D view to Top Ortho (by pressing Numpad-7) and then choose "Project From View" in the Unwrap menu. There will be overlapping UV islands, but that's perfectly fine. If you select all the UV islands and resize them, or if you change the texture scale factor in SL later, the floor tiles will resize in a uniform fashion across the entire mesh. Retexturing the mesh in SL will be a piece of cake, much easier and more accurate than retexturing a prim-based building.

  • Like 1
Link to comment
Share on other sites

In my experience you can have as many UV maps per mesh as you have materials (8)

I don't know how to do it on other software ( I use Cheetah 3D on the Mac), but you basically create separate parts of the mesh and UV map each individual part. Then you apply the material (texture) to the UV mapped part. 

Next, when Cheetah merge the parts to one bigger mesh (import children), it preserves the materials assignments and also the UV mapping for each part. Thus, when imported to SL or opensim, and you select the texture faces, you can apply the textures to each face and it will be UV mapped to the original UV mapping that was set up for each part in Cheetah. 

When you look at the UV map for the combined mesh in Cheetah, it looks like a complete mess with all the UV maps in one UV map space, but they are in fact individually accessible. 

 

Link to comment
Share on other sites

To be honest, I don't really understand the concept of single vs multiple UV maps. Each vertex has one UV coordinate attached to it for each polygon/triangle it participates in. Usually some of these are the same for different triangles, saving storage space through indexing techniques, but conceptually, that remains true. The reality is the UV coordinates and their association with polygons/traiangles. The UV map we look at in our 3D programs is simply a means of presenting that data to us in an editable form. It has no concrete existence, and it is often up to us whether we show the data for one material at a time, or for any other selection of faces or vertices at a time. I think the concept is often used to distingusih sets of UV coordinates where none of the faces should be allowed to overlap in UV space. That is a convenient presentation to achieve certain requiremets of texturing, especially baked texturing, but it is nevertheless an entirely artificial construct iondependent of the underlying data. Some authoring softwar may use it to organise their internal data structures as well, but again that is an arbitrary decision.

I apologise for the techno-philosophy, but I think the idea of discrete UV maps having a concrete existence sometimes gets in the way of seeing efficient ways of manipulation of UV coordinates that are the solutions to the sort of problem the OP has raised. More later, if I can keep typing and Chosen doesn't beat me to all the vrelevant points!

 

Link to comment
Share on other sites


Gavin Hird wrote:

In my experience you can have as many UV maps per mesh as you have materials (8)

Technically it's only one (shared) UV map though, because each face is mapped (or "unwrapped") to 2D texture space only once. Multiple UV maps allow you to map each face multiple times in different ways. This is useful in rendering engines that support multiple textures per face, because you can, for example, mix small tiled textures with large baked lightmaps, saving a lot of memory while maintaining a high texture resolution across the entire mesh (only the shadows get blurred, which is fine in most cases). But we don't have that feature in SL yet, so for us there's only one UV map per mesh for now, shared by up to eight materials.

  • Like 1
Link to comment
Share on other sites

To my understanding there is a missinterpretation. You can have up to 8 separate texturizeable areas on each SL object as already mentioned. But you only can have one single UV map as also already mentioned.

Can it be that what you want to do is to bake different parts of the UV map into different target textures ?

 

  • So one part of the solution is to assign different materials to your object, one material per texture face (as mentioned)
  • The other part of the solution is to tell blender to bake into one separate texture per texture face.

If this is what you are asking for, then mybe this can help:

    http://blog.machinimatrix.org/from-uv-map-to-multiple-textures/

 

  • Like 1
Link to comment
Share on other sites

The difference is this:

A singe UV map for a mesh maps every vertex into a common map of say 2048x2048 pixels. 

Multiple UV maps for a mesh maps regions of vertexes of the mesh into the same 2048x2048 pixels multiple times, thereby creating sub-maps, if you may, for the same mesh. 

This makes it possible to map each region of the mesh that has a separate materials assignment into separate UV maps. Used cleverly it will greatly increase the detail of the textures that are assigned to a single mesh. Larger meshes will (possibly) benefit more from this. The tradeoff is that you may load up to 8 textures for a single mesh. 

As an example, say you wanted tp create a character mesh. You would separately UV map the face, the torso, the arms, the eyes, etc and create textures for each map. When combining the meshes to one for rigging, the combined mesh would have material assignments for each of the parts, with a corresponding UV map. 

Imported into SL, you would select each face (material) and apply the texture for the face to the face, the texture for the torso to the torso and so on. The original UV mapping would be preserved. If not, you'd have to create an overall UV map for the character with far lower resolution (1024) than the combined textures you would apply to the material zones of the imported character. 

  • Like 1
Link to comment
Share on other sites

You are right, it's a convenience. It's just like faces in a flat-shaded mesh, where each logical vertex actually represents several physical ones. There is a 1-to-N relationship between XYZ-triangles and UV-triangles, and the highest N that occurs in the mesh is what we call the number of UV maps.

Link to comment
Share on other sites

Ah yes. I can see that for multiple textures mapped onto the same faces, you could have different UV coordinates for each. Then it would be sensible to present those on a per-texture basis, and you could call that different UV maps. Still, it is really just yet more coordinates for the same old vertices.

Unfortunately, the SL internal format would then cause the download weight to be (roughly) multiplied by the number of superimposed textures. So it would be much more efficient to use the same UV map for all the textures. That doesn't mean they all have to be the same size, as the UV coordinates are normalised to a unit square anyway, so that the same map will work for a 1024x1024 texture and a 128x128 shadow map. In fact, that was my top request for features from the mythical materials project.

Link to comment
Share on other sites

One way to use this could be to create an avatar that has the head, upper and lower body mapped to the corresponding textures of the thousands of skins for the current SL avatar. That would take 3 material zones / uv maps on a single mesh. 

If you could load the baked textures for the current avatar, you could in principle dress up a new avatar with the same (texture based) clothes as you already have in your inventory with skin intact. 

Link to comment
Share on other sites

In principle correct and works nicely with your own textures. But because you need full perm textures it does not work for bought fashion and skins. So if it where possible to define "cloth layers" for mesh avatars with the same UV map as the SL avatar... That would make fun.

For example if the SL mesh importer would allow to set a flag "This mesh is compatible to the SL Avatar UV Map", then the viewer only needs to allow to drag texture based cloth item on the worn mesh and thats it... Instantly all those ready available cloth items would be reusable for (compatible) mesh characters ...

well... probbaly another idea that will never get implemented...

Link to comment
Share on other sites

I guess it is almost possible to implement such a mesh if:

1. The texture area mapped out for the lower body was split into socks, pants and underpants for a total of 3 regions

  • For the naked lower body you would apply the skin to the socks, pants and underpants regions. 
  • For pants you would apply the full pants texture to both the pants and underpants regions and skin to the socks region
  • For socks only you would apply the socks texture to the socks region and skin to the pants and underpants regions

2. The texture area mapped out for the upper body would be split into the undershirt, shirt, arms and gloves for a total of 4 regions

  • You would composite the upper body in the same manner as the lower body to end up with a more or less dresses body

3. The head would be the last part of the mesh for a total of 8 regions for a single mesh. 

This could be implemented as mesh is today simply by mapping up the mesh uvs to fit existing textures. 

Where you would run into problems is of course that you don't have any way to composite alphas onto underlying skin or clothes layers, so in essence you would only be able to do full lenght sleves for a shirt and same for pants. But it would make it possible to use existing skin and clothes textures. 

The biggest issue is of course to uv map a new character mesh onto the existing textures. I don't see how this could be automated with a single click option on import since the imported character meshes could be very different in topos. 

Link to comment
Share on other sites


Pamela Galli wrote:

Soooo -- no one has any ideas about how to texture a large floor to incorporate baked shadows?

I take it you're asking about cases in which the diffuse texture needs to repeat more than once, but it wouldn't be appropriate for the shadowing to repeat, correct? 

I do this with what I call "shadow planes".  I'll explain more in a minute, but first, let me touch on how it's done in other game engines, for some perspective.

In engines that have more sophisticated shader systems than what SL has, one way to acheive the effect in question is with the application of lightmaps, via multiple UV sets.  In simplest example, it works like this.  The diffuse map (what we call a "texture" in SL) is applied to the main UV set, just as SL users are all used to doing.  A secondary image, called a lightmap, is then applied to a different UV set.  The function of the lightmap is to control how much light is allowed to reflect off of each part of the mesh.  Alpha logic applies, so areas that are white on the light map are fully lit on the model, areas that are black are in full shadow, and all shades of gray fall in between. Because the lightmap has its own UV layout, the shading can be made to repeat just once, while the diffuse texture can be free to repeat any number of times.

All this is done with minimal overhead, because the lightmap itself can be really, really tiny.  In most games that I've made them for, 64x64 has been "big".  The shader can be set up to interpolate betweeen points, so that even a very low resolution light map can produce very smooth looking shading.

Lightmaps are my number one wishlist item for SL right now (followed closely by normal maps, and specularity maps).  But since we don't have them yet, the question becomes how can we simulate the same behavior most effectively with what few tools we do have in SL. 

The best solution I've come up with is shadow planes.  Place a secondary plane, just above the floor plane, and put a shadow texture on that.  The floor plane itself can have as many texture repeats as it needs.  The shadow plane above it repeats just once.  In most cases, the additional plane won't affect the land impact much, if at all.

This solution isn't perfect, of course, since there can be alpha sorting issues.  Such problems can be somewhat managed by the fact that the floor plane doesn't necessarily need to cover the whole floor.  If the only shading needed is near the perimeter, then the shadow plane can have a hole in it, or it can even be a collection of small planes.  Depending on the particulars for the build, these options can often make it so that the various center points are kept where they need to be, relative to most camera positions.

  • Like 1
Link to comment
Share on other sites


Drongle McMahon wrote:

To be honest, I don't really understand the concept of single vs multiple UV maps. 

Great question, Drongle.  Gavin provided one good example, out of many really handy uses for multiple UV maps.  Allow me to provide some more. :)

As I'm sure you know from experience, in full featured 3D modeling programs like Maya, Blender, etc., we don't just slap textures onto surfaces and call it done, like we do in SL.  We build shader networks, in which each porperty of a material (color, specularity, bumpiness, etc.) is controlled by its own data channel.  Most people discover pretty early on that applying separate images (or separate procedures) to each channel makes for a really powerful way to create complex appearances on the model surface.  For example, color a surface medium gray, apply a simple noise map to the bump and spec channels, and you've got instant concrete, without having to do any image editing at all.

What people don't tend to realize as quickly is that not only can each channel have its own imagery/procedures, it can also have its own UV layout.  This takes the power to a whole new level.  In my reply to Pam, I spoke about lightmaps as one example of this.  But the sky's the limit.  Literally every single property of a shader can be tied to a completely independent UV layout, if you want it to. This allows you to create extremely complex effects, with relative ease.

For example, say you want to engrave writing into a jagged, irregular surface, and there aren't enough pixels assigned to the polygons in which the writing needs to go.  If you change the existing UV map, you'll make the existing texture angry, and that could cost you hours of extra work, to make a replacement.  But if you simply create a second UV map that gives the target polygons a lot more space, and you tie the bump channel those new UV's, you can now engrave the text, and the diffuse color texture won't have to care about it at all.

Of course, the more complex things get, the less suitable it all becomes for realtime.  Some of the applicable techniques will only be good for film or stills.  Others that can work well in games might not necessarily be winners for SL, because of increased download weight.

One example of where using multiple UV sets in your modeling program can be useful for SL is for combining textures, prior to baking.  Say you want graffiti on a brick wall, for example.  The brick image has to repeat across the surface many times, but the graffiti image should only repeat once.  By giving the wall two UV sets, you can apply both textures, each with their own repeat values, and then bake out the combined results to whatever UV layout you feel is best suited for the in-world model.  This can be one of the previous two UV sets, or it can be an entirely different one.

Now imagine if SL itself had that same capability.  All of a sudden there would be no more need to be locked into the pre-baked imagery.  If you want to change the graffiti without changing the bricks, you could.  And you wouldn't have to waste any texture space at all, since each separate UV layout could be optimized for the speficic type of imagery intended for it

The only way to do that sort of thing now is to use two different wall sufraces, one right in front of the other.  This, of course, leads to alpha sorting problems, Z-fighting, etc.  If we could layer textures directly, there would be none of that.

These are just a few possibilities.  There are all kinds of other things you can do when you're not limited to just one set of UV's per surface.

  • Like 1
Link to comment
Share on other sites

Thanks Chosen.  I wondered what lightmaps were.  Actually what I have done is make shadow planes with holes for the floors, all linked together, but not linked to the house -- so if anyone has a problem with alpha issues, they can just delete them. Not an ideal solution, but I explain what they are in the info notecard that comes with the house and I don't get any calls about the alpha issue. Was hoping there was some way around it.

Link to comment
Share on other sites


Pamela Galli wrote:

Soooo -- no one has any ideas about how to texture a large floor to incorporate baked shadows?

If you have the texture map - why dont you take it into photoshop and paint the shadows onto the texture map?

Are you painting the texture outside SL in your 3D modeling tool?  If so can the shaows be part of the material texture (like the material lighting and specularity is)?  In Zbrush you can use zaplink to photo all sides of the model which takes the texture & material effects to photoshop where you can merge down the material effects into the texture - then bring this merged/baked texture back to the 3D model where it can become part of the UV Mapped texture for SL.

The shadows and specularity of the material map merged awesome into the texture map with this process. 

Might not be what you are needing and I dont know how you do the same thing in any other 3D modeling tool.

Link to comment
Share on other sites

The problem is when I have a wood floor, say. One 1024 texture is going to be blurry; I need it to repeat. But apparently what I am already doing -- making a shadow textured plane to lay on top of the floor -- is about all there is to be done.

 

I did make a lovely baked texture for my little test house.  But it just has procedural textures. That might work for walls etc but not so much for floors

Link to comment
Share on other sites

"The problem is when I have a wood floor, say. One 1024 texture is going to be blurry; I need it to repeat."

This should actually be very easy to solve by laying out your UV´s correctly.

I am using 3ds max by the way but this goes for pretty much any 3d program.

Just stack the UV´s of the parts you want to have the same texture on top of eachother on your layout. The same is done lots of times, for instance if you have a jacket with two similar sleaves, or even have a symmetrical face that is mirrored left to right. Instead of laying out the entire object and painting the same texture twice, thus using precious texture space, you stack the mirrored parts on top of eachother and use the same texture for it. This is how you could tile a bowling alley with using a texture instead of a procedural map.

I hope I explained this somewhat clearly.

Some people stated ZBrush and using Zapplink for texture baking..In Zbrush you can actually render out the baked material straight to your diffuse texture and save it out, and you can allso use Multi Map exporter (or something, under plugins) and bake out all your maps like Ambient Occlusion, specular, diffuse, etc. in one pass and then blend em together in photoshop.

In 3ds max baking shadows into a texture is as simple as setting up your lighting, selecting your object and hitting render to texture, you can then select exactly which passes you want to bake.

Cheers and good luck with your bowling alley ;)

Link to comment
Share on other sites


Pamela Galli wrote:

Actually what I have done is make shadow planes with holes for the floors, all linked together, but not linked to the house -- so if anyone has a problem with alpha issues, they can just delete them. Not an ideal solution, but I explain what they are in the info notecard that comes with the house and I don't get any calls about the alpha issue. Was hoping there was some way around it.

Making shadow planes removable is certainly a good idea, and it also highlights another problem that Linden Lab will have to address when they roll out a new material system: Light maps, even if implemented the elegant way through multitexture pipelines, are a workaround that may conflict with the rendering engine's own dynamic shadows and screen space ambient occlusion. For example, many prim and mesh trees in SL have a shadow plane attached to the base of the trunk. That was a great feature for many years, until Linden Lab added a deferred rendering pipeline to the viewer. Now for many of us those trees cast two shadows: a dynamic one that properly moves with the sun, and a static one on the shadow plane. SSAO and projector lights cause similar issues indoors. The results are horrible and made me stop shipping shadow planes altogether. I'd rather have my content look good on the top end systems than on the bottom end ones.

If Linden Lab ever implement a customizable shader pipeline, there should be an option to switch off light maps globally if dynamic shadows are available.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4396 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...