Friday, July 18, 2014

New project, new technology, more fun !

Hi there,

Let me tell you about a project of mine that I've been brewing in my head for some time... And recently I have made the whole tool chain that allows me to realize it. Now... I could get all technical on you, but instead I'm going to shake my butt.



Do I have your attention now ? I mean, really ? Okay. So as I was saying, this tool chain allows me to -- hey, you there, will you stop staring at my butt for a minute please ? Thank you. With this tool chain, I can process a video into animated textures that I upload back into SL and -- what, again ?! Okay, I knew it was a bad idea. I give up, I'll show you what I mean with videos :p Right now, if someone took this video and somehow turned it into an animated texture, the resulting texture would look like this :
As you can see, it is a mosaic of frames organized so that SL will play them one after the other, from left to right and top to bottom, at a pace fast enough that you have the illusion of movement. If it were uploaded into SL, it would look like this :




Pretty blurry, isn't it ? This is not surprising, the video lasts 30 seconds and was shot at 10 frames per second. This gives 300 frames, decimated down to 256 frames, so that the texture is exactly 16x16 frames (a square is a better choice so we don't have any stretching). Since the maximum size of a texture in SL is 1024x1024, the math is simple : each frame is a small 64x64 thumbnail. Stretched up to fit that square you see in the video above, you can see why it is blurry. And that's why you don't see many animated pictures in SL, except for controls and the like, stuff that doesn't need a high resolution and a big number of frames at the same time. But you don't see good looking videos unless you use media, which means your viewer connects to an external video (YouTube or whatever), and then all bets are off. You don't have any control over what kind of url your viewer connects to, the url could be potentially malicious. None of this happens with animated textures, since you are only looking at harmless textures inside SL. If you don't want to give up too much detail nor too much smoothness, you have two options. The first one is to cut the time frame of the video into several short clips that are to be played in succession. This is all well and good and makes sense, but unfortunately, playing videos is a viewer-side feature, while the switching from one part to the next is the responsibility of the script telling the viewer to play that video. In other words, both will never be synchronized well enough, there would always be a slowdown or a pause between two parts of a video. The second option, the one I chose, is to cut the screen itself into parts, in 2x2 squares, 3x3, 4x4 etc. That's what my tool chain does and when it's done, it creates a bunch of textures that I just upload back into SL. Here is how the video looks in 2x2 (that's the exact same AVI file you've seen at the beginning of this post) :



It's much crisper already, but I can do better. Look at it on a 4x4 :



Now we're talking. You can see each piano key for example. And no I am not showing myself on the videos because of a sudden case of inflating ego... but only to show you that this is SL, and the scale of the TV compared to an avatar :p As you can see, this 30 seconds video, shot at 10 frames per second, looks a lot better on a 4x4 screen (that's 16 textures of 1024x1024 each, instead of only one) than on a regular 1x1 square prim.

There are seams between the different squares, but that's due to how SL stretches small textures (since each individual frame is still small), it blurs it, I can't do anything about that. The texture itself is crisp without any blur, I saw to that (you can check in the animated texture above in this post that there is no blur in it).

You must be thinking, where is she going with all this ? Well now that you understand the technical stuff (and that I've shaken my butt enough), maybe you can see the possibilities of such a device. First of all, the TV itself that you've seen on the videos above is fully working and can display a video on a 1x1, 2x2 or 4x4 screen. It also adapts the dimensions to the specified dimensions of the video or picture (because it can display static pictures as well, even multi-part ones) so that they don't look stretched. It plays a playlist received from the decoder (which looks exactly like an old VHS tape recorder), which itself receives it from a VHS tape. And that's where it becomes interesting : the movie producer (Yours Truly for the moment) shoots a video into an AVI file on the hard drive, then processes it through the tool chain I made, then uploads the resulting pictures into SL (automatically named so the SL scripts understand that they are in fact one single video, and the parameters such as the speed, the number of frames and so on). So far so good. Then they insert the pictures (without changing anything to the names) into a VHS tape, which calculates a playlist out of it. Then, once the tape is inserted into a decoder, the playlist is transferred to the decoder, which in turn dispatches it to all the connected TVs. But the textures are never transferred anywhere nor to anyone, the tape deletes them before they can be taken out. Everything is encrypted so the data are safe.

For now the tool chain I made is pretty difficult to deploy (it uses 4 different tools, all freeware, that need to be installed on the computer), so I will keep it for myself for a moment. Plus I must make sure it works perfectly, it's still a little rough around the edges. But I can at least start the fun part of the project : Producing erotic SL movies !

Think about it : nowadays we've got a lot of good looking furniture with gorgeous motion-capture animations for solo avatars, couples, threesomes and even more. Those animations can take up to 30 seconds so we need the best resolution in order to render them into SL as animated pictures without looking dull. We've had erotic SL comics, now we'll have erotic SL movies !


I know it sounds silly and all, but isn't every new technology used either for war or for sex first ? Sex and war are what make the world turn !


In all seriousness though, this technology isn't going to be used for eroticism only. It has actually nothing to do with eroticism, it's just a video recorder and player. I will produce eroticism because everything I touch turns to kink, but it will be great for in-world demonstrations, fashion shows and the like, without having to rely on videos on external servers (which, I repeat, always contains a part of risk, whereas with animated textures you're safe, since it stays within SL).

I will be more than happy to share this system once it is mature enough (no pun intended), but it is still a bit early for that. What I will do first is produce a few good videos with friends, for once mixing business and fun because I will create an SL "company" for it (I have yet to decide the name but it will probably be a silly one), sell tapes (for a small price) as well as the TV with its decoder (for a small price too). Then, if all goes well, I will probably hire more actors and actresses to produce more videos, but I don't know how many yet. What I do know is that the processing of such videos will be the bottleneck of the whole production, and with the amount of work that is awaiting me for the next months, I can't afford shooting videos to take more than a fraction of my time. In other words, I'll be part of this business only for a limited amount of time, after which I will probably write an API of some sorts and release the scripts (not as open source since the protocol is encrypted, but free to distribute nonetheless), as well as release the tool chain and explain how to make it work. I do want high resolution videos to be part of SL !


Of course, you know the drill : no ETA, I'm just stating what I am working on. And shaking my butt :p

Marine