g3d design goals c++ library of code common to every 3d project write once, compile everywhere safe...

6
G3D Design Goals C++ library of code common to every 3D project Write once, compile everywhere Safe and fast Prototype a game in one week Maximize flexibility

Upload: stella-mclaughlin

Post on 27-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: G3D Design Goals C++ library of code common to every 3D project Write once, compile everywhere Safe and fast Prototype a game in one week Maximize flexibility

G3D Design Goals

•C++ library of code common to every 3D project

•Write once, compile everywhere

•Safe and fast

•Prototype a game in one week

•Maximize flexibility

Page 2: G3D Design Goals C++ library of code common to every 3D project Write once, compile everywhere Safe and fast Prototype a game in one week Maximize flexibility

Architecture

Application FrameworkHardwar

e Renderin

g

3DMath

NetworkFile System

Data Struct.

CPU GPU

OS OpenGL

Your Program

Page 3: G3D Design Goals C++ library of code common to every 3D project Write once, compile everywhere Safe and fast Prototype a game in one week Maximize flexibility

Transparency Example

•G3D::Texture:

•Independent of other rendering classes

•fromGLID(), openGLID()

•invertY

Page 4: G3D Design Goals C++ library of code common to every 3D project Write once, compile everywhere Safe and fast Prototype a game in one week Maximize flexibility

Key Design Decisions

•Reference counting memory management

•No scene graph (i.e., no Entity, Model)

•No boost

•zlib, libpng, libjpeg, ODE

Page 5: G3D Design Goals C++ library of code common to every 3D project Write once, compile everywhere Safe and fast Prototype a game in one week Maximize flexibility

G3D Programmable Pipeline

Pixel Processo

r

Vertex Processo

r

Rasterizer

Output Merger

CPU

Shader, ArgList

Texture

RenderDevice::setBlendFunc, setAlphaTest, setStencilTest, setStencilFunc, setDepthTest

VAR

Framebuffer

Display

Page 6: G3D Design Goals C++ library of code common to every 3D project Write once, compile everywhere Safe and fast Prototype a game in one week Maximize flexibility

Alternative Designs

Proposed Design Why Rejected?

Java Performance, OpenGL integration, user base

No RenderDevice Need GL abstraction to minimize state changes

Bohm Collector Performance concerns, complicates API, runtime compatibility

libSDL for Windowing LGPL concerns, requires extra DLL on Win32

wxWidgets Requires major build system integration, no UI inside 3D