Using Exported POD Files

The PowerVR SDK and Tools offers various tools for handling export POD files

Viewing POD files in PVRShaman

POD files can be loaded into PVRShaman, which is the shader composer utility supplied as part of the PowerVR Graphics Tools and SDK. For more information on PVRShaman please refer to the “PVRShaman User Manual”.

Loading POD Data with the PowerVR Framework

The PowerVR Framework makes loading a POD file into a project very simple. The PowerVR Framework is a collection of libraries which are intended to make developing graphics applications much easier. This includes wrapper libraries for graphical APIs Vulkan and OpenGL ES which can automate common tasks and eliminate boilerplate code, and, most importantly in this case, an asset handling module, called PVRAssets.

This module uses the pvr::assets::Model class to represent an entire scene or model. POD data can be loaded into a Model object using the PODReader class.

The following are two simple examples of how to load POD data.

Example of loading a POD file:

// Create the model object
pvr::assets::Model model;

// Prepare a stream for the model from the POD file
pvr::FileStream modelFile(c_szSceneFile);

// Load the model & fill the object
pvr::assets::PODReader podReader(modelFile);

if(model.loadWithReader(podReader) != pvr::Result::Success)
    return false;

// Do stuff

// Model will clean up after it goes out of scope. Still, you can free the memory earlier
model.destroy();

PVRAssets abstracts the source of a file using the Stream classes, meaning the loading of a header/source file is almost identical, but a BufferStream would be used instead of a FileStream.

// Include the scene data
#include “modelH”

// Prepare a stream for the model from the header file
pvr::BufferStream modelMemory(_model_pod_, _model_pod_size_);

// Create the model object
pvr::assets::Model model;

// Load the model & fill the object
pvr::assets::PODReader podReader(modelMemory);

if(model.loadWithReader(podReader) != pvr::Result::Success)
    return false;

// Do stuff

// Model will clean up after it goes out of scope. Still, you can free the memory earlier
model.destroy();

For more information about the PowerVR Framework take a look at the PowerVR Framework Development Guide.