Archive for the 'General' Category

#musichackday 2012: app for iPad

Saturday, June 16th, 2012

This has been the thirth edition that I have participated in the MusicHackDay, a 24 hours coding competition, usually endorsed by famous musical technology companies (like Spotify, Soundcloud,…).

The MHD its a fantastic event, very well organized, where you can meet great people, code cool things, learn new technologies, and win some prizes during 24 hours, and all for free!

My good friend Marcos and I made this app for the iPad using the Freesound API that let you access to all the samples’ info stored in their database, even provides links to download those samples.

Click on the image to see more screenshots

Click read more if you want to know how it was done. (more…)

WebGL and Firefox/Chrome

Tuesday, April 17th, 2012

Developing web applications has been always annoying regarding the browsers difference interpretation of the what is standard and what not, thats the reason why I stopped developing for IE. At least Google and Mozilla are serious about the standards so 99% of the code I develop for Firefox (my default browser) works in Chrome as expected. Kudos for both of them.

They have their own extensions but they are for more experimental features. Regarding to what functionalities to support, they both follow the same standard and thats great.

But when it comes to WebGL, although they both follow the same standard, the implementation is a little bit different.

That means that the performance it is not the same between both browsers under the same circunstances, and that is a problem, because there is no way I can see what is the browser doing (besides downloading the fullcode…) so if the performance is unstable I feel I reached a dead-end.

I dont mean that one browser is more optimized than the other, my issues are more about how some actions cost more to one browser than the other.

My current application runs much more smoothly in Firefox than in Chrome, but Firefox loves to purge the Garbage Collector every 10 seconds freezing the application for several seconds, which makes it totally unfriendly. Chrome on the other hand is more stable but the frame-rate drops sometimes just by adding a tiny mesh to the rendering process.

Chrome also do not like negative values for the viewport (I can understand that) and show some weird results when stretching a texture too much (¿?), looks like an undocumented bug with the magnification filter.

It makes me reconsider if WebGL is the perfect platform for 3D applications and games.

Ludum Dare 22: Alone in the city

Monday, April 16th, 2012

Me and my girlfriend participated on the Ludum Dare 22 competition about making a game in 48hours. After the total failure of the GGJ11 we wanted to make something more simple. The theme was simple: ALONE

I wrote a post-mortem about the game on the official blog, you can read it here.

(more…)

Global Gamejam 2011: Things to remember

Monday, April 16th, 2012

I decided to participate on the Global Gamejam 2011 at Barcelona with three of my best friends.

We make “something” that barely can be called game, but it was fun. You can try it here:

The game has no gameplay at all but the atmosphere is cute. You just walk around a city and if there is more people logged to the game you will see them. Thats all. We wanted to force the people to interact between them somehow, but we never made it.

You can read a small post-mortem about it following this post.

(more…)

Solution: WordPress problem uploading images

Thursday, September 16th, 2010

I spend half an hour trying to find the solution to a problem related to WordPress, and nobody on the Internet seems to have it, so now I had figured it out I have the duty of post it so others can take advantage.

After installing WordPress on my server I wasn’t able to upload images using the admin page, it said something like “The uploaded file could not be moved to …” (“El archivo subido no se ha podido mover a …” in spanish).

It looked like a privileges problem, so I gave to all the folders the rights to read and write (you can do this from your FTP Client, right click on the root folder and search for Atributes or Permissions and set it to read and write to all users), not the safest solution but it should work.

But it didnt. I realized that the uploads folder of WordPress “wp-content/uploads” was created by Apache, not by my user, so that was the problem.

I deleted the folder /wp-content/uploads which was empty, and create it again using my ftp client, problem solved.

WebGL: Day 1

Thursday, July 8th, 2010

I like to code in OpenGL, andI like to code javascript, and now WebGL allows me to do both things at the same time!.

WebGL is a Javascript binding to access all the OpenGL ES features right from the browser. The idea is not bad, it allows to create true hardware accelerated 3D apps embeded on the sites, and it blends perfectly with the rest of web technologies (like HTML+CSS, Ajax, etc).

Unfortunately WebGL is not mature enough and It is kind of hard to start even for a experienced programmer.

The first big problem I found is that Javascript was never meant to be used with binary data, and 3D graphics needs binary data to save all the information (textures, meshes). WebGL can do the ugly work to convert from regular non-typed arrays to low-level streams, but sometimes it is confusing, or just it looks slow, and hard to optimize, but if we agree that a 3d app in a browser is not meant to have Crysis quality we can keep going.

Usually working with OpenGL from scratch tends to be annoying, because there are lots of actions you have to do to create and transform simple things like meshes or textures, things that usually are wrapped in classes to speed up the developing process, and here we have the non-binary data issue that can make the wrapping harder.

For starters all the geometry calculations (projections, transformations, vector operations, etc) should be coded from scratch because JS libraries tend to be focus on HTML and web interaction, no in 3D. Now with WebGL some libraries are emerging for 3D calculations but they do the calculations in JS, which is slow for intensive computation.

Also JS doesnt support operands so you can do V1 + V2, you end up with sum(V1,V2) which is annoying for long formulas.

So thats when you realize you are touching the limits of the technology, JS was never meant for this and WebGL wont solve this issues, it is just a wrapper of a library.

Anyway, I decided to switch to a framework build uppon WebGL, because working straight to WebGL is slow and tedious.

So I chose SpiderGL as that middle-ware, and it looks nice but it is not documented at all!!, gaaagh. I have to read the source code to discover most of its usefull features, and found some bugs too…

But after sorting all the problems, it works, I have coded several shaders, do PostFX in scenes and some intensive mathmatics and it looks nice in a browser.

Sadly I havent figured out how to export meshes in a binary format…

Anyway, If I have time I will upload some of the examples I coded, but remember that you need a WebGL capable browser.

Previously on 2009

Sunday, February 14th, 2010

Brief list of good things and bad things that happened to me this last year:

  • Gla finally decided to visit me, and I had the chance to show her all the things I’ve been talking about during all these years. I was glad to see her here, to have the oportunity to spend time with her and create good moments to remember, sitting next to each other, showing our own little worlds.
  • Encouraged by my friends and co-workers I started playing in a heavy metal band. They needed a bass guitar player and I had too much spare time and some guitar skills, so I went every friday to play with them in a rented-by-hours local, and a couple of months later my skills as a bass player were surprisingly enhaced. Now even my good friend Pau come with us as the lead singer, and the “metal friday evenings” had become one of the best moments of the week, surrounded by great people, playing cool songs and having fun all together. Funny taking into account that I wasn’t a big fan of metal music till now. And If you want to know which songs we play they are mostly Iron Maiden, Judas Priest and Guns’n Roses, but we also play songs from Wolfmother, Jet, Kiss, or some oldies like The Shadows.
  • Anton pushed me to go with him to learn french on a one-month course, where I remembered what was to study, and where I learnt a new language from scratch. One year later I’m studying french again two times per week and I can’t say I’m not enjoying it. And it helped me to make new good friends, like Marta 🙂
  • Encouraged by Ceci I took a one week course of 3D Computer Animation, my long time dream job. During the last years I learnt all the technical aspect about 3D Animation from the programming side but I never spend time animating a character, moving every bone along the timeline. After the course I realized that that wasn’t meant to be my future career. To animate doesnt have anything technical, it is only art, far away from anything I ever done, so I better stick to the technical parts of 3D Animation, like materials, lights, and so.
  • Ceci suggested me to travel with her to visit Santiago de Compostela, I don’t really like touristic trips, but this was the better I can remember. We spend a couple of days discovering the city and a couple more enjoying it. We met great people, we relax in nice parks, even the weather was perfect and the city wasn’t crowded at all being a touristic spot as it is. It couldn’t be better. Ceci was a great traveling partner, besides her obsession for taking macro pictures of every flower on the streets and parks.

There were bad things too:

  • That I am almost 30 and I still need the people to push me to do things (as you can deduce from the previous points), I never find reasons or strength to do them by myself. And the worse part is that when eventually I do something I’m usually pretty good, but anyway, I’m still a mixture of lazy and coward.
  • I stopped falling in love, after too many heart-broken moments, I realized that I stopped loving the people, and worse than that, I stopped caring about finding the true love, which for me was the main source of energy to wake me up everyday. Now I don’t know if I will ever find somebody to spend the rest of my life, but somehow it doesnt matter. I thought I was a romantic, but I guess that couldnt last forever.
  • Somehow I ruined my relationship with one of my best friends, the person that know me better and now I miss her every single day.
  • To run in a hurry to the hospital after a call telling me Elena had have a crash with her scooter, and to see her so scared, worried and ashamed. But after one year we can remember that and make fun of it, I even feel that after all she become a stronger person.

From 2009 I will carry with me the great days I had with Gla, all the rollerblading sundays with Ceci, the daily lunch with Miguel Angel and our geek conversations, the monday’s dinners with Pau and our nerdy moments, the metal evenings with the twins, my everyday chats about life and love with Julian, the working silly hours with Alun and Marco, the funny classes with Anton and Mikel, the yoga classes with Miriam, the drawing sessions with Ana, watching TV with Marta, hanging out with Graham, the unpredicted calls from Marcos to go eat somewhere, and all the supporting conversations with Magda and Elena. All of them helped me to bare this 2009. After all, it wasnt so bad.

Testing NVIDIA 3D Vision (Stereographic gaming)

Sunday, December 20th, 2009

I spend this weekend in my parents house, where my brother lives. This won’t have anything to do with the topic of the post if it wasnt that my brother is 35 and have a well paid job, under this circunstances he likes to waste the money in all kind of gadgets, even those who will never use, just for the pleassure of showing off in front of the people.

Sometime ago he decided to purchase a nice pack from NVidia that bundle a monitor, 3d card and stereographic glasses. They sell it as the next experience in videogames, and I wanted to know if this is really an improvement.

First of all I have to battle against the driver, using the latest it didnt work. The “NVidia Stereo Controller” driver was not found, I had to download a previous driver and install just the USB driver item (I document this beacuse maybe somebody find this useful).

Once it worked I tested some demos that look nice, but I wanted to see it on games, and I did, and I have some kind of contradictory impressions:

The technology itself is nothing new, the glasses are just LCD synchronized using a IR flashing device connected through USB. You know how it works, the computer shows the frame for the left eye on the screen and syncronize the glasses to block the right eye, and switches fast enough so the perception is that both eyes are watching different images.

This technology was easy with previous CRT Monitors, but TFTs can’t switch images so fast, so with current TFT monitors the other eye still can see the image that was rendered for the first eye.

This is the reason why this pack comes with a monitor, this monitor (Samsung) is able to work at 120Hz so there is no problem to work with the active glasses.

Amd about the glasses, I was hoping some improvement but no, all the glasses that uses LCDs have the same problems, and this ones are not an exception.

First, the brightness. Your eyes are watching half of the frames, and when they are not supposed to see the screen they are covered with a dark screen, that means that the perceived brightness is half of the monitor brightness, and you feel it, when you are used to bright monitors this is like playing with your brightness set to 50%. Annoying. Of course they could create special monitors with the double of brightness, but that brings us to the next problem:

Ghosting. When working with LCD glasses you have to ensure that the darkened eye won’t see anything on the screen, otherwise the user sees strange objects floating on the screen that reduces the stereographic sensation.

So where is the great improvement here? Well, it is not a hardware improvement, it is more a software improvement, and the improvement is that the game do not need to be coded to work in 3D, the driver is able to do it by itself.

Thats a great step forward, and I can tell you that it is not easy. Because the driver somehow has to understand all the steps during the rendering process and it has to determine which parts needs to be redone, readjust the camera position and render the frame for the other eye. And it works!, but not perfectly, because the rendering pipelines are composed of lots of steps and a driver it is not able to understand them fully. Thats why DirectX has some specific features meant to take advantage of this technology.

Those games developed to be used in 3D will work perfectly, the others probably will show horrible gliches, or will have inter-ocular distances that will make your brain explode. Because thats another big point, when working with stereographic you have to set the distance between the cameras used for every eye, and the focus point distance, if you don’t set these distances right, the sensation is annoying or you just loose the 3D effect. For instance, I’ve been testing Colin McRae Dirt 2, the game looks amazing in 3D, the speed feeling is awesome, but you can’t play it using the inside-car camera, because the intra-ocular distance is too big.

I guess that what the driver uses to determine the distance is probably something like ( (far_plane – near_plane) / 2 ) and as I said it work, but not under all circunstances. Another game I tested is TorchLight, in this game I couldnt find any glich (and the game is not meant to work with 3DVision) but the only annoying thing was the cursor, which floated on the screen instead of being at the ground level.

So at the end what is my impression? It is hard to say. It really looks 3D, it really improves the gaming experience, but at the same time you feel that this is some kind of natural evolution in games, and you are used to play in 2D that you really don’t bother if there is no depth perception. I think that this technology needs to walk hand to hand with the headtracking technology, otherwise is some kind of expensive eye-candy.

Twittear para decir que twitteo

Tuesday, December 8th, 2009

Cuando uno twittea me estoy casando, deja automáticamente de casarse. E ingresa en la metavida. Cuando se pretende narrar en directo, el único hecho que resulta es el propio acto de narrar. La narración, como la felicidad de Ferlosio, sólo puede ser retrospectiva. Todo esos tweets llevan un único mensaje. Estoy twitteando.

Aunque no esté de acuerdo con el contexto, me ha sorprendido esta valoracion sobre el arte del twitteo, escrita por Arcadi Espada.

pygame makes me waste my time

Sunday, October 11th, 2009

Today I had some free time so I decided to take back python programming to add some features I had in mind for the pyncel app.

But then I discovered an anoying bug, if you resize the window the mouse messages from pygame don’t work properly, they are limited to the old size, so if the new window is bigger, when the mouse moves outside the old size it stop sending messages, and when it sends it, the position is always in the old border.

I track the problem till pygame, and I discovered that it is just a bug, nothing else to say. I guess the problem is some kind of ‘if’ statement inside pygame code, because I’ve been working with SDL for long time and it never gave me this problem

The weird thing is that I’ve been trying to find more people commenting this bug and there is no trail. And being such an obvious error I’m dazed. Maybe is a problem that only arises with Windows 7

So this is why I comment it here, with the keywords to help search engines: pygame VIDEORESIZE mouse border problem error. I hope somebody finds this post somebody and stop wasting time with pygame.

No improvements to my app today.