graphics.beginBitmapFill, opacity? blending? pretty please...

Feb 19th, 2008

The classic question on interviews lately is "What would you ask Adobe to improve on the Flash player?". Well, I finally have a real thing to ask the guys and is to give some love to graphics.beginBitmapFill.

Since the beginning there were 2 ways of rendering your 3d scene in flash.

1. Render everything in a single Sprite / MovieClip.
2. Create a Sprite / MovieClip for each triangle or Mesh.

The second option was the most useful because you had easily properties such as opacity and even blending as Sprite/MovieClip have already those properties, but, performance-wise, option 1 was the winner hands down. So, as people wants speed, some engines have gone through the option 1 and then spent time trying to find ways to hack the properties that you get for free with option 2.

If you take a look on the drawTriangle loop inside Papervision3d in instance you'll find this:

graphics.beginBitmapFill( altBitmap ? altBitmap : bitmap, _localMatrix, tiled, smooth);

I even had to do a hack for a project where in order to be able to change the opacity of one material dynamicaly I had to generate an array of bitmapDatas with the original texture with different levels of transparency... nasty!

Wouldn't it be great if you could tell the amount of opacity and which blending to use to the beginBitmapFill?

#permalink

My code.google

Feb 18th, 2008

I'm finding this code.google thingie quite handy for handling all my open source stuff. Recently I've updated the videoplayer quite a bit and I was now updating the pv3d previewer...

So, keep an eye on the link cos it will be heavily updated (specially the svn repository) from now on:

http://code.google.com/p/mrdoob/

#permalink

TypeError: Error #1010: A term is undefined and has no properties.

Feb 13th, 2008

If there is something I hate from the daily work with AS3 is the annoying #1010. It makes the compiler sound arrogant, what?

To me it looks like:
"There is something wrong there, but I won't tell you what it is... cold cold cold warm warm super warm!"

It's like if it was in a constant puzzle game.

Well, to be fair, it kind of says WHERE, but it would be much helpful if it said WHAT was the term.

#permalink

pong1k, a game in 1,022bytes

Jan 29th, 2008

There was a guy on escena.org yesterday talking about this pong in 1kbytes done in openGL. So, once again, I felt challenged and tried to do the same with Actionscript 3.

And well, after a bit of tweaking here and there, seems like managed to make it in 1,022bytes :D

pong1k

You know where the sources are, don't you? But if you just want to see the snippet, here it's too.

EDIT: Kristof Neirynck has ported the code to AS2, and after a few tweaks turns out that AS2 creates tinier files than AS3. At least in this case. pong0.5k Maybe when going a couple of kbytes up AS3 would win AS2.

EDIT 2: And now, for something completely different, the same game in 393bytes. Nice one Matthew! :D

#permalink

xplsv.tv videoplayer + sources

Jan 27th, 2008

For years I was highly ashamed with the FLV player I coded for xplsv.tv :/ Somehow I was able to finally recode the player this Saturday. Very simple and minimal, with simple behaviours (VLC style) like DOUBLE_CLICK for going fullscreen and cursor keys to go forward and backwards.

And this is how it looks using the, also brand new, xplsv.tv embed code:

And... guess what, I'm sharing the sources of it too. But I'm doing it in a new way this time... (I'm afraid you'll need svn-handling knowledge from now on).

SOURCES

#permalink

Vanilla cokes! ;) UPDATED :$

Jan 25th, 2008

For months and months people promised they were going to send me vanilla coke packs from the US, but none of them really ended up doing. I guess they just wanted my real address to take pictures of me or something ;)

Anyway, thanks to Patrick French we have found a much better solution for this critic issue, if you feel like getting me a beer or something, here is the button you were looking for:


Thanks in advance, and thanks for the 1st beer Patrick :D!

UPDATE: Woops! seems that my handmade blog broke the Paypal snippet! :S Thanks Alan for letting me know :$

#permalink

PV3D 2.0: Audio Visualisation 05...

Jan 24th, 2008

... or, how a music spectrum looks in 3D.

audiovis05

The effect was already half done having the blobby ball, so I though it could be faster enough to apply the effect that my pal Mac did on our old demo mdma.

Click on the screen for changing the tune. Tunes are from Paniq, Ochre, Prefuse 73, Esem and SebastiAn.

Enjoy the sources :)

UPDATE: Here it's another test. It's kind of ugly, but gives an interesting movement feeling :)

#permalink

Oh noes! T-Mobile beat them!!

Jan 22nd, 2008

Now they're the dumbest company on the universe. That must have been most silly thing to spend money on, for sure.

Via.

#permalink

Stats on PV3D 2.0

Jan 17th, 2008

Some people asked me about how to get the stats of how many polygons were being rendered per frame on PV3D 2.0. Well, I didn't know until yesterday. It has indeed changed a bit, here is how:

public var stats :RenderStatistics;

public function renderLoop(e:Event = null)
{
stats = renderer.renderScene(scene, camera, viewport);
trace(stats);
}


You get much more extra info than just the polygons, take a look on the RenderStatistics class for more info. Hope this makes it clear for everyone.

#permalink

FastStart on .MP4 files

Jan 15th, 2008

After many weeks trying to convince everybody to submit stuff in .MP4 to xplsv.tv as the best format, I finally faced the process of creating a .MP4 myself.

The idea was to submit a couple of my favourite demos to the site. The process is fairly simple, use kkapture for creating a bunch of uncompressed .AVI, then load them up on After Effects, which already puts them on a sequence, crop the video if needed and export as .MP4. I had to do many tests at different resolutions until I finally reached a resolution/quality I was happy with. And what was my surprise when I uploaded the first file and it didn't have fastStart!

Just so you know what I'm talking about, fastStart is how they call to progressive loading now. The idea is that you don't have to wait until the whole video is loaded, but you can see on-the-fly what has been loaded already.

Seems like After Effects, Premiere and similar tools aren't able to do that, so you need a compile this qt_faststart.c file and then use it to fix the generated .MP4, which, thanks to devcpp was just a matter of seconds.

If you don't want to mess with C compilers, here you have the compiled version for Windows: qt_faststart.exe (it's a command line app, needs to be used like this: qt_faststart.exe my_video.mp4 my_video_fs.mp4).

Anyway... here are the videos:

http://xplsv.tv/movie/2377/
http://xplsv.tv/movie/2378/
http://xplsv.tv/movie/2379/
http://xplsv.tv/movie/2380/
http://xplsv.tv/movie/2381/

Now the problem maybe is that I have done the captures with too much quality (1024x576 3500...) and people don't have enough bandwidth to watch them... But at least, I know that they're small enough so they can still be played on a G4.

EDIT: And here is the Mac version (thanks to sole).

#permalink
Pages:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Webs / Print / Logos... everything I do will be listed here.



If you're looking for my Actionscript experiments, here you have: