Jump to content

Pandora's Box in 66 lines of JavaScript


mfdesigner
 Share

Recommended Posts

Hi,

 

I'd like to announce the new collision detection, physics simulation, and post processing features in the latest build of oTakhi Platform - a drag'n'drop HTML5 game development engine wherein users can share game assets and code logic as reusable components.

 

This scene below, Pandora's Box, is created in just under 66 lines of javascript.  

It is made of two separately rendered scenes and uses the following techniques:

 

(1) The main scene uses Vignette, FXAA, and Focus post-processing filters.  The Vignette filter gives the scene a darkened surrounding.  The FXAA filter provides a much better anti-aliasing in removing jagged edges.  The Focus filter gives the background objects a slightly blurred effect while putting the box in focus.

 

(2) The secondary scene (behind the main scene)  is used to generate occlusion buffer for the light object.  It uses VBlur, HBlur, and Radial Blur filter to create god rays effect.  It is then added / blended to the main scene per rendering cycle.

 

(3) Collision detection is enabled between the lid and the box.  The scene is given a downward gravity and the lid a positive weight.  A Hinge joint is created connecting the lid and the box.  When you drag the lid using the mouse, an impulse force is applied on the lid.

 

 

I will pose a HOW-To video here in coming week.

 

Steve

 

pandorabox.png

 

 

 

Link to comment
Share on other sites

First of all, thanks for you guys' feedback.

 

The tutorial took far more time to make than the scene itself... but here it is.

 

pandora_banner.png

 

Most of the 3D content is currently NOT being distributed via my Content Distribution Network (CDN).

And therefore you are downloading them directly from my servers at Texas, USA.

 

At a later time that we deem appropriate, e.g. our software is feature complete, I will push 3D content to the cache servers

all over the world and you shall see a huge performance boost in downloading speed.

 

For example, this demo video is hosted by the CDN.  You will be downloading it from one of its regional cache server.

Let's see if you have any issue.  The video is 38.5 MB in size.

 

The line of light artifact is merely the result of the lid not being closed completely.  The tutorial solved that issue.

 

Steve

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...