What happened to LightPrebaker?

Software: Away3D 4.x

rustyk, Newbie
Posted: 20 March 2016 12:26 AM   Total Posts: 22

Somehow I stumbled on this when I was looking for some simple shadow implementation. It seems really cool to use for optimized scenes but I can always use 3rd party lightmapping tools for my scene.

I was wondering what happened to this feature in Away 4 as I can’t find any reference of it. If not, can I use this as an extension instead?

   

Tempy111, Sr. Member
Posted: 21 March 2016 02:37 PM   Total Posts: 133   [ # 1 ]

Prebaking functions are now done with Prefab I believe.

   

Avatar
Fabrice Closier, Administrator
Posted: 21 March 2016 03:30 PM   Total Posts: 1265   [ # 2 ]

there is no prebaking feature in current public version.

a very nice upgrade of my old “simple shadow” class, http://videometry.net/away3d/matcap/SuperSoftShadow.as was made by theMightyAtom

   

rustyk, Newbie
Posted: 22 March 2016 12:31 AM   Total Posts: 22   [ # 3 ]

thanks, I really would like to try out if there’s any latest version or nightly build for the prebaker function.

@Fabrice
That’s a cool demo! but I was just looking for more of a really simple “blob” shadow example that you can see on most 3d mobile games.

http://www.polygonpi.com/wp-content/uploads/2013/05/banjo.jpg

http://i.imgur.com/V3FTq.jpg

   

Avatar
Fabrice Closier, Administrator
Posted: 22 March 2016 11:15 AM   Total Posts: 1265   [ # 4 ]

you don’t need much to do this, simply make a png transparent, apply to a plane that you move on x/z plane with your character. slightly over the ground, set the material alphablending to true and you’re pretty much done.
You even could use a black&white; jpg and play with blendmodes/depthcompairmodes.

   

rustyk, Newbie
Posted: 23 March 2016 01:34 PM   Total Posts: 22   [ # 5 ]

Great, thanks! I’ll experiment a bit and see how it goes. smile

   

alpoman, Jr. Member
Posted: 25 March 2016 06:11 PM   Total Posts: 40   [ # 6 ]

Hi Fabrice, great advice on using the planes with pngs of the shadow with alpha - works great!!!
I’m interested in this simpleshadow method you mentioned -
My question is, i import that class, and put this code in after everything is set up in my scene -

var container =new ObjectContainer3D();
view.scene.addChild(container);
SuperSoftShadow(container)

but when i run I get an error -
I am doing the proxy thing scince I’m using starling too - does this mess up the simpleshadow method?

here’s my error,

TypeError: Error #1034: Type Coercion failed: cannot convert away3d.containers::ObjectContainer3D@799b479 to SuperSoftShadow.

thnks for any pointers!!

andy

   

Avatar
Fabrice Closier, Administrator
Posted: 25 March 2016 07:05 PM   Total Posts: 1265   [ # 7 ]

I never used this class, just saw it in action. The error is a classic as3 type error.
Make sure you cast or access the class with proper typing.

If you use starling or whatever custompass, you are the one who present “by hand”, so you can render this shadow pass probably in between when required and continue render your other passes, like away views and your 2d api starling.

Note that it would not be a very good idea to update the shadow constantly, its made, to render a nice blurry shadow for static meshes. This means you could on init of your assets have a generation routine and then you simply using it like the blob shadow from above. If you want realtime updated shadows, use instead the shadowmethods.

   

alpoman, Jr. Member
Posted: 25 March 2016 09:46 PM   Total Posts: 40   [ # 8 ]

Thanks again Fabrice.  I worked on this shimpleshadow method -
here is what I found.  It would be good for blob shadows of meshes in your container.  here’s my code, after init scene as usual.

import SuperSoftShadow

var container =new ObjectContainer3D();
var mycube = new Mesh(new CubeGeometry(32, 32, 32, 1, 1, 1,false)

container.addChild(mycube)
var shadow = new SuperSoftShadow(container,stage,20,256,1);  // 1 is 1 pixel above ground//

mycube.y=1 // make sure this is at least 1 pixel above ground//
view.scene.addChild(mycube);//  gotta add the original                 mesh or you’ll just get its shadow//


one note, in the SuperSoftShadow file, i had to change this line to make the shadow bigger than the object if object is on the ground, otherwise it is directly under it and you cant see it. if your objects floats or has holes, might not need this.

var geometry:PlaneGeometry = new PlaneGeometry(_ext*1.5,_ext*1.5);//// i added the 1.5 to make it more bigger, you could make this 1.1, etc//


and this renders a nice blurry square under your cube, simulating a light from directly above’s shadow.

oh, you can addChild the shadow to your mesh so it follows it if its a moving object or character.


andy

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X