Thursday, January 17, 2019

New product : Env Box

Hi !

If you love shiny latex, and/or if you like taking photos in Second Life, you probably already own what is called a "reflection box" to enhance the shine on your suits or on any shiny surface such as metal or plastic.

This product, the Env Box, is meant to go one step further by providing actual environment maps that rotate around you to compensate for your orientation and make the reflection more realistic.

The Env Boxes (because there are several) allow to make the environment reflection go from this :


To this :


And from this :


To this :




The additional shine makes a real difference, doesn't it ?



This post is divided in two sections : the first part demonstrates the product and the second part is the actual manual.



Demonstration

There are many reflection boxes available on the market nowadays, from simple freebies to complex products. Some of them are subtle, others are very bright. Notice that I call them "reflection boxes" while the product I am demonstrating here is called an "environment box" ("Env Box" for short). There is a reason for this that I will explain now.

The Second Life viewer is, at the time of this writing, unable to render real-time reflections of the world around your avatar (*). So for now, when you want something to shine like metal or polished plastic, reflection boxes are your best bet because they project a picture onto your avatar, making the shiny parts "reflect" the projected picture.

It really is an improvement over the stock environment reflection featured by the SL viewer, but as far as I know, all the reflection boxes I tried out only project a single image in all six directions. This is not really an environment where you would expect to see different reflections depending on where you look from. In other words, none of them contains an actual 360° panorama, but the Env Box does.

It projects six different images organized like a cube in a way that there is no gap or seam between them, and those six pictures form a complete environment, hence the name "environment map" or "cube map" used by video games.

These images are 512x512 so they don't take too much video memory (1.5 times a 1024x1024).


What's more, it is able to rotate around you to always face the same direction, so that when you walk around and make a turn, the reflection on your body will actually rotate too in a realistic way.

For example, here I am facing North while wearing an Env Box :



And now facing West with the same Env Box, still worn :


Notice the shine changes, because the Env Box rotated clockwise to compensate and stay aligned with the North regardless of my own orientation. The two big white blobs of light on the latex are the reflection of the sun.


You can also drop your Env Box in-world and it will follow you, keeping its orientation constant so that when you turn the reflection turns as well.


Here are two videos of the "Gdansk" environment rotating around a sphere and around me (I'm wearing the KaS Corset-Dress in the second video, with an Environment value of 60 and a Glossiness value of 255 on its surface). These videos help showing the environment map in its entirety.



 


Notice that this environment is not the same as the one shown in the pictures above. This is because the Env Box contains not one environment, but 20 ! "Corsica" like in the first pictures, "Gdansk" like in the animated pictures here, and 18 more, one for every situation.


Some of them are bright, others are soft, some are fit to be worn outdoors and others indoors. All of the pictures were taken with brightness set to 20% but you can modify the brightness yourself with a click on a menu button, from 5% to 100%. All the pictures in this montage were taken in Second Life without any modification save for adding the names and putting them together in a single picture.

For "Panorama", "Corsica" and "Patio", I oriented the box in order to match the position of the sun in the "Sunset" Windlight setting, knowing that the box is able to rotate itself to keep its global orientation. All the other shots were taken with the "Midnight" Windlight setting, that's why they appear darker.

Some of the environments are marked "tintable" because they are not very saturated (like "Fireplace") or not saturated at all (i.e. in shades of grey, like "Georgentor"), which means that you can use the "Color" menu of the box to tint the environment yourself. Of course, you can tint any environment, but some react better to tinting than others.

For example, the first page of the "Color" menu gives you several colors like "Sunrise" (a light pink), "Sunset" (a light yellow), "Night" (a dark blue) etc. This makes it very easy to tint your environment according to the current time of the day in the sim. If the sun is setting and you are outdoors surrounded by buildings, choosing Bonifacio and tinting it "Sunset" works very well. If you are in a dark room with many red lights around you, choosing "Lights" and tinting red does the trick too.

Substance Painter and Substance Designer users will recognize "Corsica", "Gdansk", "Patio", "Bonifacio" and "Panorama" because they are some of the default environments featured in these two 3D applications.

Please note that since there is no LSL function to change the projectors via a script, this means that the product contains 20 objects, all identical save for the images they project. It is up to you to wear the one you want (only one at a time, of course), they all contain the same script and behave the same way.

A second product called "Environment Probe" allows you to create your own environments from SL pictures to make your own environment boxes and even sell them. With its Env Box Controller, you can even create Env Boxes for each room of your house and make sure only those with an avatar inside is active at any time, to avoid overlapping projections, even when a box is inside another box. The controller is also in charge of tinting the reflections according to the time of day, and provides many other ways to control the look of the reflections.



That is all with the demonstration of what the Env Boxes can do. You can find the product here on the Marketplace, since it is copy/no-transfer please try the demo first because no refund will be possible if you buy and don't like it, since you won't be able to return it (refunds are possible only for double purchases).




The rest of this post is the actual manual of the Env Box.






Manual

This section of the post explains how to use the Env Box.

First of all, to make sure you can actually see the projections sent by a box, you must turn Advanced Lighting Model on in the graphics preferences of your viewer :


It doesn't matter if you turn the shadows on or not.

Secondly, only surfaces that have an environment value greater than 0 can reflect the images of the Env Box (or any projected picture for that matter). For example, the "Env. sphere test (root)" object contained in the product has a white specular texture, 255 glossiness and 255 environment, which makes it reflect like a mirror, there is no blurriness. If the environment value is set lower, the shine is darker. If you decide to give it a "Low", "Medium" or "High" shine instead of a specular shine (what is called "legacy shine"), it will work too. But if there is no environment value at all (or no shine) and no legacy shine

For example, if the sphere is set to 255/255 with a white shine color, you see this :


It shines like a mirror. Notice the specular lights that come from the projection (you didn't see them in the pictures in the Demonstration chapter because I made the shine color black, but here I made it white to actually show them on purpose). Please note that unlike in the Demonstration chapter, I have set the brightness of the box to 100% instead of 20% to show how bright it can go.

If you decrease the Environment value down to, say, 50, you get this :



It is a lot darker (as if you turned the brightness down to 20%, since 50 is roughly the fifth of 255), and if you set it to zero you get this :



Well, this is interesting. You get no reflection except for the specular shine coming from the projections... with a color that is the average of the projected picture. In plain English, this means that if a picture is roughly blue (like the sky), its specular shine (one of the circular reflections you see above) will be blue.

If you lower the glossiness (the lower the glossiness, the blurrier the reflection), let's say to 80, you get this :


No reflection but blurry specular lights.

And if the surface has some environment value, then you get blurry reflections :

 

But... wait. What are those black gaps ?

They are the result of the surface not being fully glossy. Glossiness is like the inverse of roughness (if you're into 3D design, you must know that SL is not PBR but uses a spec/gloss shader instead of a metal/rough shader), the lower it is the more it blurs the projected pictures. Which is a problem because it also blurs the edges of the pictures, and that's why you get gaps.

There is a way to circumvent that though. The "Optimal Glossiness" menu of the Env Box allows you to close the gaps, literally. I will explain this feature below, when it comes to using menus. For now, see how it looks like with the "Optimal Glossiness" of the box set to 80 :


A blurry reflection with no gaps, as expected. This is very good for latex because latex does not actually reflect like a mirror, it is a bit rough and grainy so its glossiness value should be lower than 255 (I often use 150 to 200 personally).


Now... the bad news. I showed you that a surface needs to have SOME environment value to reflect the projected pictures, and it turns out that Maitreya does not have any. Zero environment value and no way to turn it up. I would really like Onyx LeShelle (owner of Maitreya) to update her popular mesh body to finally let us add environment to the skin, tattoo, underwear and clothing layers (ideally independently), like we can change the glossiness. Feel free to ask her if you want your Latex Catsuits to shine on your Lara mesh body !

There is some consolation though, the Env Box is not completely ineffective on a Maitreya latex suit. Let me show you.

In this picture, I am wearing a deep black MdlM latex suit on my Maitreya Lara mesh body, at midnight, with no light around me and no Env Box worn :


As you can see... well not really, you can't see anything at all.


Now I wear the Gdansk Env Box (ok, it is is a rather bright one, unfit for a night setting, but this is just for the sake of the example) :


It doesn't reflect on the latex, but at least it behaves like normal body lights with colors. It's not bad, but it's not an actual reflection either. If Lara had an environment value on its layers, you would see reflection.


Slink does have this ability though, so let me show you how it looks with it :


See the difference ? This is a Slink Hourglass body with the deep black MdlM catsuit applied to it, an environment value of 40 and a glossiness set to 75 (and optimal glossiness set to 75 in the env box as well to avoid seeing gaps in the reflection).

Here is how it looks at noon (I set the brightness of the box to 100% for this one) :


Now we're talking. Well, it shines a lot more than latex but once again, this is for the sake of the example. You wouldn't normally set the brightness so high, 20% is enough in most cases. The latex is supposed to be black after all, so the reflection should be dark. More like this :


Don't mind the black gloves, they're the Maitreya hands with the latex still applied. That way you can see the difference in shine between Slink (which has environment) and Maitreya (which does not).

Notice that the MdlM Latex Catsuits have a grain, they are not completely smooth, so it is normal that the glossiness is not set to 255. A value of 75 here is plenty, as you can see on this closeup :


But Slink also allows you to clear the normal map, which in the MdlM Latex Catsuits contains both the grain and the seams. Doing so makes the suit completely smooth, so when you do that you can set the glossiness to 255 (and change the optimal glossiness of the env box to 255 too to match and avoid gaps), and you get this :


No creases, no seams, no grain, it looks like a smooth latex skin now.


Now, don't get me wrong, this doesn't mean that Maitreya Lara is incompatible with the Env Box. This simply means that if you are wearing a Maitreya Lara mesh body, and you want to wear latex on it, you you will prefer wearing mesh latex rather than applied latex. For example, a KaS mesh latex dress like I demonstrated at the beginning of this post. I just wish applied latex also had the ability to reflect the environment.

One thing though : alpha-blended textures do not reflect a projected image at all. This means, in plain English, that transparent latex does not reflect reflection lights or the Env Box, unless it is set to Mask Mode (in which case the less transparent parts are fully opaque and the more transparent parts are fully invisible, this works well for stockings, gloves and bodysuits, less so for transparent or clear latex). This is a limitation of the SL rendering engine, there is nothing we can do about it I'm afraid.


The features

Now that everything technical has been explained, let me explain how to use the Env Box.

Firstly, as I pointed out above, since we can't change a projector texture through a script, there are 20 "Env Box" objects in the product. Each one is for a particular setting, some are indoors, others outdoors, some are soft and others are bright, some are tintable and others have built-in colors in them (but you can still tint them if you want).

This means that you wear one, and exactly one Env Box. You can wear more but it will only make the reflections look messy.

The rest of this manual explains the different menus and features but you don't need to know any of this to make your Env Box work, the default settings are more than enough for most users.


Getting the menu

When the box is worn, you can access its menu either by touching it or by saying on the chat :

/456 *

or

/456 env

The channel to access an Env Box is always 456 and you can only access your own Env Box. Each Env Box has an internal prefix, which is "env" by default. If you change the prefix of an Env Box, you access its menu by typing its prefix on channel 456 instead of "env". Saying "*" on channel 456 always works but you may get several menus if several Env Boxes are around.

The menu you get looks like this :


The "Active" switch turns all the lights of the Env Box on and off. It also stops the "follow" mode (see below) when inactive. If your Env Box is inhibited by an Env Box Controller (an object that controls all the static env boxes in a place, and when you enter one of them your Env Box is turned off temporarily) and for whatever reason remains inhibited even after you leave the Env Box Controller's influence, simply turning this switch off then back on will clear the inhibition, as well as TPing, relogging or detaching and reattaching your Env Box. Please note that your Env Box must be v1001 or above to get that feature. If it is v1000, you should update (see the end of this post to know how).

You can see the prefix mentioned on the menu.

You may argue that it is difficult to click on the box since it is nowhere to be seen. In fact, when invisible, it looks like this with "Highlight Invisible" mode on (that's Ctrl-Alt-T to highlight invisible surfaces in red) :


That's the small rectangles floating around your body.

If you set it visible in the Options menu, you will see the whole box :


Notice that the box is partially under the ground, this is for two reasons. The first one is that it can light your feet from below, and the second one is that it hides the lower parts nicely when the box is not visible. That way it is unlikely you will click on it by mistake.

Please note that the prims are alpha-masked, fullbright and their texture is invisible. As a result, they do not project shadows and do not interfere with alpha-blended textures on your body or in-world.

Lastly, the box is worn on "root" (a.k.a. "avatar center") because it should stay upright regardless of the rotation of your avatar. If it were worn on any other attachment point, it would rotate and change position as you walk, sit etc. You don't want that so it must be worn on root.


Worn/Rezzed, Follow Mode

Any Env Box actually works whether it is worn or rezzed in-world, and behaves similarly in both modes.

By default, when it is worn, it rotates around your body to always face the same global direction. When it is rezzed in-world, it does not rotate but follows your position while you are in the same sim. By default, if you leave it there, it derezzes after an hour of inactivity.

You can change this behavior in the "Rotation" menu :


If you switch "Follow" off, then if the box is worn it no longer compensates for your avatar's orientation (making the reflection less realistic, looking like the world revolves around you... but it doesn't, does it ?), and if it is rezzed in-world it just stays where it is, it is said to be "static".

If you click on any of the directions you can set an angle for the box (absolute if "Follow" is on or if the box is rezzed, relative to your avatar if it is worn and "Follow" is off). By default, the "Front" prim is oriented towards the North (that's 90° because trigonometry).

The "Walk back" switch depends on your Animation Overrider. Most AOs will make your avatar face the camera when you walk back (using the down arrow key), but some don't and make you walk backwards like Michael Jackson. If you use one of the former, keep "Walk back" on, otherwise turn it off.

For technical reasons (more like an SL limitation), if you are in Mouselook and sitting on something, for example a vehicle, the Env Box won't rotate at all because it cannot tell the rotation of the prim the avatar is sitting on, and its own rotation is superseded by the orientation of the camera when in Mouselook. Maybe I could fix this later, thanks to the "@getsitid" RLV command, but since the Env Box does not require RLV to work at all, and given its script is already quite big, I don't really want to add a feature like this.


Brightness

The "Brightness" menu allows you to set the brightness of the whole box (i.e. the "intensity" factor of all 6 projections) :


There is not much to say, except that the brightness is 20% by default ("0.2" in the text on the menu). SL is not PBR (Physically-Based Rendering, an advanced technique of shading surfaces), so it is up to you to choose the appropriate brightness according to where you are and what you are wearing.

For the "Stars" and "Lights" Env Boxes, I recommend you turn the brightness all the way up to 100% because they are actual lights, so they're supposed to be bright. Of course this is your choice entirely.

"Tokyo" looks good at 50% brightness because it has a lot of lights too.

A good rule of thumb is, if the Env Box features direct lights, its brightness can go up depending on the intensity of said lights.


Color

Being able to tint your Env Box is a nice feature, because it lets you adapt the reflection to the ambient light. Not all places are lit with white lights, some are more intricate than that and some Windlight settings are created to set a particular ambience. Even the four default SL times of the day light the scene differently.

This is why you have a "Color" menu at your disposal :


This menu lets you pick a predefined color or set your own with the "CUSTOM" button (with which you can enter either a RGB value or a vector value). The first page of the menu features the most common colors you will want to set your box to, depending on the ambient light in the sim.

For example, here is me with an Env Box that is not tinted (or more exactly, tinted "White") in a sunrise setting :

 

It does not look bad, but I think it looks better if the Env Box is tinted "Sunrise" :


It is also a good way to tint the tintable indoors environments such as "Fireplace", "Georgentor" and such, because they are weakly saturated or not saturated at all (i.e. they have little to no colors in them) and you want to reproduce the average colors of the walls around you.

Another nice feature is that if you tint the box manually with the SL tools, it will detect the color change and apply it to the projections too. That way instead of clicking on "CUSTOM" and having to guess the RGB values of the color you want, you can simply use the SL tools and set the color with their UI, it is much easier that way.


Size

You don't normally need to change the size of your Env Box, which is 2m x2m x2.5m by default. However, there are cases, for example when lying on the floor or in a bed, where you need a bigger box because otherwise some parts of your body are simply not lit.

The Size menu helps you do this :


There are two caveats to keep in mind though.

Firstly, if your box is smaller than 2.5 m (which is the case by default), it is not a cube because its height remains at 2.5 m and won't go smaller than that. This is because otherwise your standing avatar would not be lit entirely. The effect of this though, is that the reflection is deformed, stretched upwards.

Secondly, if your box is wider than 2 m, it will shrink if it is too close to someone else (down to 2 m) so you won't impose your own reflection onto others. And others using this Env Box won't impose theirs on you either. However, someone who is closer than 2 m away from you is likely ok with having your Env Box shine on their body, that's why the box won't shrink smaller than that.

This means that the box activates a repeated sensor if its size is 2.5 m or more. It is not a heavy sensor, it won't tax the sim as it pings once every 5 seconds, but it's better not to use any sensor at all.

Personally I  recommend leaving the size to 2 m when worn. When rezzed in-world and made to follow you, making it 3 to 5 m is good because otherwise, depending on the sim, you may walk out of the box before it catches up with you, despite its fast timer.

Full disclosure, when "Active" and "Follow" modes are on (which is the case by default), the timer is active and checks your position and rotation twice per second. When it detects a change, it speeds up to 20 times per second to follow you as closely as possible, and slows down again when you stop moving or rotating. The tests showed that this does not increase the avatar's script time significantly, your AO is heavier on the sim by an order of magnitude.


Prefix

This section remains empty for now but the prefix can be changed in order to control one Env Box at a time, in case you have several of them rezzed in the sim.


Optimal Glossiness

I brushed the subject earlier. In a nutshell, the glossier a surface, the crisper its reflections. The less glossy, the blurrier the reflections. Problem is, the reflections are six different textures, so their edges are blurred too and making the surface less glossy therefore creates black gaps between the images.

To address this, you have an "Optim. Gloss." menu :


Simply set it to the same (or roughly the same) glossiness as the surface you are looking at, for example when taking closeup photos, or the one you feel is most important not to show gaps or overlaps. The closer to 255, the more precise it must be. For example, setting the optimal glossiness to 255 while the surface is at 254 will show gaps clearly, while setting it at 80 while the surface is at 75 will barely show any gap.

If the optimal glossiness of the box is lower than the actual glossiness of the surface, you will see overlaps rather than gaps. Images are projected overlapping each other until you correct the optimal glossiness

Some Env Boxes such as "Stars" or "Lights" are very dark on the edges so you won't really notice gaps, which means setting an exact optimal glossiness on these boxes is less important than on realistic bright environments like Gdansk or Panorama, which are supposed to be seamless.


Options

The "Options" menu allows you to tweak the Env Box :


"Visible" lets you show or hide the box, as showed above.
"Defaults" sets all the parameters back to default.
"Alone=derez" (sorry for the caption, I did not find anything clearer and shorter than that) means that if you leave your box alone while rezzed in-world for an hour, it will self-destruct. If you turn this switch off, the box will simply become static, it won't follow you anymore even if you come back, until you reactivate "follow" in the "Rotation" menu.

Finally, "Delete scripts" deletes the scripts, as the name implies (except that there is only one script to delete). Attention, if you do this you won't get any menu or any control anymore, and the box won't follow, change color or anything, it will become an unscripted object.

By the way, there is a small issue with the "Delete scripts" button. It gives you a text box asking if you are sure, it should be two buttons instead. If you type "YES" (in capitals), then the script will be deleted, otherwise it will be ignored. Type "NO" to return to the "Options" menu. It's a silly bug, I noticed it only after the release, and I will fix it later.


Updating your Env Box

I will probably keep working on this product and deliver updates to it in the future. When this happens, I send a notice to my group (RealRestraint Updates & Support, you can join for free) and you can then update your box.

To do this, simply rez the update orb contained in the folder somewhere near you and wait. You will receive the new product shortly. Make sure you are not in "Do Not Disturb" mode or you won't see the delivery. Leave the orb alone, it derezzes itself after 20 seconds.


Have fun !
Marine

(*) There used to be an attempt at rendering Screen Space Reflections a few years ago but it was shelved. There's actually one real-time reflecting surface in SL though, and that is the SL water. You can create a mirror with but it is cumbersome and only useful for photos, not for everyday use.