Archive for the ‘3d’ Category

Sunday, July 25th, 2010

Alessandro Pignotti’s project looks to be the start of something good to come. Lightspark Open Source Flash Player [github]has some really nice features that should influence the Flash Player and maybe even draw some interest from Adobe?  Maybe it can be like the Moonlight player for Silverlight only broader.

One such awesome feature is OpenGL GLSL hardware rendered shaders for elements of flash. Flash has Pixel Bender which is pretty nice but having GLSL shaders and the use of OpenGL directly is great.

Features

  • JIT compilation of ActionScript to native x86 bytecode using LLVM
  • Hardware accelerated rendering using OpenGL Shaders (GLSL)
  • Very good and robust support for current-generation ActionScript 3
  • A new, clean, codebase exploiting multithreading and optimized for modern hardware. Designed from scratch after the official Flash documentation was released.
Friday, July 2nd, 2010

Unity is a great and agile company that responded to the iOS4 changes with something very nice, a C++ option to develop with the Unity engine on the iOS. They will implement this if using Mono is barred which so far hasn’t happened.  I have to say I wish this was an option for the Unity Engine all the time and hope they implement it anyways. For now Joachim Ante on the the Unity blog says this:

We continue to be excited about the iPhone, iPod touch and iPod as platform targets for Unity developers. While we don’t think C++ is the best language to write game code , using C++ as a scripting language has memory and performance advantages on low-end devices. This is a great feature to have for developers who want to squeeze the last ounce of memory & performance out of their games.

We still can’t believe Apple will force developers into choosing a specific language for development. And as mentioned, Apple is still approving every Unity-based game we know of. In case the situation changes, rest assured that we are working this Plan B.

We’ll be ready to talk more about this as well as share some time-line information with you soon, while of course waiting to find out if any of this will actually be necessary.

The Unity Plan B is that the C++ engine code that mimics as closely as it can to the Mono .net C# or Javascript code. From the samples on the blog the C++ and Mono (javascript in this case) samples are really similar.

Many current engines are legacy or have lots of bloat, unless you write your own, or maybe even still then. Though this is looking really clean for C++ game engine code, at least in comparison to current industry leaders for indie engines.

It would be a beautiful C++ library to use even if Apple doesn’t require it. Compared to the other indie game engines out this would be a sweet C++ engine for indies and hope they do this no matter. C++ can be written cleanly and with influence from a simplified C#/Javascript engine and clean API it makes for a killer C++ engine that makes sense. Right now native is really attrctive on embedded for some years to come.

A very basic comparison from their blog:

Javascript Sample

function Update(){
    //Spin the object around the world origin
    transform.RotateAround(Vector3.zero, Vector3.up, 20 * Time.deltaTime);
}

C# Sample

using System.Collections;
using UnityEngine;
public class Example  : MonoBehaviour {
    void Update(){
        //Spin the object around the world origin
        transform.RotateAround(Vector3.zero, Vector3.up, 20 * Time.deltaTime);
    }
}

C++ Sample

#include "UnityEngine.h"
class Example : public MonoBehaviour {
public:
    void Update() {
        transform.RotateAround(Vector::zero, Vector3::up, 20 * Time::GetDeltaTime());
    }
};

Things I am wondering…

  • Will this help porting to Android versions if they use the NDK?
  • How much smaller will my app be if I use the C++ version (attractive feature since the mono dlls are pretty big – even though I really dig mono)?
  • Wouldn’t a C++ version be a better base with pluggable scripting in C# if you want? Maybe an option for Lua with a similar API signature for all? Ok maybe over-engineering there…
Friday, May 7th, 2010

Google has decided to put weight behind WebGL and stop actively developing O3D as a plugin, rather they will make O3D a Javascript library on top of WebGL. This will focus the 3D plugin development efforts from Google into just WebGL on top of the OpenGL ES 2 spec, which in turn runs in the html5 <canvas> tag.

WebGL is pretty exciting offering browser based OpenGL and hardware rendered graphics. When this becomes mainstream this will change up gaming and interactive on the web immensely. Unity 3D and Flash 3d engines add lots of immersive environments and WebGL will be just as exciting, if all browsers adopt it (canvas/webgl).

At Google, we’re deeply committed to implementing and advancing standards, so as of today, the O3D project is changing direction, evolving from its current plug-in implementation into a JavaScript library that runs on top of WebGL. Users and developers will still be able to download the O3D plug-in and source code for at least one year, but other than a maintenance release, we plan to stop developing O3D as a plug-in and focus on improving WebGL and O3D as a JavaScript library.

About WebGL

WebGL is a cross-platform, royalty-free web standard for a low-level 3D graphics API based on OpenGL ES 2.0, exposed through the HTML5 Canvas element as Document Object Model interfaces. Developers familiar with OpenGL ES 2.0 will recognize WebGL as a Shader-based API using GLSL, with constructs that are semantically similar to those of the underlying OpenGL ES 2.0 API. It stays very close to the OpenGL ES 2.0 specification, with some concessions made for what developers expect out of memory-managed languages such as JavaScript.

WebGL brings plugin-free 3D to the web, implemented right into the browser. Major browser vendors Apple (Safari), Google (Chrome), Mozilla (Firefox), and Opera (Opera) are members of the WebGL Working Group. “It feels like, someone’s missin-ing”

Friday, March 19th, 2010

UPDATE: Due to retractions it cannot be entirely confirmed that IE9 will support <canvas> of html5 spec.  They are the last browser and they must support it for it to be a real, valid solution for 2d animation.  GPU supported <canvas> would be a huge innovation but would also most likely kill Silverlight for animation, unless they integrate <canvas>.  Standards are such a tough bet, ask Adobe with the ES4 bet.  Since standards are so tough to get through and are design by committee many times, plugins still have a huge advantage of changing easily. We’ll keep an eye on IE9 to see if the <canvas> revolution will happen soon or if it will be years off.  It will most likely be years off for mainstream at any rate.

Could it be that Microsoft is innovating again?  IE9 will supposedly be largely hardware accelerated for all graphical elements and possibly <canvas> and <video> html5 tags? IE9 test drive preview available here.

It appears Microsoft has been enjoying the Apple, Adobe, Google smackdowns on each other, got lost in the dust kicked up and just done what many developers want: hardware acceleration. Firefox 3.7 also has hardware acceleration coming down the pike.

Specifically, IE9 will take advantage of the underlying hardware in different ways, both from a visual perspective as well as code execution perspective:

  • The MSHTML rendering layer has been enhanced to use Direct2D and DirectWrite instead of GDI.  Direct2D enables GPU accelerated 2D graphics and text, and allows sub-pixel positioning.  In addition, the GPU is used for scaling (bitmaps are mapped to textures), which is ideal for zooming and moving images around the screen.  This GPU support translates directly into improved readability of pages, more precise placement of text and images, and smooth scrolling and zooming.
  • JavaScript performance is greatly improved from older versions of Internet Explorer, and should be competitive if not better than competing browsers.  In the past, JavaScript in IE was interpreted and not compiled into native processor instructions.  The JavaScript engine now includes a JIT compiler which emits x86 instructions and compiles the code before it runs, resulting in a dramatic performance uplift.  Instruction generation can also be tailored to the underlying processor to take full advantage of the underlying platform.
  • IE9 is more standards compliant than previous versions, with new support for HTML5 elements such as <video>, CSS3 support, and SVG support.  All graphic elements will be accelerated on the GPU and will enable hardware accelerated rendering contexts for application development, improving visual display, reducing CPU usage, and improving power usage.

There is no excuse in this age where most people have at least a 32MB cards even on the lowly intel OEM cards to not take some advantage of hardware rendering/acceleration for aspects of web content including video, 2d, games and even 3d.

There are lots of other areas of browsers and tech that is hardware accelerated such as plugins like Unity (and Director waaay before that), video, and new tools like WebGL/O3D. Firefox 3.7 is also aiming for hardware acceleration.  This idea of browser graphical elements not just in a plugin or video player being hardware accelerated is something that might spark some very interesting and innovative experiences.

I applaud this effort and hope there is truth in it beyond just a preview that has features cut.  I also hope more browsers and plugins start doing the same besides just IE9 and Firefox. This entire blog has pretty much had an underlying hardware rendering/acceleration slant.  I have been pushing this for sometime and I believe the time is coming soon that web developers will be equipped with the power that native and game developers have for graphics soon, mainly for applications, games and experiences.

The best news is that IE9 will support html5 and <canvas>, <video> tags and ensures the new functionality that web developers will be able to use.  We’ll all have to wait for 2-3 years probably before it is something that is 90% saturated and usable in the mainstream market but it is good to know great times lie ahead.

I can’t believe I just wrote about IE possibly innovating ahead of others.

Tuesday, March 9th, 2010

Unity is showing no signs of slowing down in making a consolidated, easy pipeline for game developers and creators to bring their wares to the masses on the top platforms. Already Unity 3D is the best 3d web browser plugin at the current time with export paths to web, desktop (mac and PC), iPhone/touch and Wii. But now we will see support for PS3, iPad (obvious as it is a iPhone/touch) and Android (most likely with the help of the C++ NDK rather than the Java SDK).  XBOX 360 support was announced last year.

This is pretty huge even for such a small and innovative company. I guess it means it will be time to buy an upgrade soon. Unity so far has been giving feature after feature for free for current license holders, this one seems big enough to justify a major version increase.

Gamasutra comments on other great features:

This third iteration will also incorporate Umbra Software’s occlusion culling product, which is designed help performance for games with large, open scenes and complex geometry. The platform’s top-end version, Unity Pro, will include both Umbra and Beast at no additional cost.

Unity Technologies updated its Unity iPhone for version 3.0 to include streaming audio support for smaller build size, Bluetooth multiplayer support, faster in-game GUIs”, and a 2D sprite engine. Furthermore, the company’s iPhone product will offer performance improvements that promise to provide faster frame rates.

The company says that with its new platform support for PlayStation 3, iPad, and Android, it offers developers an opportunity to target a larger install base than any other game engine. Unity’s game engine currently can produce games for Windows, Mac, iPhone, and Wii, with support for Xbox 360 announced last October.

Friday, February 12th, 2010

Balder was one of the first 3d prototype engines in Silverlight and it has evolved quite nicely.  Balder by Einar Ingebrigtsen is described as a “Managed GameEngine with both 2D and 3D support targetting Silverlight, Xna and OpenGL.”

The sample browser will show you what Balder is capable of and it has come pretty far since the first version showing a wireframe teapot.

You know you’ve made it as a 3D engine when there are Augmented Reality apps for it.

Here’s a glance at what some of the C# source looks like for a feel of the engine code from the Silverlight4 TestApp:

using Balder.Core.Execution;
using Balder.Core.Objects.Geometries;
using System;
using Balder.Core.Lighting;
using Balder.Core;
using Colors=System.Windows.Media.Colors;
 
namespace Balder.Silverlight4.TestApp
{
    public class MyGame : Game
    {
        public override void OnInitialize()
        {
 
            Camera.Position.X = 0;
            Camera.Position.Y = 0;
            Camera.Position.Z = -80;
 
            var light = new OmniLight();
            light.Diffuse = Color.FromSystemColor(Colors.Green);
            light.Ambient = Color.FromSystemColor(Colors.Green);
            light.Specular = Color.FromSystemColor(Colors.White);
            light.Position.X = 0;
            light.Position.Y = 0;
            light.Position.Z = -130;
 
            Scene.AddNode(light);
 
            base.OnInitialize();
        }
 
 
        public override void OnLoadContent()
        {
            var teapot = ContentManager.Load("teapot.ase");
            Scene.AddNode(teapot);
            base.OnLoadContent();
        }
 
 
        private double _sin;
 
        public override void OnUpdate()
        {
 
            Camera.Position.X = (float)(Math.Sin(_sin)*80);
            Camera.Position.Y = 0;
            Camera.Position.Z = (float)(Math.Cos(_sin) * 80);
 
            _sin += 0.05;
            base.OnUpdate();
        }
 
    }
}
Wednesday, January 27th, 2010

Tim Knip, a papervision core developer, has brought a pipeline improvement for users of Blender to import blender files directly into papervision and as3. This allows you to get at the blender objects, or blender DNA as it is called, that construct the 3d scene within Blender.

Unity3D has a great workflow that includes this where you can update your .blend file and then it updates in the Unity IDE, this work by Tim creates a similar workflow for Flash (recompile would be needed to show if embedded).

Typically exporters are made from the 3d IDE SDKs such as Blender using Python to export to COLLADA or other formats.  But here Tim is parsing the source file directly.  This also opens up the possibility to make other exporters from more simplified Flash AS3 code rather than learning a new IDE SDK just for an exporter.

I am not sure how much people want to embed .blend files with their applications as there is more information in the .blend file for the Blender app and it will add to the download.  But what this might do it inspire others to create simplified exporters from Tim’s work for Blender to COLLADA, 3ds and more that work well with papervision and flash 3d engines, directly in Flash.  So instead of learning each IDE to build an exporter that is the same, this solution could act as a proxy or middle man to simplify exporter creation, pretty much any Flash coder that understands 3d could build one from .blend files at a minimum.  If it was made as a higher level abstraction so the 3d software source could be swapped out it may open up simplified exporter tools a bit.  Since it is really just reading the binary data in the file, in theory other formats could do the same (3dsmax, Maya, Milkshape, etc).

There is a whole host of opportunities with this new tool! It is definitely nice to have this as I use Blender for Flash 3D and Unity 3D most often.  It will be interesting to see how this evolves.

Note from Tim on the tool:

I created a library to read Blender files (.blend) directly. So no
more headaches with broken exporters!

Grab the code here:
http://github.com/timknip/asblender/tree/papervision3d

Here’s a first example:
https://dl.dropbox.com/u/438592/blender/PapervisionTest.swf

And its code:
http://github.com/timknip/asblender/blob/papervision3d/src/PapervisionTest.as

ASBlender is simply a library which reads *everything* in a .blend file. So in theory you could grab materials, animations, armatures, the works… But its up to *you* to grab the relevant bits, since *all* the data is accessible.

Of course: this means you need to study the .blend format, see
http://wiki.github.com/timknip/asblender/ for more information.

Sample Code Snippet posted by Tim:

[Embed (source="/assets/crystal_cube.blend", mimeType="application/octet-stream")]
public var BlenderData:Class;

var blend:BlendFile = new BlendFile();

blend.read(new BlenderData());

if (blend.scenes.length) {
    // Blender can have multiple scenes, don't know yet how to grab the "active" scene.
  buildScene(blend.scenes[0]);
}

/**
 * Prints out the DNA as contained in the .blend
 */
private function printDNA(blend:BlendFile):void {
  var struct:DNAStruct;
  var field:DNAField;

  for each (struct in blend.dna.structs) {
    var type:String = blend.dna.types[ struct.type ];

    trace(type);

    for each (field in struct.fields) {
      trace(field.type + " " + field.name);
    }
  }
}

private function buildScene(scene:Object):void {

  var obj:Object = scene.base.first;

  while (obj) {
    // grab the Blender Object.
    // The Blender Object defines rotation, scale, translation etc.
    var object:Object = obj.object; 

    trace("Object name: " + object.id.name + " type: " + object.type + " matrix: " + object.obmat);

    //for (var key:String in object) {
    //  trace(key);
    //}

    if (object.data) {
      switch (object.type) {
        case 1:  // Mesh
          trace (" - Mesh: " + object.data.id.name);
          buildMesh(object.data);
          break;
        case 10: // Lamp
          trace (" - Lamp: " + object.data.id.name);
          break;
        case 11: // Camera
          trace (" - Camera: " + object.data.id.name);
          break;
        default:
          break;
      }
    }

    obj = obj.next;
  }
}

private function buildMesh(mesh:Object):void {
  var numVertices:int = mesh.totvert;
  var numFaces:int = mesh.totface;
  var i:int;

  trace(" - #verts : " + numVertices);

  for (i = 0; i < numVertices; i++) {
    var v:Object = mesh.mvert[i];

    var x:Number = v.co[0];
    var y:Number = v.co[1];
    var z:Number = v.co[2];

    trace(" - - vertex: " + x + " " + y + " " + z);
  }

  trace(" - #faces : " + numFaces);

  for (i = 0; i < numFaces; i++) {
    var f:Object = mesh.mface[i];

    var v1:int = f.v1;
    var v2:int = f.v2;
    var v3:int = f.v3;
    var v4:int = f.v4;

    trace(" - indices: " + v1 + " " + v2 + " " + v3 + " " + v4);

    if (mesh.mtface) {
      // UV coords are defined
      var tf:Object = mesh.mtface[i];

      trace(" - - - uv: " + tf.uv);
    }
  }
}
Wednesday, December 2nd, 2009

If the question is if Unity can do interactives as smooth and stylish as Flash I think you may soon find out.  Carlos Ulloa of Papervision 3D fame has kicked it up a notch in Unity 3D with this interactive very reminiscent of the Ford Focus demo that helped bring in Papervision 3D for flash in style. Gotta say though a mini is much better than a Ford Focus.

Flash is still the leader in web interactives and even marketing interactive 3d, Unity largely replaced Director and tools like it and high-end hardware rendered required interactives and games. This interactive by HelloEnjoy has loads of polygons, unity physics system, lighting, environment mapping, showroom cameras, reflection, skid decals, highly detailed mesh and more.  Just take a peek inside the vehicle and at the rims for the detail that is impossible with the 2000 poly limit of Flash 3D software rendered engines.

Web interactives this heavy aren’t doable in a non hardware rendered player like Flash.  Unity is looking to pretty much own this level of quality in a browser.  I don’t think I have seen another interactive looking this good with Unity 3D.

Unity still is lacking many features that Flash has in support of making interactives for the web such as webcam support, mic support, better video support, better gui system, html support (although flash barely) and a larger install base but Unity could easily take the high-end advertising market in addition to owning highly immersive games that need hardware rendering which it is already doing for web gaming.  It is 2010 soon, most computers have a decent video card.  Put them to use!

Wednesday, October 28th, 2009

Unity 3D Indie is now free for all developers and just called Unity now.  The Unity 3D Pro license is still $1500 and worth every penny.  But this news is great for indies and moreso the pro users that want the Unity Web Player to have more penetration and installs in the market.

Companies like EA, Cartoon Network and Lego are using Unity 3D and just about every game developer I know including myself has been excited about the possibility of an engine that allows creation of hardware rendered web based games and desktop games, which are multi-platform and paths into the mobile market (iPhone/Touch) and console like Wii and XBOX in development (for additional licenses).

When Unity 3D released support for Windows as a development environment in addition to Mac it  literally blew up as predicted this year. Also, Unity 2.6 is out which is big because it finally supports third party source control such as Subversion and Perforce. Many of the barriers that were keeping it from integration into gaming pipelines are gone:  the price, the single platform and the source code integration issues.  Unity 3D has addressed all those issues.

What are you waiting for? Get your Unity3D on!

Saturday, October 3rd, 2009

Torque 3D is out of beta and officially released to the world.  Torque was one of the first indie affordable game engines and they continue that work at Garage Games with a web enabled Torque 3D output much like the Unity 3D player.

The pipeline is not yet as streamlined as  as Unity 3D as Torque has many legacy formats and components such as DTS models, DIF interiors and DSQ animation files that are specific to the Torque Engine.  But they have added support for COLLADA models and the community is strong for Torque 3D. Also, since Torque 3D is built on an older engine but updated for modern uses, the file formats and loading is streamlined for low poly and web based games that need small asset sizes but still have quality.

Like Unity 3D there are many paths to truly get your game published and available to many platforms from desktop on Windows and Mac to web players in all major browsers (and iPhone, Wii and XBox with more $$$). This is an amazing time in game development.

When I initially got into heavier game development in early 2003 after moving from Half-life to Unreal and then the affordable Torque, there were two major things missing, a web player export and a good editor with intellisense.  Torque 3D provides the web player export and Torsion is a great IDE for TorqueScript beyond using Visual Studio or XCode for C++ source editing.

Some really nice tools include the River Editor and Road and Path editor that complement the great terrain editor and scene and asset editors that make production fairly quick in the Torque tool chain.

Road and Path Editor

Road and Path Editor – Torque 3D from TorquePowered on Vimeo.

River Editor

River Editor – Torque 3D from TorquePowered on Vimeo.

The good news is there is now two quality toolsets in Unity 3D and Torque that for about $1500 you can get a good pipeline and engine that will enable you to create great immersive games for many platforms and the web.  If you got the skills the platforms are there to get your game out to the world whichever platform you choose.  Similarly to the Flash vs Silverlight vs Canvas progress, with competition in this area it will keep both platforms innovating and supporting developers needs first.

For more immersive games that require hardware rendering beyond Flash capabilities Unity 3D and Torque 3D are now here for your creations.