code
The fbo benefits
0When I started using openGL and making some nice effects, I started to use the typical “copy to texture” functions: glTexImage2D and glTexSubImage2D. But the technology evolves, and, hopefully, someone implemented in the OpenGL extensions the Frame Buffer Objects (fbo), wich provides us a way to render a scene to a different buffer but the frame-buffer.
Anybody should know that writing to a frame-buffer is much better than writing to a buffer by “the old way” (glTexImage2D), but… can we express this in real numbers?
I was doing some experiments with Shadow Mapping and I did what everybody does: search for tutorials!
I found 2 really good tutorials: Paul’s projects tutorial, and Fabien Sanglard’s tutorial. Both tutorials are brilliant, but the first one is a little bit outdated (it does not use fbo’s or shaders), and the second one has some ugly Moiré pattern effect which I was unable to make it disappear, despite it uses recent techniques (fbo’s and shaders).
The Moiré pattern can be appreciated in the image below (and the effect is much more spectacular in movement):
Due to that, Fabien’s tutorial was not an option for what I wanted to do, so I gave a second chance to Paul’s tutorial, but instead of using the typical glTexImage2D, I used the fbo (it took 5 minutes of my time to modify the provided example), the results: 562fps vs 630fps (both peak values)!, almost 70fps more! more than 10% of diference!
So please, next time, spend 5 minutes of your time and do not use glTexImage2D, use fbo’s!
Generating Cellular textures
2One of my hobbies is the generation of procedural textures (yes, sounds weird!), and for years, I’ve been trying to generate a nice Cellular texture. I kept in my bookmarks the blackpawn’s tutorial, but I never had time to check it in deep.
Today I’ve spent some minutes reading it and… boum! cellular texture implemented!!!! The results are quite nice, but now is time for tweaking the formulas, and try to make more combinations.
I’ll post the full code soon, but meanwhile, you can check the results in the image below:

If you are one of my followers
you’ll think “hey! you already had some code to generate cellular textures!!!”, yes, you’re right, but the code was ugly, as well as the generated textures!! this new code is much more simple and effective!
Adding music to your mac intros with protrekkr!
2Do you want to make 64k intros with cool music but you know a shit about music? protrekkr is your solution!!!
I’ve prepared this small tutorial, describing step-by-step what do you need to do in order to add music to your intro. Happy coding!
Rainbowduino… a virus in my Arduino!
3I’ve started playing with the Arduino platform and is really amazing the possibilities that this open source platform can offer, from beginners to more experienced users!
Recently, I’ve ordered Rainbowduino and a 8×8 RGB led matrix. Rainbowduino is essentially an Arduino designed for controlling an 8×8 RGB led matrix, with some features (I2C protocol suport, cascading).
Let’s get to work!
The first problem that I faced was to make it work: I don’t have a serial port (and rainbowduino cannot be connected via USB, as Arduino does), after 1min search in google, I found this post, with good instructions about how to use Arduino as a host for programming it. In the same page, you can find the mtXcontrol program, very useful for starting drawing with your rainbowduino!
procloab is on the way!
2Hi all!!!
The Procedural Lab program (integrated Texture Generator / Library and Object Generator) that I’m developing is available here!
At this moment is barely functional… lots of features are still missing!! Only one part of the Texture Generator is ready
Feel free to destroy my dirty code!
Back to Code!!!
0Since I’m in India, I’ve restored my ‘old code’ (Texture and Object Generator). I’ve seen that my old code was almost finished, so I just retouched it a little bit, and prepare to release it for distribution (source code will be soon ready!).
Some years ago I already advised how the new model of object generation is working. Instead of using a single texture, now I use what I called a Texture Library, so you can use and reuse, the same texture without any size impact (and in a more efficient way).
The actual procedure that you need to do is:
- TextGen (ZNT): Create the ZNT texture(s), save to disk each texture.
- TextGenLib (ZNT->ZNL): Pack all your desired textures in a single Library file.
- ObjGen (ZNL->ZNO): Open a library file, and use the textures for generating the object!!
In ObjGen you can upload only one single Library file per object, but you can upload it multiple times, so you can try with different libraries, using the same object. Sounds weird, but is fun
Now you have the tools! are you asking for the code?? well, I’ve to solve some things (some code is dirty…), but if you send me a mail, I’ll be pleased in give it to you
Apple i la censura del iphone
0Al principi apple va dir que la plataforma iphone (o ipod touch) seria una plataforma tancada i que no es podria fer software. Després, molta gent es va queixar i van accedir a treure un kit de desenvolupament però amb limitacions. Aquestes limitacions no estaven en el hardware, sino en els continguts, i aquí és on vaig començar a veure problemes…
Si vols, pots baixarte el SDK for free (de fet jo me l’estic baixant desde la primera beta) i pots començar a fer software… però no el pots distribuir en altres dispositius reals, perque? dons perque necessites que tingui una firma digital, i per poder firmar digitalment has de formar part del Developer program de apple i pagar 99€/any (vamos, t’han de fitxar), d’aquesta manera tu i solament tu podràs fer soft per el iphone, i com el software estarà firmat per la teva identitat, sempre sabràn d’on prové.
La teoria és molt bonica, ja que ells ens volen vendre que això ho fan per controlar que ningú farà ‘malware’, ni virus ni res… però la veritat és una molt diferent, ja que si mirem detingudament les restriccions del acord del desenvolupador, posa coses com que no es pot revelar informació Confidencial (=tots els materials del iphone ¿?), i per tant, està prohibit per exemple fer foros, llistes de distribució, etc… una bogeria total!!! Però això no acaba aquí, ja que amés apple prohibeix fer software de tracking (GPS, tom tom¿?) o de multimèdia (un player de audio-video)… què passa apple? tens por que algú faci un software millor que el teu bonic itunes?
Un altre punt a tenir en compte és que les aplicacions sol es poden distribuir per mitjà de la itunes store, lo qual vol dir que prèviament ha passat per la revisió de la gent de Apple, i segur que miraran totes aquestes normes amb lupa. I, encara que paguis religiosament els teus 99€ i facis un programa que sigui la reòstia, i el venguis per 0€, apple et pot tallar les ales, ja que tenen un contracte que t’han fet firmar “per collons” (per defecte l’acceptes si t’instal·les el SDK).
La veritat, tenia en ment fer el pomod per iphone (seria com un somni per mi poder escoltar els mòduls de demos en aquesta plataforma), i tenia pensat afegir viewers 3d i efectes típics de demos…. però… pa que? Apple s’ha posat molt estricta amb aquesta plataforma i crec que m’hauré de buscar la vida amb SDK’s “no oficials” per poder fer els programes/demos que a mi m’agraden… ells s’ho han buscat!!!
Amés, si algú em ve amb les xorrades dels virus… li diré que en “teoria”, el soft del iphone és un derivat del MacOSX, que crec que és molt segur… i no tindria que haver cap problema en aquest sentit… potser és que apple no les te totes en qüestió de seguretat…
Si es que fins hi tot Microsoft s’ho han muntat millor amb els SDK de windows mobile!!! No tenen restriccions de cap tipus amb el software, porten anys amb ell, hi han milers de pàgines amb documentació… i virus¿? tot i ser un sistema 1000 vegades mes inestable i insegur que el de apple, té molt poc virus i pràcticament inofensius…
Així que…. apple… l’estas cagant, t’estàs convertint en la nova Micro$oft?
Esperem que rectifiqui aviat o haurem de passar-nos al SDK no oficial, i tenir que actuar al “marge de la llei”, tot per poder programar els nostres 4 programes… què trist, no?
iphone sdk amb suport de OpenGL!!
0Toma pelotazo!
Han tret la 4a beta del SDK del iphone, el readme posa…
This fourth beta release of the iPhone SDK includes a complete set of tools, compilers, frameworks, and documentation for creating iPhone OS applications. These tools include the Xcode IDE, and the Instruments analysis tool, among many others. With this software you can develop applications that run on iPhone and iPod touch using the included iPhone Simulator.”
per fi!!!






Recent Comments