Jump to content

"Optimized mesh"


Wulfie Reanimator
 Share

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

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

Recommended Posts

This topic comes up fairly often in many areas of the forum. Could we gather some examples of the difference between the initial "high poly" mesh and its optimized highest-LOD model for SL, to showcase just how much mesh you can shave off with barely noticeable degradation in visual quality?

For example, I just recently made something majorly based on BlackyJunkGallery's art, using nothing but cubes and the Subdivide Surface modifier at 3 subdivisions.

5707791bb8.png

Can you guess which one is the original high-poly one? Probably, if you're looking at the magazine slot. Here's the wireframe.

The original model has about 17400 triangles, the optimized one has only 1600 triangles.

But of course, leaning in with a magnifying glass makes the difference very obvious, but this model is still missing textures which could easily hide slight angles and in regular SL-use you'll rarely be close enough for it to bother you. I may also have been a little liberal with removing the loops as well, as the cartoony style benefits slightly from the angles.

And there's not much more to it than applying the subsurf modifier and going to town. Personally, I check each loop I'm about to get rid of by double-tapping G (Grab) so I can move it along the surface. This shows me if there's going to be visible deformation to the shape and to what degree. If the loop gets to stay, I just cancel the move. If I'm getting rid of it, I move it all the way to one end and "remove doubles" which merges the loops without breaking anything. (Example workflow on a video)

Edited by Wulfie Reanimator
Linked to artist's post
  • Like 7
Link to comment
Share on other sites

6 hours ago, animats said:

Getting down to 1600 triangles is easy.  It's getting down to 30 or so for a low-detail model that's hard.

You don't have to go all the way down to 30 for the lowest level of detail, budgets can vary a lot per object! A good rule of thumb is reducing the tri count by 30-50% per level, again depending on the overall shape of your object. (This would leave me with 100-385 tris at lowest.)

For organic shapes with lots of round surfaces, you can reduce a lot more. It's also important to go inside of your model to remove any unseen faces for cheap reduction, like the inside of the barrel in my example. (Also, since we're only reducing geometry, it's okay to merge some quads into "messy triangles" since you don't have to be working around them anymore at this point.)

For more "manufactured" shapes, like buildings or apartment insides (anything with lots of edges and flat surfaces), reduction can be much trickier. I have an example of this as well, and by far the biggest reductions are found around various framing, corners, and hidden faces. It's okay to remove/close entire openings at lower levels, or to remove one whole side of a wall. (Remember that the camera will be far outside of the building.)

There's also the whole other layer of detail such as bakes (bump/normal and specular maps) that allow you to get rid of more geometry without it being noticeable, which I believe a lot more people would keep enabled if enough mesh was shaved off for FPS to increase. 

I don't even think that the lower LODs are that important.. well, they are, but when it's extremely common to see objects with the highest 1-2 LODs being upwards of 20k triangles, getting those creators to at least try is more important than telling them to optimize down to the wire.

Edited by Wulfie Reanimator
Link to comment
Share on other sites

I figured I'd put out one of mines. It's umm... some kind of collar/neck stump thing I made for halloween with a few vents.

Highpoly ~3.2M polygons, it's really the welds that push it up so high because I used displacement for them.

demo-hi.png.be6f4994fd6bd2c5f8f02f2e2cea9d48.png

Low poly: 2007 triangles, if this was a model for an actual game I'd have been a lot more aggressive because you'd never seen it at that size.

demo-low.png.49ab4cad1327932f06b6bb96924aa635.png

Textured low poly

demo-low-tex.png.14467f2b89853407cd64fc9cda05ff91.png

And here is the entire UVmap.

demo-uvs.png.b43cf400231731b79d8cb0c292a31ef7.png

  • Like 2
Link to comment
Share on other sites

6 hours ago, Wulfie Reanimator said:

I don't even think that the lower LODs are that important.. well, they are, but when it's extremely common to see objects with the highest 1-2 LODs being upwards of 20k triangles, getting those creators to at least try is more important than telling them to optimize down to the wire.

Covering the full surface at lowest LOD is extremely important. See-through houses are really annoying. I bought some animesh models, and they blank out to a "shark fin" triangle at about  15 meters.

Exercise: Go to some exhibit in SL of supposedly good objects for sale. Set the LOD factor to 0, which forces lowest LOD for everything. How much is even visible?

  • Like 1
Link to comment
Share on other sites

22 minutes ago, animats said:

Covering the full surface at lowest LOD is extremely important. See-through houses are really annoying. I bought some animesh models, and they blank out to a "shark fin" triangle at about  15 meters.

Exercise: Go to some exhibit in SL of supposedly good objects for sale. Set the LOD factor to 0, which forces lowest LOD for everything. How much is even visible?

You're not going to get me to seriously argue that "low LODs don't matter." My point in that paragraph (and this whole thread) was "let's start with the easy stuff first, we'll benefit much much more from it."

Edited by Wulfie Reanimator
Link to comment
Share on other sites

11 hours ago, animats said:

Getting down to 1600 triangles is easy.  It's getting down to 30 or so for a low-detail model that's hard.

No it really isn't.

At the on screen pixel size a lower LOD mesh will be presenting, you can safely forgo any notions of keeping your item manifold. It's just a collection of texture planes and might not be pixel perfect ... but it doesn't need to be. You can be very aggressive. 

Link to comment
Share on other sites

24 minutes ago, CoffeeDujour said:

No it really isn't.

At the on screen pixel size a lower LOD mesh will be presenting, you can safely forgo any notions of keeping your item manifold. It's just a collection of texture planes and might not be pixel perfect ... but it doesn't need to be. You can be very aggressive. 

If only.

meshhouselowlod.thumb.png.18f1c0d302629261d03d249e19a75db4.png

Mesh house from inVerse's demo rezzer, viewed at lowest LOD. At distance, you can see through this house. That's the problem.

 

primhouselowlod.thumb.png.1dc854f8daf16b097af61b039e334d4e.png

Prim house from same vendor, viewed at lowest LOD. Not bad.

The prim system handles low LOD reasonably well. When mesh came in, it should have come with tools that did no worse than the prim system at low LOD. But LL left out that part and dumped the problem on creators.

Link to comment
Share on other sites

22 hours ago, Wulfie Reanimator said:

This topic comes up fairly often in many areas of the forum. Could we gather some examples of the difference between the initial "high poly" mesh and its optimized highest-LOD model for SL, to showcase just how much mesh you can shave off with barely noticeable degradation in visual quality?

I'm afraid you have to count me out of this. I usually start with a very simple model and then add details so my meshes never go through a high poly phase.

But speaking about optimisation in general:

  • Remove all hidden triangles and vertices
  • Remove vertices in the middle of perfectly flat surfaces (unless they mark divisions between materials of course)

Yes I know, this isn't even mesh 101, it's pre-school teaching. But I think we have to start there because even such basic principles seem to be completely alien to so many SL mesh makers. Even some fairly big names who sell well because they are better designers than craftspeople, consistently make that kind of noob mistakes. Sometimes I get the feeling they've never even heard of edit mode in Blender and only work in object mode.

Edited by ChinRey
  • Like 3
Link to comment
Share on other sites

3 hours ago, animats said:

Covering the full surface at lowest LOD is extremely important. See-through houses are really annoying. I bought some animesh models, and they blank out to a "shark fin" triangle at about  15 meters.

Exercise: Go to some exhibit in SL of supposedly good objects for sale. Set the LOD factor to 0, which forces lowest LOD for everything. How much is even visible?

It is, I'd even argue that at the lowest lod, the texture almost doesn't matter anymore, what matters is that you can still barely recognize the outline so that when a higher lod switches on it doesn't look like that object just popped into existence. It has to give a vague impression that the object was there all along, if possible. It's just managing the suspension of disbelief.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

15 hours ago, ChinRey said:
  • Remove vertices in the middle of perfectly flat surfaces (unless they mark divisions between materials of course)

This touches on something that has confused me for a while - I've read in some posts to remove all extraneous vertices, and on other posts that, because of the per-vertex lighting used in non-ALM, you do need some of the extra vertices (and this is why, for instance, the SL cube has 9 faces per side instead of 1), otherwise you get some odd effects (which I can confirm do exist).

They can't both be true!

Link to comment
Share on other sites

5 hours ago, Ana Stubbs said:

This touches on something that has confused me for a while - I've read in some posts to remove all extraneous vertices, and on other posts that, because of the per-vertex lighting used in non-ALM, you do need some of the extra vertices (and this is why, for instance, the SL cube has 9 faces per side instead of 1), otherwise you get some odd effects (which I can confirm do exist).

They can't both be true!

 

I believe that the latter is outdated information, though if anyone cares to demonstrate otherwise I'd be more than interested, That behaviour is very old, probably 10 years or more. It harks back to a time when the lighting model in Secondlife was far more basic and the additional vertices did indeed deal with the fact that a prim may be embedded in a wall or other objects and partially occluded. Even if it were still the case, while I do generally subscribe to the school of thought that making things look good for the most people possible is a good practice, I don't think I'd extend that to wasting countless vertices on long straight edges in case somebody without ALM worries about the lighting. It's an interesting trade-off to muse though, would the person with ALM disabled prefer 9 times the triangles (given the square face as an example), or slightly wonky lighting in their already badly lit scene? 

If my understanding is correct, if vertex shading is in place (as opposed to per-pixel shading) you would have a noticeable shadow effect when you embedded two prims, this would be because the embedded vertices would render in shadow and that shadow would extend to the next vertex even if that vertex were in the light. 

 

Link to comment
Share on other sites

I wrote a blog a few years ago looking at how I tackled a hard limit on LI given by someone requesting an item from me. The blog can be found here, it's prolly a TL;DR for most people but I think the table I put in that at the top reflects what most people on this thread have stated.

2583dad4110c52bf3d58dde476748d36.png

 

 

 

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

7 hours ago, Ana Stubbs said:

This touches on something that has confused me for a while - I've read in some posts to remove all extraneous vertices, and on other posts that, because of the per-vertex lighting used in non-ALM, you do need some of the extra vertices (and this is why, for instance, the SL cube has 9 faces per side instead of 1), otherwise you get some odd effects (which I can confirm do exist).

They can't both be true!

The proof is in the pudding. Here are two cubes. The one to the left has been tweaked to eliminate the mid-surface verticesn the one to the right is a straight one with those extra vertices. Notice the difference?

1460331703_Skjermbilde(2019).thumb.png.bea7f06a65336431e1650c65f415e2ed.png

There are actually some extreme and very rare light conditions where those extra vertices do give a mraginally better shading around the edges of the surface but even under those conditions the extra vertices do more harm than good since they tend to show up clearly as a square of bright spots right in the middle of the prim face.

I'm not sure who got the idea of adding those extra vertices to the cube or when it happened. I'm quite sure they weren't part of the original prim specs. They actually break the basic logic of the prim system and they are only there on perfectly straight prims. Add the slightest hint of taper (as i did to the cube to the left) and they're gone. The original prim system was developed by Avi Bar-Zeev back when Cory Onderjika was LL's CTO. Unlike their sucessors, those two guys tended to be very resource conscious. Look at this for example:

559460368_Skjermbilde(2020).png.443292e6f5670e3380f54e046645fc89.png

This is a very long and thin but otherwise perfectly normal cylinder prim yet it looks like a hexagon. The reason was that LL tried to reduce the vertice and triangle count by drastically reducing the LoD for cylinders. They reduced it so much that if the cylinder is long and thin enough, the ends show up at lowest LoD even at point blank range. According to @Grumpity Linden it's amazing how many triangles they save this way and I believe her (as always). And then they added far more triangles to the cube to achieve a far less significant effect than this? That must have been an afterthought - and not a very good one - by somebody else.

In 2008 Bar-Zeev started working on an article explaining how the prim system works. But when he looked at the source code he discovered it had been so bodged since he left LL that he couldn't figure it out anymore. So he gave up.

Edited by ChinRey
Link to comment
Share on other sites

5 minutes ago, Beq Janus said:

I wrote a blog a few years ago looking at how I tackled a hard limit on LI given by someone requesting an item from me.

That's a good table but I do still have some reservations. Which model is the most important - that is the one usually seen - depends a lot on the object size.

For small object - say less a meter in all directions - it's the low and even lowest models that are the "workhorses", the mid model is hardly ever used and the high only on very close zoom-ins.

Really large meshes may never ever switch to LoD models at all, always staying at high.

  • Like 2
Link to comment
Share on other sites

3 hours ago, Beq Janus said:

I believe that the latter is outdated information, though if anyone cares to demonstrate otherwise I'd be more than interested, That behaviour is very old, probably 10 years or more. It harks back to a time when the lighting model in Secondlife was far more basic and the additional vertices did indeed deal with the fact that a prim may be embedded in a wall or other objects and partially occluded. Even if it were still the case, while I do generally subscribe to the school of thought that making things look good for the most people possible is a good practice, I don't think I'd extend that to wasting countless vertices on long straight edges in case somebody without ALM worries about the lighting. It's an interesting trade-off to muse though, would the person with ALM disabled prefer 9 times the triangles (given the square face as an example), or slightly wonky lighting in their already badly lit scene? 

If my understanding is correct, if vertex shading is in place (as opposed to per-pixel shading) you would have a noticeable shadow effect when you embedded two prims, this would be because the embedded vertices would render in shadow and that shadow would extend to the next vertex even if that vertex were in the light. 

 

It is outdated yes, the old, old renderer that literally doesn't exist anymore used vertex shading and those extra verrtices where important back then.

When windlight was rolled out it replaced the previous lighting code completely (and brought the shimmering water material you get even without ALM)

Link to comment
Share on other sites

50 minutes ago, Kyrah Abattoir said:

It is outdated yes, the old, old renderer that literally doesn't exist anymore used vertex shading and those extra verrtices where important back then.

Oh, so it did actually make sense for a while. I didn't know that. In fact, I suspected the extra vertices were added with windlight.

But that raises the question, why was it only applied to untwisted cube prims? It's not as if tapered ones behaves any different when it comes to shaders.

Link to comment
Share on other sites

18 hours ago, ChinRey said:

The proof is in the pudding. Here are two cubes. The one to the left has been tweaked to eliminate the mid-surface verticesn the one to the right is a straight one with those extra vertices. Notice the difference?.

Do you notice the difference here?

image.thumb.png.ff837a8c196e7ad1df6b0fdfa19e8e78.png

The one on the left has 32 triangles per face, the one on the right has two. Lights are identical, and at identical distances.

With ALM on they look identical. Unfortunately the sea distorts into the sky in ALM (WTF?) so I decided to spare you all that picture as it made me feel rather nauseous.

  • Like 1
Link to comment
Share on other sites

2 minutes ago, Ana Stubbs said:

Do you notice the difference here?

Yes, that's the "extreme and very rare light conditions" I was talking about.

It also shows very clearly how those extra vertices form a visible pattern across the surface. I'd say that for that reason even under those rare conditions where the extra vertices make any difference at all, they do more harm than good.

Link to comment
Share on other sites

3 minutes ago, ChinRey said:

Yes, that's the "extreme and very rare light conditions" I was talking about.

It also shows very clearly how those extra vertices form a visible pattern across the surface. I'd say that for that reason even under those rare conditions where the extra vertices make any difference at all, they do more harm than good.

I'm not sure it's that rare - I clocked onto this when people started complaining that the sconces on the wall had stopped working.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1901 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...