Papervision3D + Jiglib Dice Demo

by

Papervision3D + Jiglib Dice Demo

This demo was made shortly after the initial release of Jiglib. It was a study of how far you can push realism in the sence of rendering and animation. Here CompositeMaterial is used with a BitmapMaterial and a GouraudMaterial. This is much faster then using a ShadedMaterial. All you need to do is modify the GouraudMaterial to use a transparent light map. Andy Zupko’s ShadowCaster is used for casting the die shadows. Jiglib is used for the 3D physics, also slightly modified to facilitate fixed timestep. Unfortunatelly the end result is still far from the desired 60fps. Hit spacebar too see the stats, check it out.

UPDATE: Something troubled me when checking the performance in the browser with Flash Player 10 compared to Flash Player 9. On my machine FP9 ran at approx 40fps but FP10 hardly reached 25fps. Changing the wmode from “direct” to “normal” fixed the performance issue in FP10. Especailly in Firefox the performance difference is significant. Still on my machine FP9 seems to perform slightly better then FP10. Mental note: next time take more care in setting the proper wmode.

13 Responses to “Papervision3D + Jiglib Dice Demo”

  1. indra Says:

    its awesome,

    i still on development too to build the dice simulation with jiglib. Anyway i have a problem to get the value of the dice ? any idea or clue to get the number of the dice?,that i should have fixed integration-time to replicate the movement exactly so i can determine the value on the first time?

    thx:)

  2. indra Says:

    i just solve the problem ,thx u , anyway your experiment compilation its awesome :)

  3. Chris Says:

    This is great! Is the source available anywhere?

  4. Adrien Jeanjean Says:

    Hi Chris,
    Thanks for your enthousiasm! However, I’m not going to release the complete code of this demo since apart from the artwork and implementation there’s not much new here. It’s all existing open source libraries put together. This demo just shows that with some hard work it’s possible for everybody to make and in the article it’s described what you need to do to get the same results I got. But try it your own way and chances are you might get a better result.
    The only piece of code I’ll share is the transparent GouraudMaterial I mention in the article. You can get it here:
    http://www.barcinski-jeanjean.com/entries/dice/download/GouraudTransparentMaterial.as
    Good luck and let me know how it worked out.
    Ciao,
    Adrien

  5. Michal Sajban Says:

    Great!! Check out my newest game where I used pv3d+jiglib, its a helicopter simulation: http://www.littlebigplay.com/game/548

  6. DavidSzucs Says:

    A BIG thanks for this shader solution!!! Saved my mental health :) Beautiful and fast! Thanks for sharing it!

    As a quick note: the gouraudMap variables namespace needs to be changed to public in the GouraudMaterial.as…

  7. alperian Says:

    Jiglib has me mired often, largely because of these aforementioned performance issues and the lack of decent documentation.

    I am still very optimistic about it though and the dice run very well.

  8. Mike Says:

    I needed to create a plastic effect and the PhongMaterial didn’t shadow the back of the object as is it would in real life. It made the object look flat. Shaded materials allways show UV seams and i dont see any realistic way to fix that. I just found this post and used your GouraudTransparentMaterial on top of a PhongMaterial in a composite material and it works great! Now I have the white shine from the phong and the dark shadow on the back of the object from the gouraud.

  9. Adrien Jeanjean Says:

    That’s great Mike! And the performance hit isn’t too bad either, hun. Would be very interested in seeing your end result. Cheers

  10. Terrence Says:

    It would be nice to add directional Physics and velocity control to have the dice enter scene from off the screen to hit the wall opposite direction I could sure use this in a game of mine

  11. Michael Anderson Says:

    Hello there, Great demo! I’m trying to build something similar but am running into problems regarding the dice container. I’ve tried using cubes -> jBoxs as the walls and floor of the container, and the dice fall into the container but can escape when forces are applied. When I try building the container out of planes -> jPlanes, the dice avoid the whole container and seem to be pushed outside of it. Any help would be greatly appreciated, thanks in advance.

  12. Gas Power RC Airplanes Says:

    Gas Power RC Airplanes…

    [...]Papervision3D + Jiglib Dice Demo « Barcinski & Jeanjean[...]…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.