Papervision3D 2.0 Is 3D Web revolution here ? Or not so fast ?
One one side you have euphoria of what’s POSSIBLE and on the other side what is REALISTICALLY usable. An all important parameter is the width of the gap between these two sides. After some time spent playing with PV3D I reallised just how deep this gap is.
I found out, that unless you cheat ( a lot ) , there’s no way, you can do a 3D that’s even close to a todays CGI standard. Among other problems, there’s a very low limit to number of fully shaded (goraud/phong) triangles you can have in a 3D scene before you send you CPU usage soaring.
Notice that even quite big names pv3d based sites (Absolut, Canon, Sony) although using very very, simple geometry aren’t quite smooth on even most powerful PCs. Even on a quad core intel machines you can notice a reaction lag, that distorts the smooth interactivity experience. On a below average machines this kind of sites can quickly become unusable.
O course there’s a limit of what can any as3 3d package do. The limits are given by the large degree by performance of the flash plugin itself, but also a cpu performance limits, as what is being attempted here is one of the most processor power hungry task there is : A software based real time 3D rendering.
Another problem lies within the number of hardware abstraction layers, before anything is rendered in flash.
So you have to resort to a lots of workarounds, 2D/3D illusions using prerendered movies, baking textures, 2.5D sprites etc. Perhaps better but more difficult solution is to program in some sort of “adaptive degradation” depending on the user’s machine performance. If the performance problems are detected models are replaced with the ones with less polygons , antialiasing quality can be reduced and simpler shading model is used.
Anyway, back to my testing. I’ve used the latest version of Great White I found on svn at the time when I started the tests.
![]()
As the first thing I have made a demo showcasing combination of all of the 3D primitives (plane, sphere, cylinder, cone, cube + a loaded collada object) and almost all available materials (wireframe, color, flatshade, goraud, phong, cell, bitmap, movieclip, video). Here’s the first thing I found a bit odd. Papervision lists (and treats) goraud and phong as “materials”. Although, they should really be treated as “shaders”. So you could have a color material with phong shading applied which would give it a plastic look for example, but also you could have a bitmap material with phong shading as well. In classic 3D packages such as 3Ds max, selected shader determines how the smoothing is interpolated for an edge created by 2 adjacent triangles.
EDIT: I’ve just learned there actualy are shaders implemented, the stuff I’ve been trying out are shadedmaterials
My biggest issue that arised during testing primitives and materials is that is seems, there is no simple way to reassign a different material to object once it’s created. It should be as easy as obj3D.material = new Material.. but it is not working like that. I had to recreate a new 3D object and pass it a new material in constructor. That seemed to be the only way , unfortunately.
The next, I’ve tried to control the position, rotation and zoom of the object/camera in 3D space on the loaded collada mesh. That was easy enough, all worked as expected.
However I noticed , when you want to render anything in PV3D renderer you have to pass a camera to it. What about non perspective views though ? What if I want to create a pure isometric or orthographic view ? Although perspective distortion perhaps does make 3D look more “cool” it is a distortion nevertheless, and sometimes, especially when more precision is needed it can become quite an unwelcome effect. It can be quite difficult to align perspective scene to a 2D view, good example could be a traditional flash minisite page that has to suddenly appear as projected on 3D cube which turns and reveals the next page… Or some architectural or technical use, when you just want to show flat top/left/front view of a certain mesh/scene.
EDIT: Again , (thanks Ralph) I’ve learned there is an option to do orthographic projection via Frustrum Camera.
The next test was a test of interactivity. I did 3 interaction test from a simple 3D object click , material click to Mouse 3D testing, when global 2D mouse coordinate space is resolved to objects local 3D space.
I was quite happy with interactions events handling in pv3d, quite logical and for most cases sufficient. What I haven’t tried, but have seen done, is interacting with movieclip texture, that has it’s own events defined. That is more tricky, but not impossible.
My last test was to load animated collada file and make it follow a 3D mouse click. This was a disaster. Although file loaded correctly and running animation was displayed correctly it seemed to have it’s own 3D space. When I attempted to rotate it and make it follow the mouse it rotated in completely different direction that it was supposed to. So I tried a trick / workaround to force it to cooperate and bound it to a parent dummy cube and to make the cube follow the mouse, hoping the collada would do so as well.
Although the cube followed the mouse without problem, the collada object didn’t. I even tried copy the position and transform of the dummy cube object to collada each frame but still , no progress. It’s really a shame, since this would be quite a core functionality if you were creating a 3D adventure game , where your character needs to follow your mouse click on the scene. Unfortunately I did not have time to try to import other animated characters, so perhaps this could be a problem with my Max scene .. will test further..
Posted in AS3, papervision


April 6th, 2008 at 9:00 pm
A couple of comments :
PV3D 2.0 is still in alpha. The material setting is a work in progress. It can already be done, but requires some effort in code to much.
You’re incorrect on the shaders. Papervision3D does have shaders, as shadermaterial. You’ve been using shadedmaterials…shaders are added next to the regular material, and will allow for the original (bitmap based) material to be shaded. I think you should revise that part of your article.
As for projection types. The FrustumCamera allows you to do orthographic projection.
Using interactive movieclips which retain interactivity when used as a surface for the 3d objects is not harder at all; it’s even easier as you do not have to add eventlisteners etc.
ASCollada is being revised as we speak (the animation engine behind it), but your ‘problem’ is not directly related. You should/could have a look at your object from max as it sounds that the nesting done in max goes wrong.
April 6th, 2008 at 10:58 pm
Thanks for your comments Ralph and for the tip on the Frustrum Camera. Was wondering what it does ! Will look again at shaders as well and revise accordingly. Not sure what could be wrong with my max setup though, is there any documentation / guidelines available on how to export bones/biped/skin animation so it’s compatible with PV3D 2.0 collada motion engine ?
I am really just learning pv3D (and this post probably reflects my frustration and ignorance : ) but any helpfull comments like yours are greatly appreciated.
April 8th, 2008 at 2:13 pm
Hi Slay,
Revolution it is for sure, nice models:)
Join #papervision3d on irc freenode
Hope to see you there.
May 22nd, 2008 at 11:09 pm
Hi slav
Your work is just great.. i have experince allt he same problems as u do now.. only1 thing u fixed the animated acollade any change to release the source? been trying to get this to work for 1 day.. bahhh
here 2 diffrent collad files to a container.
http://www.jengbc.nl/3D/
cheers
June 4th, 2008 at 12:43 pm
Nice summary,
Seems like you could easily go insane trying to muddle through Papervision though!
The 3D Web revolution isnt here just yet – thats reserved for Flash Player 10!
June 25th, 2008 at 8:42 pm
Helo!
I just have to sey that all that sites of Cannon,Audi RS8,Sony etc. running nice in my smaller PC.CPU 3 GHZ pentium something.With grafic card integrated.
So I think that 3D in flash do not requiered Cuad Core.
A Cuad Core of fbs 1333 will can not to run a game of shooters because it’s a Flash.
The problem is not in the PC.
I hope that Adobe and Microsoft resolve this problem.
Adios!