Changes

Jump to: navigation, search

Processingjs gamepaper

262 bytes removed, 06:28, 16 January 2011
3D support
Processing.js hides a large number of these differences from the user by creating a unified method of handling common interactive events. Regardless of the browser/platform, the functions behavior of the event handlers are the same in different browsers. This standardization makes Processing.js an ideal candidate for game developers to develop games without worrying about how the controls will differ between browsers.
 
==3D support==
The introduction of the <canvas> tag into the HTML5 specification allowed Processing to be ported to JavaScript, thus enabling users to run 2D Processing sketches within the browser without additional plug-ins. At the time when porting the Processing.js project began, there was no plug-in free method of delivering 3D content. This limited Processing.js to its 2D functions. WebGL, A ,a JavaScript API that is based on OpenGL ES 2.0, is now being implemented by Firefox, Chrome and Safari. It is has become a viable candidate for use in Processing.js to render 3D sketches1. Additionally, since 0 makes use of WebGL closely matches OpenGL which is used by Processing, the porting of the to support its 3D Processing functions was relatively straight forward.
===Differences between OpenGL and WebGL===The matter of porting 3D Processing to Processing (which uses OpenGL /*1.x?? if it was opengl 2.0 it would have been even easier right?*/) js was simplified because the WebGL interface is similar that of Processing uses OpenGL, but there are a number of differences between the interfacesfor 3D graphics. The single largest difference between WebGL and the OpenGL 1.x library used in Processing is that like OpenGL ES 2.0in WebGL, the fixed-function pipeline was been removed. Because of this, user-defined vertex and fragment shaders were necessary for lighting operations. Since some shapes in Processing aren't lit and others were, multiple shaders were written. One shader exists for lit objects such as boxes and spheres, another less complex shader was written for unlit objects such as lines and points.
The following /* shaders are used for rendering unlit shapes specified with beginto go in a figure on final paper*/end function calls.
<pre>
</pre>
===Typed Arrays=Future Work== Performance is always a concern when rendering 3D content, so it for any interactive multimedia application. Future work for Processing.js will include adding better support for speed improvements. was necessary to create a faster version of JavaScript'script's inherently slow arrays types. Because of this, typed arrays were incorporated into pre-release versions of WebGL browsers. Unlike regular arrays which can contain different types such as strings, numbers and objects, typed arrays can only contain one type and cannot by dynamically resized. Some of these types include Float32Intay, Int32Uinty, Uint16ArrUintnd Uint8Array. These types provide a significant performance increase when manipulating arrays.
(table removed)

Navigation menu