Support Forum       Library Source       SourceForge Page       Web Page
Wiki Doc Data API Index APIs by Level APIs by Task


Selected APIs by Task

This page lists the most commonly used G3D APIs grouped into functional tasks:

  • Images and Video
  • Strings
  • File I/O
  • Ray Tracing and Physics
  • Network
  • Memory and Threads
  • Boldface links designate the most common and easy-to-use features. Indented links are subtopics; they may be helper classes or subclasses. Not all API entry points are shown in this index.

    Primary Scene Graph

    Integrated high-level infrastructure for physically-based (photorealistic) shader-driven GPU rendering and CPU ray tracing. See also All Scene Graph

    ArticulatedModelLoad 3DS, IFS, PLY2, and OFF files, or construct models from code
    Material
    Material::Settings
    SuperBSDF
    Component(See also MapComponent, Component1, Component3, Component4)
    BumpMap
    SuperSurface

    LightingPoint, spot, directional, hemisphere ambient, and environment map
    Sky
    SkyParameters
    GLight

    SuperShaderCustomizable GPU shader for use with Material
    Pass
    NonShadowedPass
    ExtraLightPass
    ShadowedPass
    GBufferSaito and Takahashi's Geometry Buffers for deferred shading.

    GCameraPinhole camera with clipping planes
    ShadowMap
    GBufferSaito and Takahashi's Geometry Buffers for deferred shading.

    Immediate Mode Rendering

    RenderDeviceAbstraction of a graphics rendering context.
    TextureA 1D, 2D, or 3D array (e.g., an image) stored on the GPU, commonly used for mapping reflectance values (colors) over meshes.
    ShaderA pair of functions written in GLSL that are invoked by the GPU per vertex and per pixel.
    FramebufferHolds a set of G3D::Textures or G3D::Renderbuffers for use as draw targets.
    VertexBufferA block of GPU memory within which G3D::VertexRanges can be allocated.
    VertexRangeA block of GPU memory storing a stream of vector data (e.g., vertices, normals, texture coordinates).

    2D Graphical User Interface

    GAppFor each frame, the GApp has several tasks that can be implemented by overriding base class methods.
    GuiPaneContainer and creator of other GUI controls; obtained from a GuiWindow
    GuiWindowSkinnable GUI (documentation contains GUI sample code)
    GEvent, GEventTypeEvent class and type enum, used inside an event handler
    GFontExplicitly render text
    GApp::onEvent, GApp::onUserInputOverridable event handlers
    BackgroundWidgetA full-screen texture that sits behind everything else in the scene.
    UserInputPollable keyboard, mouse, and joystick state used inside an event handler
    GuiButton, GuiCheckBox, GuiDropDownList, GuiSlider, GuiRadioButton, GuiLabel, GuiTextBox, GuiTextureBoxGUI controls created by GuiPanel
    Widget
    Surface2D2D object scene graph, used by Widgets for rendering
    ManipulatorExports a coordinate frame, typically in response to user input.
    FirstPersonManipulatorUses a First Person (Quake- or World of Warcraft style) mapping to translate keyboard and mouse input into a flying camera position.
    ThirdPersonManipulatorBy default, the ThirdPersonManipulator moves an object relative to its own axes.
    msgBoxCreate a new OS window popup message

    Debugging

    debugAssertAssertion macro with friendly dialog box in DEBUG builds
    debugPrintfPrints to the 3D console, terminal, and log.txt
    screenPrintfPrints information that repeats every frame to the screen
    debugDrawDraw a shape for debugging purposes
    consolePrintfPrints to the 3D console and log.txt
    logPrintfPrints to log.txt
    GApp::debugPaneAdd your own debugging GUI controls to this provided window
    debugPrintfPrints to the terminal (Unix) or Output Window (Win) in DEBUG builds
    logPrintfPrints to the log.txt file (which you should regularly check for warnings!)
    DrawRender simple geometric primitives without loading a model
    debugAssertMAssertion macro with a string message in DEBUG builds
    alwaysAssertMAssertion macro that remains even in optimized builds
    GApp::catchCommonExceptionsTurn uncaught exceptions into assertion failures
    LogGuarantees output is written to disk before Log::printf returns
    describeSystemReturns a string describing the current machine
    isValidHeapPointerUsed in assertions to identify bad pointers
    isValidPointerUsed in assertions to identify bad pointers
    setAssertionHookOverride the behavior of assertion failures
    setFailureHookOverride the behavior of alwaysAssertM failures in RELEASE builds
    GApp::showDebugTextEnable GApp::debugPrintf output

    Profiling

    ProfilerMeasures execution time on the CPU and GPU of parts of a program.
    StopwatchAccurately measure durations and framerates.
    RenderDevice::StatsReports measured GPU performance and throughput.
    GApp::showRenderingStatsDisplay performance information on the 3D window
    System::mallocPerformance, System::mallocStatus, System::resetMallocPerformanceCountersMeasure heap size and detect memory leaks
    System::beginCycleCount, System::endCycleCountCycle-accurate timing of very short routines

    Supplemental Scene Graph

    SkySkybox, moon, sun, and stars
    IFSModelRigid body
    ArticulatedModelRigid bodies connected by joints, loads 3DS and IFS models
    BSPMapQuake 3 map
    MD2ModelQuake 2 character
    SurfaceStatic object that is prepared for rendering. Exposes geometry and adjacency information
    GCameraPinhole perspective camera abstraction
    ShapeGeometric primitives primarily used for bounding volumes and debugging
    MaterialBSDF; surface material properties

    Shadows

    Shadow rendering algorithms first determine shadowed locations, and then paint ambient illumination everywhere, and finally add illumination only in non-shadowed areas. There are two major algorithms for determining the shadowed locations in real-time, shadow volumes and shadow maps. G3D supports both, on programmable and fixed function hardware.

    ShadowMapShadow map allocation and rendering
    Surface::renderShadowedLightPassRender shadow volume shadows on any model (when used with begin/endMarkShadows)
    RenderDevice::configureShadowMapFixed function shadow map rendering
    Texture::createEmpty(...ImageFormat::DEPTH24, Texture::Settings::shadow)Create an empty shadow map
    SuperShader::configureShadowShaderArgsProgrammable pipeline shadow map rendering
    Surface::renderShadowMappedLightPassRender shadow mapped shadows on any model
    beginMarkShadows, markShadows, endMarkShadowsCompute and render stenciled shadow volumes

    Image Processing

    VideoInputRead from AVI, MPG and other video files in real-time
    VideoOutputWrite video files
    Draw::rect2DStretch a Texture over a rectangle on screen
    TextureGPU image representation
    FramebufferAn "off-screen" rendering surface used for image processing on the GPU
    Image3RGB floating point image
    Image1Monochrome floating point image
    Image4RGBA floating point image
    Image1uint88-bit Monochrome image
    Image3uint824-bit RGB image
    Image4uint832-bit RGBA image
    Color1, Color3, Color4Floating-point monochrome, RGB, and RGBA color (no clamping)
    Color1uint8, Color3uint8, Color4uint88-bit Monochrome, 24-bit RGB, and 32-bit RGBA color (clamped to 0-1 / 0-255)
    GImageFast but harder to use mono-8, RGB-24, or RGBA-32 image
    Map2DTemplated image class, e.g., for creating normal maps or arbitrary grids of values
    WrapModeSpecifies how out-of-bounds image locations are treated for Texture, Map2D, and Image classes
    gaussian1DGenerate 1D blur filter coefficients
    GaussianBlurFast GPU 1D blur
    ToneMapGamma correct, adaptation, and bloom for realistic lighting

    String Processing

    beginsWith, endsWith

    formatConvert numbers to strings (a safe sprintf)

    isSlash, isWhiteSpace, isDigit, isNewline, isLetter, isQuote

    stringSplit, stringJoin

    toUpper, toLowerChange case

    trimWhitespaceRemove blanks at the beginning and end of a string

    STRMacro for creating large blocks of quoted text, usually used with Shader

    TextInput(TextInput::FROM_STRING, ...)Tokenizer for parsing complex strings

    File I/O

    AnyEncodes typed, structured data and can serialize it to a human readable format that is very similar to the Python language's data syntax.
    BinaryInput, BinaryOutput
    TextInput, TextOutput
    getFiles, getDirsGet a directory listing, including wildcards
    readWholefile, writeWholeFile
    AnyValCan hold any common value and read/write tables of named values. Very useful for making configuration files
    copyFile
    createTempFile

    filenameContainsWildcards, filenameBaseExt, filenameExt, filenamePath, pathConcat, parseFilenameFilename parsing and manipulation
    isDirectory, fileIsNewer, fileExists, fileLengthFile testing and comparison

    Ray Tracing and Physics

    Ray tracing and physical simulation both compute intersections between geometric primitives. G3D distinguishes between "moving" collision detection, where two objects are moving with relative constant velocity; and "fixed" detection where where the relative velocity of the objects is zero. The two problems are related. A "moving point" is the same as a fixed ray, a "moving sphere" is a fixed capsule, and so on. Thus for ray tracing one often uses "moving point" collision detection instead of rays (which is reasonable, since ray tracing simulates photons moving around a scene).

    TriTreeStatic bounding interval hierarchy for Ray-Tri intersections.
    Intersect
    CollisionDetectionMoving and fixed collisions between many kinds of primitives
    Ray, Sphere, Plane, Box, AABox, Triangle, Tri, Plane, Line, Cylinder, Capsule, Shape Geometric primitives
    DirectionHistogramA histogram on the surface of a sphere.
    MeshAlgRoutines for operating on triangle meshes
    KDTreeAxis-aligned binary space partition tree for O(log n) collision detection
    PointKDTreeAABSP tree optimized for zero-extent objects. Primarily used as a photon map
    GCamera::worldRayObtain the ray through a pixel
    Image3, Image4Useful for software rendering output and texture maps
    Vector3::reflectionDirection, Vector3::refractionDirection

    Networking

    ReliableConduitMessage-based TCP infrastructure ideal for most games
    NetListenerServer-side way of listening for incoming connections
    BinaryInput, BinaryOutputUsed by serialize/deserialize methods to binary encode messages for transfer.
    NetAddressIP, port, and hostname addressing
    LightweightConduitMessage-based UDP infrastructure. Allows multi-cast and NAT traversal, but at the cost of unreliable transfer.

    Memory and Threads

    GThreadPlatform independent thread implementation.
    ThreadSetManages a set of threads.
    GMutexMutual exclusion lock used for synchronization.
    SpinlockA mutual exclusion lock that busy-waits when locking.
    AtomicInt32An integer that may safely be used on different threads without external locking.
    MemoryManagerAbstraction of memory management.
    AlignedMemoryManagerAllocates memory on 16-byte boundaries.
    CRTMemoryManagerMemoryManager implemented using the C runtime.
    AreaMemoryManagerAllocates memory in large blocks and then frees it as an area.

    G3D Innovation Engine documentation generated on Fri Nov 20 15:04:16 2009 using doxygen 1.5.9