Tuesday 28 October 2008

Creating LOD-friendly versions of existing sculpts

WARNING: Stuff for builders ahead (but not that hard)

Sculpties are great. You can make all kinds of shapes out of them while keeping your prim count nice and low. That's why this window is two prims, not seven or more:


Trouble with sculpties is that they were designed for organic or smooth shapes. That means that when you view them from a distance, they lose some of their geometry. For example, here's the defalut sculpty shape, an apple, viewed up close, and far away (but blown up to the same size in Photoshop):


It's still basically apple-shaped, even at distance... and of course, at distance, it only occupies a handful of pixels on your screen, so you can't really tell that it's less appley than before.

This process of simplifying sculpties the further they get from you is called "LOD culling" (LOD stands for Level Of Detail) and it's a performance trick - it means that you don't have to render the full detail of things that aren't near you. Most of the time, when we use sculpts the way Linden Labs intended, it works fine and keeps our framerates up.

Trouble is, us builders love to pervert the course of technology and we use sculpts to make things like that window up there. Railings, bookcases, stairs, and ladders all get done too. And when you "simplify" the geometry of a window frame, you don't get a simpler window. You get a tangled mess:


YIKES!

Not good, right? That happens because every single vertex (3D point) in that window is defining an important corner, whereas in the apple, the points are all just in a smooth curve.

So what can we do? Well, we can exploit the fact that LOD culling is affected by size. For example, here's a big window and a small window, side by side, from a moderate distance away:


See how the big window hasn't "broken" yet, while the little one has? But that big window is far too big for a house. In fact you could drape a canvas over it and live *in* it. So what we need is a sculpt that looks smaller than it really is.

And luckily, that's dead easy. What we need to make, effectively, is a model of a small window. A large instance of a small model = a normal sized result.

Sculpts, you may or may not know, use colours to represent points in space. Three dimensions = three colours red, green, blue). So the dead centre of a sculpty is represented by a medium grey colour, which is at 50% red, 50% blue, 50% green. It's drab:


While a normal sculpt is bright and colourful, because its points are all over the place:


(That's a piano pedal, by the way.)

So to make a sculpt "smaller", we need to make all those colours closer to the middle of the colour-space, i.e. closer to 50% grey.

To do that, in say, Adobe Photoshop ('cos that's what I happen to have here,) open up the sculpt image and create a new layer.


Then pick the 50% grey from the colour pallette:


Click the fill tool:


Click in the image to flood it with grey.
Now change the transparency of the grey layer to, say, 50 or 60%:


The sculpt image now looks faded, like this:


Finally, save that as a PNG or a TGA and import it back into SL.

When you apply it to a sculpt, you'll see that it now looks much smaller than it used to. But if you select the object and hold down ctrl and shift (to go into resizing mode,) you'll see that the object's real corners - its "bounding box" - are much bigger than the object looks:

So now SL thinks that your normal-sized window is actually much bigger than it really is, so it draws it at full detail from much longer distances. And you can have pretty that looks good even in long-distance photography:


Credits:
The window I used as an example is from Rhode Design.
The trees you can see in the last photo are from Sculptomancy, and they already use the technique in this article.

Caveats:
SL does things for a reason. LOD culling is there to save people's framerates from imploding. If you do this to every sculpt you make or use, all you'll do is make your place really laggy. Stick to just outdoor prims, like doors, windows, and trees. My stairs, for example, aren't like this, because you can only see them from indoors.

Monday 27 October 2008

Tagged...

Thanks, Laleeta. You shouldn't have. No, really. You shouldn't.

It goes like this:

  • Link to the person that tagged you
  • Post the rules on your blog
  • Share 6 non-important/habits/quirks about yourself
  • Tag 6 random people at the end of your post by linking to their blogs
  • Let each person know they have been tagged by leaving a comment on their website
  • Let your tagger know when your entry is up

Okay, 6 random things about me:

  1. I like whisky, but I'm a snob. I'm tackling a bottle of Glenmorangie at the moment, but my all-time favourite is Balvenie Doublewood. And I've had a few bottles of Bunnahabhain recently. I'm also in the pro-peaty Islay malt camp, so I like the occasional Laphroaig.
  2. I won't watch or read anything to do with Harry Potter until a year after the last movie has come out. I suspect I will love it, but it's just been totally overexposed.
  3. I... like... yoghurt. Sheesh.
  4. I spent some time today evaluating the differences between Genshi, Mako, Cheetah, Jinja2, and Django templates. Jinja appeals because it's conceptually similar to Django's template language, but more powerful... but then again, harder to extend. Genshi and Cheetah have unappealing syntax. Mako has its roots in HTML::Mason (via Myghty) and I used to love H::M to bits back in the early noughties. So I think I might look into that some time.
  5. Fucking blogger fucked up and raped itself in the arse so hard while I was writing this post that I had to ditch it and start again.
  6. I don't know anyone with a blog who hasn't done this meme already.
So I'm not tagging anyone. Ner.

Wednesday 22 October 2008

Where Penn is this week

Reasons for absenteeism from SL, number #3638:

"I've been busy building a streaming radio station with online playlist requests."

Friday 17 October 2008

Pirate Seagull Ghosts

Quaintly Tuqiri: I like how the seagull flies right through your house

Penn Euler: Yeah, ignore him :P

Quaintly Tuqiri: Impervious to walls and minor obsctacles of that nature

Penn Euler: Ghost seagulls

Quaintly Tuqiri: LOL
Quaintly Tuqiri: They don't look scary enough!

Penn Euler: From the crew of a seagull pirate ship that foundered on this island hundreds of years ago

Quaintly Tuqiri: o.O there might be buried treasure here!!

Penn Euler: Not scary enough? see, that's what they *want* you to think!

Quaintly Tuqiri: Oooh I geddit, it's a disguise
Quaintly Tuqiri: Sneaky!!

Penn Euler: Yes, apparently the ship was carrying a load of roman amphorae

Quaintly Tuqiri: With wine?

Penn Euler: Yeah, *roman* wine

Quaintly Tuqiri: Ooooh...

Penn Euler: But the captain seagull, he got greedy and drank the ancient booze, and ordered the helmsman seagull to "pull over," because he wasn't feeling well

Quaintly Tuqiri: LMAO
Quaintly Tuqiri: What a waste of great booze

Penn Euler: And sadly, because seagulls have brains slightly smaller than dried peas, the helmsman obeyed, and thus the ship crashed into the rocks

Quaintly Tuqiri: Oh noes!!

Penn Euler: All aboard were lost, and the cargo of fine ancient wine sank to the bottom of what is now the harbour, and the souls of the seagulls were doomed to roam/fly the land until their captain can "get a goddamn painkiller"

Quaintly Tuqiri: LOL
Quaintly Tuqiri: How is he gonna get one??

Penn Euler: Good question
Penn Euler: I left some out on a plate, but his poor little ethereal beak went straight through them

Quaintly Tuqiri: LOL

Penn Euler: It's a tragic tale, to be sure

Quaintly Tuqiri: Indeed it is
Quaintly Tuqiri wipes away a tear


Wednesday 15 October 2008

I went to a wedding

Can you believe that until very recently I'd never been to a wedding in SL?

Don't worry, I have now. I was invited to the wedding of Chezza Slade and Busta Rustamova.

"It's gothic", said Charisma as she tp'ed me over. I threw on a tuxedo and some eyeliner. That should be enough, right?

Wrong. This was gothic like... well, see for yourself:


I couldn't take my cam off the bridesmaids, who were ethereal in their beauty, standing neatly in a line.


The service itself was unnervingly normal, though.


And the happy couple, dressed in black and red or not, looked great:

The house that Penn built, pt. IV: Credits

Credits to the makers of the all the lovely things I used in making this house:

First of all, I found the incredible Distressed texture shop. I could wander round in here for ages gawking at all the lovely stuff. Some of it is good enough you could just frame it.

Here I am, gawking:


Secondly, Rhode Design. As you may know, I make sculpts. I could, theoretically, make all the sculpts that I needed for the house. What I actually wanted, thought, was to just get on and glue the darn thing together, so I was happy to splash out for for some nice ready-made sculpts. Rhode Design provided the full-perms door, windows, stairs, and curtain sculpts. The curtains even came pre-assembled with the open/close sculpt-changing script.

Here I am on a stairway to nowhere at Rhode design:


Lastly, the inimitable Torley Linden's own sim, Here. There's a ton of stuff here. Er, at Here. I came for the placeholder textures, and was reminded of Torley's library of other free textures, some of which are a bit spacey but other of which might be useful. Here I am expanding my consciousness with Torley's textures:


But you really should have a good look round the whole sim. There's some lovely stuff here, like this enormous, glowing, 80's robot:

The house that Penn built, pt. III: Interior

The interior of the cottage I built, unfurnished. Here's the ground floor, with the front door on the left, and the stairs and back door ahead. The walls are roughly plastered and given a pink wash, while the floor is staying a neutral beige carpet. 


The ground floor again, but taken from next to the back door. You can see the heavy oak beam that holds up the top floor here:


This next picture show the overall interior space very well. You can see the chimbley going right up one gable wall, with hearths on both levels, and the dog-leg stairs. I love interesting interior spaces like this:


This one is taken from above the landing on the left of the last picture:


The top floor has a lovely spring-green colour scheme which complements the pinknes of the walls and carpet. Note that the curtains downstairs are red, but up here they're green. Although this is an attic space, there's plenty of light, with four skylights and a gable window:


Here's the front door up close:

And the sculpted curtains, which open and close in three stages:


So the current quest is to find furniture to fill this place!

Monday 13 October 2008

The house that Penn built, pt. II: The cottage

So after the harbour, the next thing was to find a house. My home island has a distinct building style influenced by Breton architecture. Houses tend to have steeply pitched rooves, thick granite walls, and small windows. It's a cosy look.

I found one place that was selling a Breton cottage for only 999L, but after buying it and plonking it down I started finding all sorts of faults with it, like the walls being too narrow (granite walls have to be thick, for stability), and the fact that it had two chimneys and only one fireplace. It also had cutesy little window boxes and a front lawn which didn't work at all for me.

At first I was going to modify the heck out of it, but I needed to mock something up to know what I was aiming for. Here's the translucently psychedelic mockup I created:


But then, I started texturing...


And adding doors and windows...


And by then, I'd built a house. Isn't it cute?

(To be continued)

Sunday 12 October 2008

The house that Penn built, pt. I: The harbour

So after the dissolution of my old island, I found myself inhabiting a section of an OpenSpace sim with my old prim count. But on an OpenSpace sim, that's like half a goddamn sim.

I wanted to make it something like home... my RL home that is. I'm from a picturesque little island in real life, but I live in a city. However much I love being here, I still love the quiet, rural island life.

So I started by building a little harbour:

It's not really functional... in fact, there seems to be a cute little seating area:


Here's a close-up of the end of the quay:

I like taking people for rides round the island in the little floaty boaty.

And if you dive into the harbour, you'll find this underwater garden:


I'm thinking of putting a 7 Seas fishing thing in, and then trying to build the motor boaty you can get out of it. Definitely one of those invisible aquaria down in the harbour so there's some fishies down there. And maybe a sunken galleon.

Sweaty armpit dance

I have to share this picture.


Left to right, it's, Laleeta, Charisma, Asthenia, me, and Sai I THINK.

[2008/09/24 14:57]  Asthenia Pinazzo: its like the sweaty armpit dance


Saturday 11 October 2008

ARC Rant

I've seen a lot of posts pointing out that ARC (Avatar Rendering Cost) is arbitrary and imperfect. Peter Stindberg even said it has been "debunked".


That's like saying that graded exams have been "debunked". We know it's not perfect, but it's what's possible. Yes, it is only a rough indication. The idea is that an avie with ARC 5000 is harder for your machine to draw that an avie with ARC 1000. There may be no difference between two avies with ARC 4900 and ARC 5000, because yes, there is a big margin of error.

That was explained way back, when Pastrami Linden introduced ARC on the Official SL Blog:
Note that these weightings, and their resultant totals, are not a *perfect* measure of your cost- but more of a relative counter to weigh against other avatars. Point: it’s close, but it’s not scientifically perfect. For that, you’d have to delve deep into batch sizes and draw calls. These weightings and their description/rationales were written by Runitai Linden, one of our most senior graphics engineers and a man who knows rendering efficiency!
We all get fed up with our machines turning to molasses in busy sims when we're surrounded by people wearing bling, long flexi hair, flexi skirts, etc. 

ARC is just a way to tell people when they're getting it wrong.

So people get rude about it? That's the fault of rude people, not ARC itself.

So there are edge cases like a particle emitters which emits one particle every other year? So what? Who wears one of those? And even if they do, it's only 16 points. ARC is only meant to be a general guide. 16 points either way is nothing. You'd have to wear hundred of the little buggers for your ARC to become seriously wrong.

As for "expression" - this is like people playing their tinny MP3s out loud on the bus. Maybe they're expressing themselves, but they're forcing me to experience it, and I don't want to experience their music. Likewise, in a busy sim I don't want to experience your blingy, flexi, 300-prim furry avatar. Feel free to wear it whenever you aren't in a busy place where you're making my computer groan under the load.

Summary: 
i) If you don't think ARC is precise, then congratulations, you just got the goddamn point. It's rough, and for general comparison only. 
ii) If you got yelled at for having a high ARC in a busy sim, then the person who yelled at you is rude but for pity's sake please go and take off some of that junk.

Angry man


I did make a comic. Clicky here.


Friday 10 October 2008

Back once again with the renegade hamster, D for Damager, Power to the people

My home has been destroyed!

The lovely island where I lived for more than 8 months, made friends, laughed, loved and frollicked, was finally shut down forever on the 25th of September. I took a couple of pictures of the final hours.

Here I am with Charisma, standing on the site where my house stood before I dragged a big selection box over it and returned it and everything in it:

All alone in the middle of a very big ocean.

Over on the other side was the home of my freinds Jaken and Anni. I took a snap the day before of their island, still with their stuff on it, surrounded by... wide, flat sea:

I brought Charisma over here and stood there getting all nostalgic for a bit (8 months is a long time in SL), talking about chapters in my life and how this one was coming to a close. Her response was beautiful and profound:

[13:57] Penn Euler: and now, you're the new chapter in my life
[13:58] Charisma Kingsford smiles
[13:58] Charisma Kingsford: there will be new memories