Away3D vs Papervision3D (performance-wise)

Jul 17th, 2007

As I mention on the previous post, I always wanted to try some of the old experiments with Away3D to see how much will the speed get affected with that enhanced z-sorting.

I've spent just a bit of time this afternoon modifying the old pink ball code so it compiles again with Papervision3d, and I've done the same code but with Away3D. Here are the results:



The test has been done with MacBook Pro + Firefox + Flash player 9,0,45,0.

Papervision3D (src): 14FPS, Memory: ~8Mbytes
Away3D (src): 14FPS, Memory: ~18Mbytes
Away3D (CORRECT_Z_ORDER) (src): 5FPS, Memory: ~15Mbytes

So, in this example (2,000 triangles scene) with the last revisions of each engine code, seems like both of them perform at the same speed using the same renderer although Away3D cosumes more Memory. However, Away3D seems to go down 10FPS when rendering with the CORRECT_Z_ORDER filter.

UPDATE: After Away3D guys fixing the memory leak, I've recompiled the examples and updated the result. But, I'm still not happy of how this benchmark is being done, I'll setup the scene in a better way so it's easier test each engine. A lot of factors may be making the numbers not fair.

#permalink

Away3D - Revision 205

Jul 16th, 2007

Alexander Zadorozhny has announced today a new revision of Away3D.
A lot of methods have been changed and seems like a new way of sending parameters (which is the same way Tweener uses) has also been introduced.

I think the API makes much more sense right now (just my opinion), and the fact that they also released a zip with examples for getting started, just makes it too tempting ;)

Something I always wanted to try was to get my old experiments working with Away3D, to compare the performance and also compare the visual improvement.

Way to go guys!

#permalink

PV3D: Real Materials, Part 1

Jul 11th, 2007

After doing the experiment with the fake materials and writting the controversial post the ambition of getting real materials grown on me.

For the people that doesn't know what I'm talking about when saying fake/real. In the last examples, the reflection was just a plane on top of the other texture and I was scrolling the reflection map. That's faking the reflection, there are no real calculations of what that face of the mesh needs to reflect from the texture...

I'm a bit lost on this, but it's only a matter of keep trying, testing, and getting deductions from the errors and results.

This is what I've achieved by now...

I was doing this a little bit like blindfolded, the UVmapping just gets the position of the texture from 0 to 1 for each vertice and filling the poly is easy. For doing the spherical environment mapping it was about getting the texture from 0 to 1 in relation to the normal of each face (as seen here). After messing around with the matrix, I ended up with this:



Well, it's a good start... after trying different values in the matrix I ended up getting this:



Better, and in fact, pretty nice rendering I think. And finally I reached something that looked like what I was after:



It's really messy, it's not environment mapping in flat mode, neither in smooth mode, it's what I have at the moment, here it's how it looks in another mesh:



So, for the people that were looking for the code... I'm not going to give it this time because that would mean having to zip papervision3d sources and in that way creating a working version that will last for a week or two only, so, instead I'm going to explain a bit what I've been doing...

To get to this point, basically I modified Face3D.as so every time a new face is created it also calculates the normal for the face (which, I don't know why pv3d still doesn't have this, because the code is really simple and short).

normal = Number3D.cross( Number3D.sub( new Number3D(v1.x,v1.y,v1.z) , new Number3D(v0.x,v0.y,v0.z) ), Number3D.sub( new Number3D(v2.x,v2.y,v2.z), new Number3D(v0.x,v0.y,v0.z) ) );
normal.normalize();


Then, on the MaterialObject3D.as I defined the property mapping_type which, by default equals to "normal", I can then change it to "environment" or "environmentFlat".

Having done all that, I only had to go back to the render loop inside Face3D.as and adding a Switch for each kind of mapping type.

At the moment the environment is not facing the camera, is facing a light in the scene, which means that if all this works we could simulate a better light than the flat one we have seen on away3D examples. It would be kind of Phong illumination.

However, in order to do that I've to modify the code a bit more so I end up using the normals of each vertex. Again, I'm a bit blindfolded here, but I think I'm on the right path... in a couple of days, maybe I'll have a bit more :)

#permalink

Papervision3D goes public

Jul 7th, 2007

Seems like 070707 was the special day ;)

http://blog.papervision3d.org/ 2007/ 07/ 07/ papervision3d-public-beta/

And for celebrating it they did a showreel featuring some of the works done with the engine.

You may recognise some of my stuff there ;)

#permalink

PV3D: Fake materials (Sources included)

Jul 6th, 2007

For some months there have been a hot topic in Papervision3D's mailing list which is the special materials for the engine.

In the early days Ralph did an example with environment mapping but for some reason, the guy didn't want to share the code at that moment and they have been working on all this for a long time now, showing some examples some months afterwards and then seems like there are no more news on the front. I just hope that we won't do 1 year of papervision3d since the release and we still have only normal texture mapping. C'mon Ralph!

Then, these days the materials topic started again thanks to Fabrice (a.k.a the browser killer). Releasing experiments in Ralph's style, testing similar things. However, with Ralph experiments it was easy to see that the calculations were real as the objects were complex. But Fabrice's examples were using spheres, planes, and simple objects, which made me think that he was cheating (He isn't).

So, then is when I had the idea of speding 1hour and doing a couple of examples of fake materials (so, cheating) to achieve similar results than what Fabrice was showing (although without killing any browsers ;D).

And these are the results...
(click on the images to see them moving)

Wood


Metal


Weird


Weird 2


They are fake, they only work in specific 3dobjects (basicaly simple mapped 3dobjects). But well, I'm sure you'll find a good place to use it :) The really cool thing of this technique is that is really fast, it runs at 20FPS+ in my iBook G4, and I'm sure it can be optimised.

What I'm doing is very simple. You have 2 bitmaps, one that you use as a diffuse map and as bump map, and then another one as "environment map"... wait a second, I think it will be easier if you take a look at the .fla instead of me trying to explain step by step what's going on.

Here you have the source code.

Enjoy!

#permalink

Java is loading...

Jul 5th, 2007


And the people still don't get why Flash is THAT extended :) Doesn't matter if they make the loading more cute, what they have to do is get rid of the loading at all. In fact, the user shouldn't have to see anything about Java, the user shouldn't even have to know what Java is all about.

That's exactly the same than with special effects in movies. The best special effects in movies are those ones that you don't see.

Oh, c'mon! I really want to uninstall Java now.


#permalink

Papervision3D: Getting Started

Jun 14th, 2007

Most of you probably know that I'm not really a fan of speaking in front of a group of people. However, Tink seemed quite interested and was asking me if I could do an speech in this month's LFPUG.

Right now I'm quite overbooked with 2 projects plus the day job, so I didn't have much time to prepare it, so I mention that to Carlos and since the beginning he was up for giving me a hand on it.

We still have to prepare the speech in detail but by now we know that it will be a getting started talk going from the basics and ending up understanding how my weird (for some people) experiments were done.

So... yeah, I'll see you there :)

#permalink

PV3D Previewer v1.1 (now works on MacOS too)

Jun 13th, 2007

While on holidays I woke up inspired one morning and having my ibook with me I decided to find the bug that made the pv3d previewer stop working on macOS. After a bit of testings here and there I found out that under macOS, the type parameter of a fileReference returns always undefined (while in Windows returns '.ASE', or '.DAE'...)

So in a couple of minutes I had a quick workaround for that:

function getFileType(file:String)
{
    _file = file.split('.');
    return '.'+_file[_file.length-1];
}

As simple as that... so now, with some minor amends, I've updated the little page and the 1.1 is out.



http://mrdoob.com/tools/pv3d_previewer/

#permalink

Flash Player 9 update 3

Jun 13th, 2007

Back from holidays... Menorca is alright, some photos would be up shortly. After checking all the emails, rss and news, the best that has happened while I was away is this:

http://labs.adobe.com/technologies/flashplayer9/

Testing it with my MacBook Pro... something that before this update was running at 11fps, now it runs a 30fps! :O It's really impressive. All my 3D experiments run much smoother now (specially the 3D webcam ones).

Keep it up flash player developers!

#permalink

Refraction (kind of) effect, Webcam + AS3

Jun 4th, 2007

And even when I though I wasn't going to do any more effect...

Refraction effect



http://mrdoob.com/lab/webcam/refract/01/

In Spain we used to have this kind of crystal in a very random places... kitchen, school...

#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: