soledad penadés
repeat 4[fd 100 rt 90]

Archive for the ‘xplsv’ Category

20080516 Escena.org invtro v2

This demo was released at Inspire, a new demoscene gathering held in a small town north of Spain, with the aim of promoting escena.org, the spanish demoscene website. There was already another promotional demo done by elerium core in 2001, but I thought it would be interesting to have a newer one to kick things off.

Scene 1

It is very, very calmed. I had thought at the beginning about doing something very demoscene-ish, just as the previous promo demo was, but then I found myself not wanting to redo yet again the same old school effects, and headed towards something a bit more abstract. Then I remembered about eb7m's 3400 miles below and suddenly lots of ideas came to mind!

The tech stuff

The biggest change compared to previous demos which I've coded is that I used a scripting engine instead of writing everything in C++, and recompiling every time I wanted to change a parameter. For this I've finally used Lua, after considering Ruby and Python. The nicest thing about Lua is that it is really easy to embed. If you want to embed Ruby or Python, it's a completely different (and long) story, but with Lua you just build the library (with a nice makefile which they provide already and just works™) and link to that library in your project, and that's it. You can then create as many instances of Luas as you want, and they won't interfere with each other. In my case I just use one, which loads and executes the demo script (demo.lua).

The second nicest thing with Lua is the way in which you pass parameters between C and Lua. It is very simple, with functions such as lua_tonumber, or lua_tostring; if you compare with Python for example, it is way more verbose.

In the demo script you can access several functions which I created in C and exposed (registered) to Lua. So for example, there's a function for loading a song in C and once I say to Lua: hey, there's this function in C that you can use!, you can write loadSong("filename") in the script and it will end up calling fmod through the C function.

The syntax and function naming is highly inspired by Processing's syntax, although I still want to change a few details and remove some functions which end up doing the same, so that there's only one way of doing things and it's minimalist, as Lua is.

This was also a bit of a benchmark for Lua, so instead of using the typical Vector3D, Face and Mesh C++ classes I decided to implement a reduced subset using Lua's metatables. Even normals are calculated using Lua's math library! Considering the insane amount of stuff which is going on there (I basically increased the number of things such as particles, terrain segments, etc, until the frame rate began to be a little bit jerky), I think it performs very decently. Next step would be to optimise what is sent to opengl, since currently not only everything is drawn in immediate mode but also nothing is culled at all.

Scene 2

Why does it look like that?

Some weeks ago, trace was joking about the lack of texturing of any kind in my demos. I said I would try to use some texturing next time, but as it happens, I thought it would be more funny to play with lights. Yes, I think it's the first time I use lights in a demo. Well, a light. Since the song's title is 3400 miles below, I thought of building something like an underwater world. A very deep one indeed, since sun rays do not even reach that depth, and so any ship which wanted to explore that area would need to use their own light - hence the light is needed for illuminating where we are looking at ;-)

I first built the ground. Initially I thought about calculating an evenly distributed matrix of points and then randomize the heights so that they formed something such as a terrain, but it looked too usual - so I broke some things here and there and that's why it looks as if the tiles are misplaced.

Then I wanted some kind of life in there. But life in very deep waters doesn't resemble the usually depicted fishes. It's more about strange entities, and so I thought of those strange spiders which are in the scene. They are simply there, waiting for something while their legs oscillate.

But it was still too plain. I went too creative and added some plankton, which actually is quite wrong (plankton isn't present at that depth). The plankton is abstracted with those little triangles which go up. In fact they shouldn't go up but down, since they are created and fall from above, but in this case they contribute towards the how odd, things are moving upwards feeling.

In the quest for making it a bit more sinister and mysterious I also added fog. I think it's the first time I use fog too! It was a black fog so that colours got even darker with the distance.

And then I began with the particles-text effect. I didn't want to load and analyze a bitmap to find out where the points were, so I remembered about those naive drawings we did with PRINT in Basic, and did this:

escena = {
        "XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX    XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX",
        "XX      XX XX         XX         XX      XX XX      XX         XX    XX      XX XX         XX        ",
        "XXXXXXXXXX XXXXXXXXXX XX         XXXXXXXXXX XX      XX XXXXXXXXXX    XX      XX XX         XX     XXX",
        "XX                 XX XX         XX         XX      XX XX      XX    XX      XX XX         XX      XX",
        "XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XXXXXXXXXX XX      XX XXXXXXXXXX XX XXXXXXXXXX XX         XXXXXXXXXX",
        "                                                                                                     "
        }

which is a table with strings. When loading the demo and preparing the effects, I go through each string and if there's an 'X' I store a new point in the list of particles to draw. Actually, I created several particles for each point so that the fountain of particles was a tad denser. Then in each frame they move a little bit towards their final destination. To make it more subtle too, I made the alpha dependent of the height, so that transparency decreased with height.

The problem was that everything was still too evident. Something else was needed in order to hide stuff and avoid showing everything from the beginning. So that's why I added several randomly sized but circularly distributed meshes around the center of the scene. They even look sort of kryptonitic to me!

And why is everything green? Because our ship has only got a very old green phosphorus monitor, so it can only display things in green shades. Apparently ;-)

Scene 3

Source release and other builds

I intend on releasing the source code soon, once I decide which functions go away and which ones do stay. It is only a few source files and it's built with C and some bits of STL so it hopefully should be quite easy to understand and follow, even if you just want to see how to connect Lua and C.

I also need to fix a couple of details, such as the universal libraries issue that I found at last minute, and changing to the data directory in non mac builds (in mac, it automatically changes to the data dir inside the Resources folder), etc. At that point new builds should be available for something else than Leopard.

I was also thinking of replacing fmod with a free alternative, but I have several problems: it seems there isn't a decent, open and easy to integrate module player library (other than fmod and bass, which doesn't work in linux), and libvorbis is quite heavy for what I want. Suggestions welcome :-)

Thanks

Of course big thanks to Pplux for his awesome explanation about how the stack in Lua works. That was all I needed to take off!

I'd also like to thank Corsario for offering his computer as compo machine, and trace for the hard work in his inspire demo - it encouraged me to finish this one on time :-)

And finally thanks to Inspire organizers for all the enthusiasm they have put into this new event. Let's hope we can release lots more of demos in subsequent Inspire editions!

20080128 xplsv.tv embedding!

There's a very interesting new feature here at xplsv.tv: video embedding!

If you love a movie and want to demonstrate publicly, just grab the embed code in the movie page and paste it in your homepage :-)

For example, here are two demos I love:

Isn't it cool? :)

20060918 Bugfixing, refactoring and improving xplsv.tv

We did a quick visit to NetAudio London on Friday; it was also the first time I went to Angel, and it's way posher than I thought (I was kind of expecting a devastated party area with lots of alternative artists and Bansky-was-here or Mind-you-this-is-not-a-Bansky everywhere, like Old Street).

And after that and some well-deserved eight hours of sleep, came an intensive week-end with xplsv.tv - but we are still not finished with it. I thought we were going to advance more but I was wrong.
So far, most of the work I've done is focused on the motion management. Apart from refactoring lots of code, I have fixed a couple of little bugs, some serious ones, and also added some little enhacements which I believe every artist in xplsv.tv will love when we move these changes to the live server, as they increase the usability of the motion management area.

It's been really delicious to replace all the "rude error messages with an exclamation mark at the end" with something a bit more human and nicer. By the way, I still don't understand why did I enter all the messages like that, and I don't understand either why most of the non-english native speakers tend to write errors messages in that very manner. To my disgust, I have noticed it repeatedly these last months; maybe it has to do with the fact that (luckily) my english level has improved (or that I think).
Some examples:

  • You must enter the title of the motion! becomes Please enter a title for the motion
  • You must be the creator of the work! becomes Please confirm you're allowed to publish the motion here

Obviously if you're an artist in xplsv.tv and have any suggestion, you're more than welcome. (I could put funnier messages, like Hey dude, do not forget the title! but I am trying to be serious :D ).

I also experienced one of the joys of refactoring: things work better with less lines of code. I love that.
Meanwhile, mr.doob was working in the motiongraphics TV, and he made live a new version of the tv. Now you can resize it to suit your tastes - and this has made him feel the desperate urge to encode again the videos so that they have a better resolution. And if you like the new TV, do not forget to vote for it at digg! (yeah, let's do a bit of self-promotion, just for once ;) )

20060503 The making of "tube"/xplsv

tube screenshot

Getting the right music, and the right inspiration

Some years ago, in the almost already forgotten summer of 2003, trace sent me a test of a song he was making. If I remember properly, it was called B04.IT, and featured the characteristic samples one can get using fuzzion's 4k synth. Actually, it reminded me a lot to the music of "insert coin", by fuzzion & threepixels. I think trace did the song for using it in another intro, but it was forgotten.

And some months later he passed me again the song but it was B05.IT then and it had more stuff - almost finished! It had passed through sml's and wizard's ears too. This time I really liked the song and thought that I wanted to do something with it, although I didn't know yet what exactly. So I just converted it to mp3, copied it to the ipod and let it appear whenever the random mode decided. One day while I was in a Circle Line train, entering Moorgate station, the song was playing and I had something like a vision, when I saw the platforms along with the signs, the sensation of movement that fitted with the song and its somehow agressive feeling… and I decided that I would do something related with the tube!

Then almost a whole year was spent developing something to be able to do the demo, as I switched to mac, and also wanted to do demos in a more decent/cleaner way that I was doing until that moment. And finally as I got the tickets for Breakpoint06, I decided that I definitely would do the tube demo for BP06, as I knew that it would rock big time to see it on the bigscreen.

At the beginning I thought of alternating 3d scenes with the 2d animations that I was going to put in there, but since I didn't manage to get a decent port to opengl of neonv2's graphics engine, I just set apart that idea and concentrated on getting the best animations I could get.

How to record in the tube (without looking suspicious)

That part was really funny. I borrowed trace's camera, which is way more discreet than mine, and the 1GB memory stick he got for his PSP, and just headed towards the tube on a nice sunday evening.

Why I chose sunday and not any other day of the week as it would have been more representative of the real stress of the daily commuting it's relatively simple: when there's so many people you would have seen only the first row of people and maybe think that I was taking pictures in a protest march. So that's why it just shows half empty trains and stations.

With that camera it was relatively easy to take pictures as it is quite small and doesn't do any noise when switching it on (in contrast to mine!). So most of the time I just walked as if I was going to take a train, with the camera in my hand - and recording it all!

I also wanted to be discreet not because of the passengers, but because of some news I had heard about people being arrested and their camera confiscated just when they were shooting pictures in tube stations. Just in case they were evil terrorists and were getting information of how the station was. For destroying it according to the plans. You know!

The worst of all was when recording the final part, which is actually how the Central Line trains enter Bank from Liverpool Street. I had to redo that one like three times because it didn't got recorded properly. Either bad angle, not looking good enough (the train stopping at the entering and somehow destroying the speed sensation, etc). So I had to change to the opposite direction and turn back to Liverpool Street again, and cross the fingers so nobody in the control room could notice a girl dressed with a blue electric jacket entering three times the station, and taking the train of the opposite platform three times too.

Imagine if they had asked me:

- What are you doing?
- oh just recording some movies for breakpoint 06 demo compo
- a compo!! it doesn't sound right! it sounds violent
- errrrr….

I also arrived until the ultramodern Canary Wharf station (where some movie was shot, if I'm not wrong) and took lots of pictures there, but they didn't fit at all in the demo. Apart from the "severe delays" pictures, everything else got discarded as it wasn't dynamic enough. It was so empty on a Sunday!! One can't appreciate any movement sensation if there's no reference point, like people, etc. Oh and it was so damn cold in Canary Wharf! I had to put my hat on while taking pictures of the outside…

Most of the moving images are from Victoria and Westminster stations. I missed lots of footage video as I thought that I was recording but actually I hadn't pressed properly the button. So novice!

Locations - for the map/tube addicts

Tube locations
So finally my travel consisted in:

  • Victoria - Westminster (with the District line)
  • Westminster - Canary Wharf (Jubilee Line)
  • Canary Wharf - London Bridge (Jubilee Line)
  • London Bridge - Bank (Northern Line)
  • Bank - Liverpool Street, and Liverpool Street - Bank, three times (Central Line)
  • Bank - Oxford Circus (Central Line)
  • Oxford Circus - Victoria (Victoria Line)

and not it didn't cost me much money since I just went out the tube itself in Canary Wharf for taking pictures of the skyscrappers :)

Coding horror

Then we have the nightmare the day before the party. I had let until the last moment the step of doing a final test in my pc. (I developed it in mac as I said). Horror happens and it happens more specifically the night before, when tired and almost aslept you get to test your demo in trace's laptop and then discover that everything turns white. ARGH!!!!!!!!! It wasn't even a black screen, it was all completely white. I just said ok … I'm going to release it in the wild compo, I don't care if they don't accept mac entries in the demo compo, I want to sleep. And I absolutely did.

I suppose a real coder would have stayed all night trying to find out which was the bug but as I'm not a real coder I just let the pillow give me some advice. Of course, the next morning I hadn't thought of any solution for the bug yet. I even didn't find anything until for some reason I ran the demo in fullscreen in my mac and WTF!!! it was WHITE!! What was happening there?

Well it was actually quite stupid. I did some very basic filters, reading from the current framebuffer and manipulating the data. But just some filters used one code I saw in one page which said: glRead(GL_FRONT);

I simply had sticked it in my code without noticing any performance difference, so I just let it be there. Buuuuuut that was a very bad and irresponsible idea! Depending on the graphic drivers, the FRONT buffer had something - or not. In my old pc it didn't make a difference, but in trace's it made everything go white. And I don't know why, I hadn't tested the faulty filters in full screen in my mac. Maybe in fullscreen the opengl gets like a different context or something like that (I don't have any clue, I must recognize), and that's why it showed different results when running in a window or in fullscreen.

I proceeded to remove that code from every place where it appeared and voila! it was working perfectly fullscreen on mac! Then Corsario/tlotb offered to help me to compile a win32 version - and hence release the demo in the demo compo.

Forget libc

I used visual studio 6 in my old pc. It worked pretty well - apart from thousands of warnings from the STL, of course. But Corsario had Visual Studio 2003 and Visual Studio 2005. He said it should be ok. Of course, it wasn't. There was some kind of funky incompatibility with the headers that my project included and what MSVS2003 decided that was ok. Basicly they had deprecated (and removed) libc!

But Corsario managed to identify which of the libraries introduced the libc dependency and replaced it with a compatible and appropiate (for VS) header. And oh it worked quite well! :)

The remaining was simply a question of putting the nice layers that trace gave me in a more or less meaningful order, and syncronize things a bit. Also, trace convinced wizard to do another pattern for the song so it could get a bit more polished. So we had another star in our team!! :D
As you see, it's very easy to do a demo! You should do one too!

20060408 neon v2 public release

Neon v2 main interface

So I am the last one in writing this, after all the announcements in different places such as vjforums, dmstk, xplsv.com, xplsv.tv, pouet.net, escena.org, trace's blog and only-God-knows-where-else, encouraged by all the people which has arrived to my blog looking for "neon v2 download", "neon xplsv" and so on. No need to worries, people, you can now download it for free and use it in your own VJ sessions.

All the information in neon v2 official website. I'm looking forward to see what people can do with it!