Wire3D

From WiiBrew
Jump to navigation Jump to search
Wire3D
Wire3DLogo.png
General
Author(s)antibyte
TypeFramework library
Version1.2
LicenceGNU Lesser GPL
Links
Download
Website
Discussion
Source

Wire3D (Wii Independent Rendering Engine 3D) is an open source, object oriented, multiplatform 3D engine written in C++, supporting homebrew Wii and Windows (DirectX). It provides a framework to developers for writing platform agnostic 3D applications (including physics using the Bullet Physics library) that run on Wii and Windows out of the box.

The following example applications are included:

Game

This application (Zip-Archive for HBC) demonstrates how to implement a simple first person shooter. The source code also includes the Unity3D project that has been used to export all the assets, scene and physics data for the Game sample, so you can easily add/change objects with physics properties, re-export and test/toy around with the code and content.

Demo

This application (Zip-Archive for HBC) shows how to load a scene using an Importer class and attaches a few controllers manipulating the scene, e.g. controllers rotating fans and moving a conveyor belt, or a controller applying a spline to the camera performing a fly-through of the scene.

Samples

The following samples (Zip-Archive for HBC) serve as tutorials. Their code is well documented and should be read in ascending order, since they build upon concepts that are explained in preceding samples. They are completely self-contained, meaning all objects, textures and the likes are created at runtime, so you can toy around in the sample code, compile and simply use Wiiload to transfer it to the Wii without any further ado. More information about the individual samples can be found in the wiki of the project page.

Key features

  • Platform independent renderer
    • draw call batching of static and dynamic geometry
    • minimizes render state, buffer, light and texture changes
    • creates displaylists (Wii) from static meshes on the fly
    • supports 16/32 bit RGB(A) textures (incl. generation of mipmaps using a Gauss filter)
    • once render objects are bound, no further memory allocations occur at runtime
    • supports 3 ways of rendering
      • visible sets of objects from the scene graph
      • individual objects
      • low-level rendering by manually controlling render states, buffers, etc.
  • Platform independent input system
    • uses input capability system to determine and emulate available input devices at runtime
  • Scene graph
    • various nodes (discrete level of detail, billboard, skybox, light, switch, ...)
    • controller system
    • hierarchical render state, light and effect handling
    • hierarchical culler
      • sequential set of visible objects
      • sorted (by transparency, render state, material and depth) set of visible objects
  • Math supporting doubles and floats
    • vector3, matrix34 (Wii specific optimizations)
    • vector2, vector4, matrix2, matrix3, matrix4, quaternion (generic C++ code)
  • Object system
    • custom run-time type information (rtti)
    • smart pointers (reference linking)
  • Custom template containers
    • array, hash set, hash table, list, sorted map, queue, stack

Physics

Wire3D uses the Bullet Physics library. Bullet can be used for collision detection, ray casting, rigid bodies, ragdolls, motors and many other use cases. As of Wire3D v1.0.1, Bullet is included in the Wire3D repository and download for Wii and Windows. There are no more extra downloads and setup required in order to compile all the samples.

Importer/Exporter

Wire3D comes with an Importer library that reads PNGs, true type fonts et al using Freetype2 and XML scene descriptions that can be exported from Unity3D using the supplied exporter script.

More information can be found here.

Github repo

The Github repository can be found here.

Changelog

The complete changelog can be found here.

v1.2

Wire:

  • added Input System
  • added support for multiple vertex streams per mesh
  • added layer masks to nodes, lights and cameras
  • seperated Image (i.e. buffer) from Texture (i.e. properties)
  • seperated handling of vertex declarations from vertex buffers
  • added usage type STATIC_DISCARD_ON_BIND for textures
  • removed VisibleObject in favour of RenderObject
  • removed scene graph dependency from Renderer
  • improved drawcall batching of static (sub)meshes
  • improved performance of drawing submeshes on PCs with software vertex processing
  • added camera node
  • added light attenuation
  • added blending mode 'BM_ADD' to Material
  • (Wii) added support for submeshes to displaylist handling
  • (Wii) fixed vertex cache issue
  • (Wii) fixed a bug in handling lights
  • (DX9) added support for HLSL shaders
  • (DX9) added support for multiple render targets

Importer/Unity3D exporter:

  • added import/export of collision shapes, rigid bodies and character controller
  • added import/export of skybox
  • added import/export of submeshes
  • added option to combine static meshes
  • added option to export vertex colors as 32bit
  • exporting lights
  • exporting camera
  • exporting fog from RenderSettings
  • added disk and memory statistics summary after export
  • using default values for undefined transformation parameters
  • fixed overwritten default color values in render state
  • fixed incorrect calculation of font texture size
  • fixed text exceeding specified maximum length divided by 6
  • fixed wrong filter mode being used when texture has no mipmaps
  • fixed Importer header files polluting global namespace
  • fixed memory leaks

Samples:

  • added Sample11 to show how to use the input system
  • added Game sample to demonstrate new features
  • rewrote Sample10 to better demonstrate batching

Support

Limited support is supplied here.

Credits

Wire logo by Noogman.

Wire3D framework by antibyte, pieces of code were taken from the following third parties: