Jump to content
  • 0

Blender to SL, mesh faces


animats
 Share

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

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

Question

So I want to create an mesh object in SL which has one SL prim with several individual selectable SL faces. How do I do that?

If I import separate Blender meshes, I get separate SL prims, all part of one object. Fine.

If I merge two meshes in Blender, I get one prim with one SL face. Reasonable enough.

But how do I get one prim with multiple SL faces for texturing purposes? What do I make in Blender to get that? This is probably trivial but I have not yet found it in the documentation.

Grouping in Blender does not seem to do anything to SL import. Grouped meshes imported as separate prims.

 

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 1

I see a design problem with this weather vane, quite apart from any texturing.  The direction-indicating vane is welded onto the rectangular pole.  It can never turn to indicate the wind direction.  Oh, and a second issue, which might just be the perspective...the vane appears to be mounted so its pivot point is much closer to the tail feathers than to the arrowhead.  Any weather vane must be designed so that its pivot point is ahead of its "center of pressure".  The center of pressure is determined by the point at which half the area of the object is to either side.  In other words, there must be "more" of the arrow behind the pivot point than there is in front of the pivot point, in order for the arrow to point into the wind.

Whether or not the vane can ACTUALLY turn, I think it should be modeled to at least look like it could.

Edited by Lindal Kidd
  • Like 1
Link to comment
Share on other sites

  • 1
1 hour ago, Lindal Kidd said:

Whether or not the vane can ACTUALLY turn, I think it should be modeled to at least look like it could.

This opens the perennial question about exactly how much "realism" to expect in our virtual world -- a question that has no clear answers.  On the one hand, even a very simple "machine" like a weather vane ought to look plausible, so that the functional design doesn't distract from residents' enjoyment of it.  On the other hand, a creator can leave out a lot of detail and trust residents to fill in the missing parts mentally. We don't need to include all of the bearings and support flanges and whatnot. I get concerned about creators who add more detail than most people will ever see -- mesh jewelry that has 144 facets on every diamond, for example -- because the extra detail adds to lag without making the work any more enjoyable. 

I don't know what this means for a weather vane that sits on top of a building.    I suspect that most people won't zoom in closely enough to look for fine detail, but it would be sad if the lack of detail makes people zoom in to wonder what's wrong with it.  How do you figure out how "real" to make a model like this look?  That's a very subjective judgment call -- one that only the creator and the marketplace can make. 

Link to comment
Share on other sites

  • 1

vanezorderproblem_010.png.06d37dfb7da347e90ed16bfae425d085.png

Improved weather vane. (In-world here.)

The vane now has a rotating collar, and it rotates, following the SL wind, making little squeaking noises as the wind changes. The head of the air kraken is now behind the pivot point, as it should be.

1 LI, 24 triangles, no lower levels of detail, using a cube as the physics model.

 

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

  • 0
6 minutes ago, animats said:

So I want to create an mesh object in SL which has one SL prim with several individual selectable SL faces. How do I do that?

If I import separate Blender meshes, I get separate SL prims, all part of one object. Fine.

If I merge two meshes in Blender, I get one prim with one SL face. Reasonable enough.

But how do I get one prim with multiple SL faces for texturing purposes? What do I make in Blender to get that? This is probably trivial but I have not yet found it in the documentation.

Grouping in Blender does not seem to do anything to SL import. Grouped meshes imported as separate prims.

 

Define six materials. 

Make each face one of those materials.

UV unwrap  somewhere along the way with each face consisting of the WHOLE side of your mesh cube (as a prim would be).  That was said badly. I would likely use Project from view bounds but other ways will work. Presumably you want to be able to TILE textures on your mesh prim.

Export. 

I made one long ago and use it for various things often. 

 

Edited by Chic Aeon
  • Like 1
Link to comment
Share on other sites

  • 0
6 hours ago, animats said:

Grouping in Blender does not seem to do anything to SL import. Grouped meshes imported as separate prims.

Grouping in Blender is not intended as one would think, it's for particle emission (within Blender, useless for SL)

To achieve what you want to make, you can do as Chic suggests, or more easily:

From the state where you have X separate objects, assign a different material to each one (coloring them helps spotting which piece has got one and which haven't)

Once done, Join all of them together and Remove Doubles (so that the overlapping vertices merge and you get a solid surface)

  • Like 1
Link to comment
Share on other sites

  • 0

OK, got that. A material in Blender is a face in SL. Also figured out that prim order is set by alphabetical order of the objects in Blender (and checking the box in Collada export for that.)

Next problem: wrong Z-order in SL.

vanezorderproblem_002.thumb.png.15e71f173a1b46f0266ac8347d59bf9d.png

The E-W mesh somehow got in front of everything else, and the N-S one got behind. This is in SL, on the beta grid, here.

It's the textures, not the geometry. The all-white model at the left is the same model, untextured. Everything is where it is supposed to be. The normals are facing in the right direction. But somehow the depth sorting is wrong. How is that even possible in OpenGL, which is Z-buffered?

The N-S-E-W thing and the pole are one Blender mesh, joined together, and one prim in SL. One texture and one face in SL. The geometry here is really simple. The N-S thing is two meshes of two triangles each, facing in opposite directions, textured with the same texture but with reversed UVs on the back side. same for the E-W thing. There's 2cm separation between them, to avoid the problems of coincident faces. Both crosspieces go through the center post.

There's no low-LOD model here; it's a very low poly model used for all levels. 1 LI, 20 triangles. It's a weathervane, so it gets skylined and needs to look OK at long distances.

vaneoverlapokblender.thumb.png.58d865e3f345350b4d94fdb4321a8768.png

Looks fine in Blender.

This might be the same problem reported in 2011 here. That never had a good explanation. But it was more complicated geometry than this.

I've probably violated some obscure constraint on mesh, but don't know what it is.

 

 

 

Link to comment
Share on other sites

  • 0

Yes, that was it.

It's all explained here, under Alpha Modes Do's and Dont's. SL's texture menu default is alpha blending. Alpha blending is for translucent objects. It forces a depth sort, which will fail with objects that intersect, because "this one is in front" is ambiguous. This weathervane model needs per-pixel depth, the normal mode, which is alpha masking. The GPU hardware does that with the Z-buffer.

vanezorderproblem_003.thumb.png.e3beb82ae968a3a0b989476623b1d97b.png

Alpha masking mode. Much better.

Thanks.

  • Like 1
Link to comment
Share on other sites

  • 0

JUST A NOTE. animats is working on a new kind of imposter for mesh, so I am guessing this is NOT the actual model but the very simplistic (but three dimensional) model. Also likely not animats mesh as he asked for some high poly complex models for testing a couple of weeks ago.  

 

  • Like 1
Link to comment
Share on other sites

  • 0
2 hours ago, Chic Aeon said:

JUST A NOTE. animats is working on a new kind of imposter for mesh, so I am guessing this is NOT the actual model but the very simplistic (but three dimensional) model. Also likely not animats mesh as he asked for some high poly complex models for testing a couple of weeks ago. 

I'm just practicing low-poly modeling. This has 24 triangles. I started with a drawing of the air kraken, not some existing mesh model. I want to get a feel for the problems of low-poly modeling.

Quote

This opens the perennial question about exactly how much "realism" to expect in our virtual world -- a question that has no clear answers. 

My own personal preference is over-the-top realism. I built an entire steampunk telegraph office with working equipment and got actors to staff it. In SL we're limited by graphics hardware, but not that limited. My interest in impostors and such is to figure out how to keep SL from choking on overly complex scenes.

Many things in SL do something reasonable when you try to use them. Doors usually open. Elevators work. Lift bridges lift. Trains run. Vending machines and gas pumps usualy do something. If something has a core function, it should perform it. That gives SL its life.

 

 

Edited by animats
  • Like 1
Link to comment
Share on other sites

  • 0

So I put this weathervane in the New Babbage Oiling Festival. There's a much nicer weathervane there. Over 40,000 triangles, LI of 14, and blanks out at "Low" level of detail. It looks really good up close.

The fancy weathervane would impostor well. A 2-triangle billboard impostor for the base, and 4 triangles for the vane. Another 8 for the anemometer. If we had impostor support in the viewer and imposter generation somewhere in the pipeline, low-LOD models would actually work.

Edited by animats
Add SLurl
Link to comment
Share on other sites

  • 0
3 hours ago, animats said:

Over 40,000 triangles (...)

Blimey! Why does a weathervane need to have 40,000 tris? I bet the mesh looks solid in wireframe mode. For comparison, the SL avatar has 9090 tris (naked avastar female, with hair and all that jazz).

The mesh density of some of the stuff out there is properly horrifying. I'm well aware that optimising isn't easy -- I mean, I look at some of my stuff I did two years ago and I want to bring out the chainsaw to trim some of those polygons. But at least I'm trying.

Link to comment
Share on other sites

  • 0

@animats Check into the function llDetectedTouchST(i). This will let you detect where in a face the touch occurred. It proves X,Y position. 

Using the function I have made 1 prim vendors with all the buttons being painted only on the texture. The series of 'if right of and below the upper left corner and left of and above the lower right corner' gets tedious but the prim count and mesh complexity can be greatly reduced.

Script
// www.lsleditor.org  by Alphons van der Heijden (SL: Alphons Jano)
// Mone Face Touch Calibrator - Nalates Urriah 11/19/2008
default
{
    state_entry()
    {
        llSay(0, "Hello, Avatar! Left click any face.");
    }
    touch_start(integer total_number) {
        integer i;
        llSay(0, "Touched: "+(string)total_number);
        for (i = 0; i < total_number; i++) {
            integer touchedFace = llDetectedTouchFace(i);
            vector touchedpos = llDetectedTouchST(i);
            if (touchedFace == -1) { // cannot do
                llWhisper(0, "Sorry, your viewer doesn't support touched faces. You cannot use this vendor. Upgrade your viewer.");
            } else { // handle touch
                   llWhisper(0,"\nFace: " + (string) touchedFace);
                llWhisper(0, (string) touchedpos.x + "=x");
                llWhisper(0, (string) touchedpos.y + "=y");
                llWhisper(0,"X,Y Copy: <" + (string) touchedpos.x + "," + (string) touchedpos.y + ",0>\n");
            }
        }
    }
}

 

  • Like 1
Link to comment
Share on other sites

  • 0
17 hours ago, Raindrop Drinkwater said:

Blimey! Why does a weathervane need to have 40,000 tris? I bet the mesh looks solid in wireframe mode.

genteknoc_007.thumb.png.72595873f957e95ba302401da9438b24.png

Yes, it does look solid in wireframe.

weathervanes.thumb.jpg.cdbb0e20ef192f1ab249b8156d9e32b2.jpg

And it looks great in world! Unless you get too far away. The lowest LOD model is four triangles and useless. The low LOD model drops out the column completely while most of the fine detail in the vane stays around.

This is why we need better level of detail generation. Some combination of automatic impostors and smarter polygon reduction.

  • Like 1
Link to comment
Share on other sites

  • 0
6 hours ago, animats said:

 

Yes, it does look solid in wireframe.

 

And it looks great in world! Unless you get too far away. The lowest LOD model is four triangles and useless. The low LOD model drops out the column completely while most of the fine detail in the vane stays around.

This is why we need better level of detail generation. Some combination of automatic impostors and smarter polygon reduction.

Automatic impostors would be awesome, I agree. As for the other LODs, it's easy enough to do them in Blender (or Maya or whatever), which gives you more control over what gets decimated and what isn't.

But LODs aren't the issue in this case. The issue is 40000 tris. Yes, it's a great-looking model, but it's designed for a high-resolution static render rather than a game-like environnement like SL. This would be a prime candidate for a high-poly to medium-poly baking workflow.

Link to comment
Share on other sites

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