Away3D Light pre-baking V3

Demos, Flash 8 Comments »

Away3D prebaking of light v3.

I'm not there yet. I still have a long list of "wishes" that I want to try to implement, but I just couldn't resist to make a little demo in between: an old fashion "nature morte". Best way to test is making real cases anyway...

Thanks to raytracing technics, the new class outputs now a level of detailing far superior than the previous one, allowing some pretty convincing results.

It comes of course at a cost. (It's Flash remember). Since it's useless for runtime, you can prerender while working on something else. No need to say that a dedicated AIR app would help greatly the workflow.

The image below shows exactly the same scenery as above before it was "treated".
For the "highres", I've rendered most textures at 512x512 and outputed them from Flash 10 to disc. It took 20 minutes on my mac. The demo below, shows you the process, but to spare you render time, I've set the most textures back to 128x128. If you want to try it, it will cost you around 3 minutes before be able to explore the nature morte with your mouse.

Away3D prebaking of light v3.

Oh yes, where is V2? Well it was a dead end. Overcomplicated for this purpose, however I've found some pretty interresting stuffs for future uses while working on it. So it might not be total waste afterall.

The faster renderer (v1), from my last post has also been improved on performance, appearance and will remain available, making it ideal for fast impression or prebaking at init of a project runtime.
Here another little demo.

Away3D prebaking of light v3.

The code required looks like this:

LPB = new LightPrebaker(object3D, [lightobject], sceneambient, true);
//false == fast rendering, no shadows
LPB.addOnTraceProgress(traceProgress);
LPB.addOnTraceCount(traceCount);
LPB.addOnTraceComplete(traceComplete);
LPB.apply();

Up to V4 now!

Away3D Light pre-baking V1

Demos, Flash 9 Comments »

Away3D prebaking of light v1

Flat: that's how Flash 3D looks like if you do not fake some light information. Sure we do have materials, but if you have a large scenery, it's eating too much of precious cpu resources that we need to allow other tasks. So we do fake a lot...

No more fake! We can now runtime or at dev time apply some lighting that runs at same speed as the basic material, but looking a whole lot better! With this version 1, I'm hoping to fill a gap between devs and designers.

The demo above shows how an ugly scenery like this can be transformed into something almost mysterious with this code. So imagine what you'll get with this code in your hands! :)

There are tons of stuffs I want to add/improve to that one, but so far I've already added a few features such as:

  • Extended TraceEvents.
  • Getters for exports of the bitmapdata's to disc in Air or F10.
  • Single materials: the same material can be set only once, the engine does apply new ones on itself.
  • Multiple lights: fully compatible with existing code.
  • Scene ambient light value.
  • Default material: if a Mesh object doesn't have any material set of the wrong type, it generates a default one.
  • Alpha's are respected.
  • Chunk process.
  • Object3D support: this means you can pass a whole container populated with Meshes or objectContainer3D's objects.
  • And of course ease of use: Believe it or not, this is a one liner!!
  • var LPB:LightPrebaker = new LightPrebaker(Object3D, [lights array], ambient, maxtris);

    This version 1 of the LightPrebaking class will be added soon to the Away3D trunk, I need to do some clean up's before.
    In future posts, I'll try to show more code and hopefully some progress!

    Entries RSS Comments RSS Log in

    127.0.0.1
    192.168.1.1