Second Life Materials Feature is AWESOME!

Just how important is the new materials feature to Second Life content creators? You need to have deferred rendering enabled (thats lighting and shadows to regular users or as LL have renamed it ‘Advanced Lighting’) which for most people means killing your SL experience.

I’m on top spec iMac. I sold my grandma and parents and sister to get a computer that runs SL pretty Well and i sometimes forget that not everyone can switch on Advanced Lighting and shadows and keep up with me as we run across the grid.

So if i praise the awesomeness of the new materials feature, am i preaching to only a small number of users who can run with shadows?

As usual with second life you have to look at things alternatively. Why is it only top spec computers can run Lighting and shadows, i’d wager it has something to do with the amount of geometry the shadows have to bounce off and reflect light and all that technical gobbledygook the computer overheats in doing.

 

What Materials Does

Materials for SL basically allows you to make custom fake bumps and shiny surface effects for objects. Its a pretty standard effect used in many 3D programs where instead of having to render a really detailed model that uses up lots of computing power, you make a basic low detail shape and cover it in a special texture that tells the computer how light should react to it and in doing so gives an illusion of shape.

For Second Life these special textures are called Normal Maps for bumpiness and Specular maps for shinyness.

maps

The way i see it is that if content creators start reducing their objects detail in favour of using Material Mapping to create the illusion of high detail, this should mean that lower spec computers could find it easier to run Lighting and Shadows (advanced Lighting).

 

How to do it?

There is an experimental viewer which does have some bugs which is why its called an Alpha… DUH!, But for the most part it works spiffingly.

So for my first proper test i created a VERY simple pillar in Blender. I wanted to see just how much extra geometry (detail) i could add to a smooth cylinder shape.

MaterialsMesh

Next i created a texture of stone and carvings in photoshop. This would serve as the basis for my normal and specular maps.

originalimage

Unwrapped UV texture with stone and carvings added with photoshop to be imported to Crazybump

I discovered a small app called ‘CrazyBump’ that seems to be in beta testing for the Mac version but works really well and is currently free to download. The PC version is $99.  It has a simple user interface that allows you to import a base image to create and change how shiny and how bumpy your maps will be via simple sliders while giving you a nice preview of how lighting will react to the maps.

crazybump

Crazy Bump is a gem of an app with a simple to use UI for creating just what i need for SL

 

Crazy bump then allows with 2 clicks to save the Normal or Specular Maps to you desktop as .BMPs ready to upload into SL.

Next i recorded a video where i add the normal then specular maps to the Mesh Pillar.

 

One thing that I’m beginning to realise is the importance of lighting. Its the atmospheric lighting and how it reacts to the mapping that gives it the 3D appearance and changing that lighting can change how the object appears rathe significantly. that means and object could look amazing when Sl is set to midnight and awful when Sl is set to midday. It’s not a simple matter of adding the Norm and Spec maps, you have to consider the objects environment and  the wind light settings of that region.

materialsLighting

1. No Advanced Lighting 2. Advanced Lighting Midday 3. Advanced Lighting Midnight

Materials adds an extra dimension to atmosphere, wether it will widen the gap between those who can run deferred rendering or close it, we will have to wait and see.

Thinking ahead to Oculus immersion.

ocolus riftIve been watching the Oculus Rift stuff with interest and of course wondered if it would ver be supported by SL. With Draxtor overspilling with excitement at Linden Labs CEO’s comments on an Oculus Facebook page i’ve had deeper thoughts on the subject.

It’ll never be as simple as just putting on a headset and playing the game. A lot of extra thought, design, and programming will have to go into how you interact in an Oculus Second Life.

For instance how many of you view your second life as being the avatar you control or do you perhaps see your avatar as another person you control, influence and guide. Are you your avatar, or are you your avatars typist.

Second Life is primarily i think a 3rd person over the shoulder game. We take a lot of pride making our avatars look awesome. What happens then if we attach a peripheral that puts us inside our avatars, we see everything from their eyes. To some this might be a very odd shift in how they perceive Second Life and their avatars and themselves.

when you sit on a go kart do you want to see it from the mouse look view or from a floating camera behind? And what about building from a mouse look perspective?

There is a possibility that Linden Lab would allow several ways for Oculus to be used in SL. I saw a video of Oculus being used with team fortress and the testers were experimenting with the many view and control options available.

But other than from the view of your avatar, is it even practical to have another view point? Such as a guardian angel floating behind your avatar view perhaps. Would be similar to the fly cam i enjoy with the 3D Spacenavigator. And speaking of the 3D mouse. There is so much i do with a keyboard and the team fortress testers already said its hard to use a keyboard when in Oculus. Immersing yourself in Second Life with Oculus could dramatically limit your controls. Chatting via text chat would be near impossible. Selecting inventory, clicking things in world could be more difficult depending on how well mouse actions would be in the Oculus view.

But as someone who loves looking into SL’s potential for games and experiences i do start wondering what new possibilities Oculus could bring to SL. Special Particle effects and moving objects that take advantage of the 3D in Oculus.

Walking around in an Oculus view of SL would be like nothing we’ve seen in SL before but the novelty will soon ware off if i can’t interact with the environment due to overcomplicated plonky controls.

Not quite sure why i put this video at the end, im sure subconsciously its relevant.

The Secrets of Mesh Landimpact

LiIconI’m hearing more and more SL creators saying that the Landimpact calculation is borked and that LL should change it. I don’t agree with this at all, i believe Linden Lab have done a very good job with mesh and its resource calculations and I’m a better 3D modeller because of this.

Before i try and explain the secrets to getting your mesh creations low in land impact we need to first understand why the calculations are the way they are.

It is my belief that Linden Lab took a much more strict approach to how mesh costs as a way to keep more accurate calculations on the resources an object uses. If your mesh object costs 500 land impact, thats not because LL are being nasty to you, its because your object costs the viewer a high amount of resources to download and display. When you complain to the Lab to change the land impact calculations you are basically requesting that you be allowed to create inefficiently and bork the grid with your monstrosities taking the grid performance backwards.

I fully believe the mesh Land Impact calculations are fair and important to teaching us how to make very efficient 3D models which will help SL become more stable as long as we stick to calculation LL have set.

Mesh is extremely flexible and SL’s import options give us a lot of control on aspects i expect some of you never knew about. I don’t blame you for not knowing, there is nothing written down to explain the secrets of uploading low cost mesh, so bare with me and i’ll try and share what i know so far.

 

What Makes a Mesh Object High Landimpact?

There are FOUR factors that can cause a mesh object to be high in land impact.

Detail1

In Blender: Left a low detailed Bottle – right a higher detailed smoother bottle

(1) Detail: The amount of vertices used to create the object. The more detail, the more points need to be calculated.

(2) Size: The size of the object in world. Generally believed the larger the object the more resources it can eat up, but this might actually be related more to LOD than object size as you will find out if you keep reading.

(3) Physics shape. This defines the shape of the object that you walk on or bump into. The more detailed this is the more resources it takes up, the higher the Landimpact.

(4) LOD: or Level of detail. If you still don’t know what this is, go read my blog post about it because its VITAL to reducing land impact costs.

These four factors when maxed out will give you a mesh object HUGE in land impact. But we are given the options to modify these factors when importing and it’s here that we get to reduce the land impact cost.

 

Example One: Default Uploads

In this example i shall compare a low detail bottle with a higher detailed bottle on default import SL settings.

Low Detail Bottle.

bottle1-defaultUpload

This low detail bottle is being uploaded on SL’s default LOD import settings and with Physics shape set to HIGH. It has a calculated landimpact (li) of  7.7 which might get rounded up to 8Li

Bottle1-defaultImported

Inworld the Bottle is rather big and as predicted the bottle’s land impact has been rounded up to 8Li.

High Detail Bottle.

bottle2-defaultUpload

This Higher detail bottle is also being uploaded on SL’s default LOD import settings and with Physics shape set to HIGH. It has a calculated landimpact (li) of  a whopping 35.2 . This shows how much an object can change when adding more detail.

Bottle2-defaultImported

Inworld the Bottle looks noticeably smoother than the previous one but at 35 landimpact i can hear you with arms up in the air saying “But at the cost of 27 precious land impact WTF!”.

What if i said you could reduce that 35 landimpact and still retain that size and extra detail? What if i said you could reduce it to 1 landimpact and still retain the size and detail, would you believe me?

Who needs Physics anyways?

One trick i use is virtually removing the Physics shape. Some modellers make their own physics shapes as a separate model thats combined during upload. Many simply use SL’s built in physics shape generator which builds a physics shape from the model you are importing. What i have found is by making the physics shape as small as possible this can reduce the overall landimpact dramatically. And the simplest way to do this is by adjusting the ‘lowest Level of Detail’ setting in the import options and using that as the bases for our bottles Physics shape.

Example Two: Reducing Physics shape

physics1

The lowest ‘Level Of Detail’ is the often the last version of an object you see as you walk away from it. For large objects your draw distance is low enough that you wont see this LOD stage so i find that it’s ok to reduce it to ZERO.

physics2

Now i switch to the Physics TAB and choose ‘Lowest’ from the ‘Step 1:Level of detail’ section drop down menu. This is selecting our objects Lowest LOD setting as the bases to create its Physics shape.

I CLICK  the ‘ANALYSE’ button then ‘Calculate’. You will see that my Bottle has a predicted Li of just 7.3Li. 

physics3

Thats a drop of about 27 landimpact just by changing the Physics shape. But i can understand if you are reluctant to import objects that are walk through and have no mass. I will come to that later in this blog post.

The LOD Effect.

This is a subject that i struggle to explain to people. Some people get it , others don’t and im really sorry if my own explanation of LOD does not help you understand. The size of an object effects how LOD chooses to display your object and understanding how it does this will lead you to consider how best to import your model. So here goes, wish me luck…

Example Three: The LOD Rings.

If you still haven’t read my Blog post about LOD ,WHY NOT? – To quickly surmise, every object has four rings around it. The further away the ring the lower in Level Of Detail (LOD). As you walk up to an object you are walking through these rings, so as you approach you first enter the outer ring of the Lowest LOD causing the object to show its Lowest Level Of Detail. As you get closer you walk through the Low LOD ring, and then Medium before reaching the high LOD ring and see the highest detail of the object.

LODLarge

Ring distance is for visual purpose and does not accurately portrait the distance between each LOD ring at this objects size. In fact i feel the rings on this giant bottle would be at least 3 times bigger in distance from the object

With my giant bottle we can see that the LOD rings are HUGE!. I’d have to walk quite far away just to be at the distance to view the ‘Low’ LOD.

LODsmall

What many don’t realise is that the LOD rings are tied to the size of the object so when i shrink the bottle down, the LOD rings shrink too. Suddenly I’m at the distance to view ‘Low’ LOD. This is why some small objects disappear when you stand 1 metre away from them. But the SL Mesh Import has options to counter this, and its this effect that will allow me to reduce the giant bottle’s Li down even further.

Example Four: Doing away with the LOD

As demonstrated above the the giant bottle’s LOD rings are so huge that you would have to be really far away before it changed to a lower LOD. Because of this i can actually do away with some if not all the lower LOD shapes during the import process.

noLOD1

Here you can see I’ve reduced the LOD settings for ‘Medium’, ‘Low’ and ‘Lowest’ to ZERO, practically removing the ability for the object to display the model at these Levels of Detail.

noLOD2

Combined with the fact we also set the Physics shape to the none existent ‘Lowest’ LOD, when i finally click calculate i get a predicted Land Impact of 1.7 Li

1li

And once imported I’m delighted to see that the high detailed large bottle has been rounded down to only 1 Li.  – MAGIC! –

But if you are anything like me you probably dont want people walking through it and since we removed the Physics shape there is now nothing to stop that happening. Well I’ve discovered that our faithful old Primitive cube is still a very handy useful tool for creating very simple Physics shapes that will not add much if anything at all to the Mesh Objects Landimpact due to Prim Absorption.

Example Five: Using the PRIM for Physics

PRIMphysics

Im using one simple PRIM cube to create a block that will stop you walking through the bottle, thats all i need it to do really. I Link the Bottle to the Prim making the PRIM the root.

PRIMphysics2

Notice that the landimpact is still only 1Li. Now all i do is set the surface of the PRIM to 100 Transparency. leaving me with a bottle i cant walk through.

Small things need LOD boost.

So far ive concentrated on showing how to make  low landimpact HUGE objects but there is a flip side to this. I mentioned briefly during my explanation of LOD rings that some objects disappear quickly from view due to their small size. Whats happening is that because the mesh objects are small, so are their LOD rings and step out of their range quicker than if they were big. But this can be countered by doing the opposite to what i did to reduce the Bottles large land impact.

outofrange

So my giant 1 Prim Bottle is shrunk right down in size by my feet (yes i know i need to wash). Look what happens when i move away from the bottle, it becomes a single white line. This is because i reduced the ‘Medium’, ‘Low’ and ‘lowest’ LOD settings during upload because i knew the object was going to be big.

This shows that i cant use the same import settings for an object thats going to be big with an object thats going to be small. You have to consider the size and use of your object so you can optimise accordingly during import.

Example Six: Boosting LOD

boost1

What i now need to do is import my Bottle again but this time with the idea of having it stay visible and more detailed for longer while small. So instead of reducing the LOD settings i have to increase them which will add to the land impact but hopefully be countered by the fact the bottle will be small.

NOTE: when it comes to mesh simply making it smaller does not necessarily mean the Land impact will reduce because you will find you have to boost the detail of the LOD so that its seen at a good distance.

boost2

To get a better idea when calculating the costs, you can change the scale setting in the upload options. My calculated cost is 6.8 which is a bit more than 1li that the large bottle had.

boosted1

boosted2

So the small bottle was rounded up to 7 Li but can be seen at a much greater distance. This i hope shows that you should consider where you mesh object is going to be. If this small bottle is going to be on shelf in a small room, then i should probably have not set the ‘lowest’ LOD settings so high reducing the Li. But for being viewed outside this small bottle needs to be this high in order to be seen so far away.

 

And Relax.

Well i hope this all didn’t just go over your heads. It’s actually really hard to explain it all but once you get the feel for how sizes, distance and detail effect The Mesh you’ll be making awesome efficient mesh objects in no time. Plus once you figure it out and master, you’ll soon appreciate how Linden lab have incorporated mesh. It forces you to be good, it forces you to learn to be efficient so that your creations can download and be moved about by the crappest of computers and slowest of internet connections.

Sorry if this post did nothing but confuse the hell out of you 🙂

ALSO, if you are interested in learning how to make a mesh object but have never touched a 3D programme before then my 6 part PDF tutorial ‘MAKING A MESH’ is still available inworld at Nemo Beach. LINK

The Rabid Rabbits Game – A break Down

Each Easter holiday on Escapades i throw together an experience that requires my island friends to be a little creative. In 2011 they decorated little Eggmen, in 2012 they decorated Eggs. This year they were required to decorate little Rabbit Statues which visitors to the island must collect as part of a new game called ‘RabidRabbits’

This game combines many elements of my previous efforts but also includes some new approaches.

TheGoblins

Simplicity from complexity.

This game uses the most complicated HUD system I’ve made yet where the complexity comes from trying to make the experience as simple as possible.

I started out by writing what i wanted in the experience. I wanted to tell a story, i wanted to collect things with a visual inventory, i wanted to finally get hurt by the monsters i battled and i wanted all this to happen in the HUD and i cant use experience permissions system because it’s not finished.

To do this i had to break the scripting into parts.

Bunny_Nat1. Main Inventory Script: This main script kept a record of the HUDS inventory and position in the story. Each time an object was discovered this script checked it against it’s list and if not yet found it would display the object on the HUDS visuals while counting it in the scripts list. The position in the story was determined by the number of objects found. For instance, if there was no objects found the story was at the start, if some objects were found the story was in the middle, if all objects are found then the story is at the end.

2. The storytelling script : This system stored all the commands for displaying the story elements, popping up words and playing sound bites. This also had a separate subsystem for controlling cameras which i used to create cut scene effects during the story telling, focusing the camera on specific props and characters.

HUD_health_53. Health Script: This system kept a count of how many times a monster had hit you and also requested permission to teleport when first attached. Once the health count reached zero the script would teleport you to a respawn point. ‘TeleportAgent‘ was introduced to Second life’s scripting language last year as part of the ‘Advanced Experience Tools’ along with ‘AttachToAvatarTemp’. But it came with some really annoying rules such as only working with objects you own. Also you can only accept permission to TeleportAgent by clicking yes on a dialogue box which can lead to the user not seeing the request before SL’s UI fades it away.

The way i wanted the HUD to work is a totally contained system where everything happens. You carry the whole story with you. The Goblins and monsters dotted about the island only send one word messages that tell the HUD what to activate. This is a change to how i used to do things where if you found a secret door, then that door did all the story telling for everyone who touched it.

hud

Storytelling

For the Story telling of Rabid Rabbits i used the same idea of pop up written displays used in the Cheese Fairy game, but this time instead of the pop ups automatically coming and going i allowed the user to click a button to move on, giving time to read at leisure. I looked into ‘SetCameraParams‘ as an experiment into focusing story elements on props and characters and i was quite pleased how that came out as it gave even more sense of playing a game.

 

Finding the path.

Back when i made the Cheese fairy game i came across a buggy problem when using faceflip animation technique (also known as ‘Alpha Animation‘ ) combined with Pathfinding character scripting which allows for really dynamic Ai movement of an object.

Using the faceflip technique I created really nice animated hopping bunnies and combined them with pathfinder to achieve Rabbits that ran around stuff to hunt you down and pounced at you when close enough. Unfortunately the strange bugginess still remains meaning that the rabbits would disappear or not rez visible at all. Having monsters that could bite you but not be seen was unacceptable. In the end i chose to dump the faceflip animations in favour of the pathfinding since i could not have both. You do get to see the face flipping animation in the prize you win on completing the game.

RABIDRABBITPOSTER

Auto Attaching oddity.

Originally it was planned to have the HUD  auto attached on acceptance of a request dialogue box. I had done this before with the Cheese Fairy, T H E  W E L L and a recent update to the Evil Giant Zombie Worm Chainsaw massacre mini game. This time however something was preventing the HUD appearing when auto attaching. You could see in the inventory that it was attached and you could hear the sound from the story playing, but it just wasn’t appearing. To fix you had to UNattach then Reattach, which negated the point of auto attach. In the end i opted to give the HUD to inventory in a folder while i try and work out why the auto attach does not work with this HUD.

 

Matt completes the quest and gets high praise from the Goblin King

Matt completes the quest and gets high praise from the Goblin King

Experience more while doing less

So i gave it a good go and i think i almost have a solid base to start building bigger more complex games and stories, but there are still some annoying problems i simply cant work around. What i aim to do with my experiences is to allow users to experience more while doing less. I would love to tell a story without the user having to use their inventory or chat box. I don’t want people to have to rez objects or attach weapons and HUDs or accept requests in little boxes. I want to do that all for them so they can simply immerse themselves into the experience. I have hope that his final hurdle will be addressed eventually by the Lab once they finish what ever secret project they are working on.

CHECK IT OUT, ITS FREE!!

If you haven’t played the Rabid Rabbits game, please do so and leave feedback on my SL feed or here in comments. Nothing encourages me more than the response of those who play and so far everyone has been really positive which has boosted my confidence for future projects on Escapades, in New Babbage and at the forthcoming SL10B celebrations.

To Play Rabid Rabbits visit SLURL http://maps.secondlife.com/secondlife/Escapades/98/99/72

Also thanks to Matt who helped my brain stay on course with the scripting and Stella & Flo for doing a great job beta testing and uncovering countless bugs :-p