Graphics namespace

All the graphics system: rendering, shaders, models, lighting, textures,...

This namespace includes classes related to graphics rendering in the game. Some things included are models, textures and materials.

This namespace is deeply related with the RenderWare namespace; elements in Graphics are high-level representations, easy to use, whereas RenderWare elements are low-level representations which are not needed to modify in most cases.


namespace ActiveState
namespace GlobalState
namespace Renderer_addresses
namespace RenderUtils
This namespace contains most internal stuff related with rendering, such as Direct3D Device and shaders, shader data, etc.


class cBufferDraw
class cFrustumCull
class cImageData
class cImageDataRaw
class cLayerGroup
An implementation of ILayer that renders a sequence of layers.
class cLightingConfig
class cMaterialInfo
class cMaterialManager
The implementation of IMaterialManager; this should only be used for extending and detouring.
class cMeshData
class cMITextureSet
class cModelInstance
class cModelInstanceAnimations
class cModelManager
The implementation of IModelManager; this should only be used for extending and detouring.
class cModelWorld
struct cMWHull
class cMWModelInternal
struct cMWTransformedHull
template<typename T>
class CompiledShader
struct cPlane
struct cRenderJobInfo
class cRenderTargetManager
template<typename ObjClass, uint32_t TYPE_ID>
class cRwDirectResource
struct cScreenInfo
class cShaderDataTextureSet
class cTextureManager
The implementation of ITextureManager; this should only be used for extending and detouring.
struct FilterSettings
template<typename Vertex>
class GeneratedMesh
class GmdlRenderAsset
class IAmbientOccluder
class IGraphicsManager
class ILayer
This interfaces defines a layer that is rendered every game loop, by callings its ILayer::DrawLayer() method.
class ILightingManager
This manager handles the lighting configurations in the game.
class ILightingWorld
A lighting world is a space with a specific lighting configuration.
class IMaterialManager
This manager stores the information of materials, which are used to control the visual appearance of game objects.
class IModelManager
This manager stores the model worlds in the game; for more info, check the IModelWorld class.
class IModelWorld
A model world is a space where models can be rendered in the game.
class IRawImage
class IRenderer
This class manages the rendering process in the game.
class IRenderTargetManager
class IShadowWorld
class ITextureManager
class IThumbnailManager
class LambdaLayer
struct Light
class Material
Represents a material that controls the visual appearance of game objects.
class MaterialShader
class Model
struct MorphHandleInfo
struct NamedShaderDataUniform
class PlanetThumbnailRequest
struct PosNormalVertex
struct PosUvVertex
struct RenderStatistics
struct RenderTargetID
class ShaderBuilder
struct ShaderBuilderEntry
struct ShaderDataInformation
struct ShaderDataUniform
struct ShadowMapInfo
class StandardShader
struct StandardVertex
struct StandardVertexCompact
class Texture
High level representation of a game texture.
class TextureContainer
class UnkMatManager


enum class ModelGroups: uint32_t { DeformHandle = 0x1BA53EA, DeformHandleOverdraw = 0x1BA53EB, Background = 0x223E8E0, Overdraw = 0x22FFF11, EffectsMask = 0x23008D4, TestEnv = 0x26F3933, PartsPaintEnv = 0xFE39DE0, Skin = 0xFEB8DF2, RotationRing = 0x31390732, RotationBall = 0x31390733, SocketConnector = 0x4FF4AF74, AnimatedCreature = 0x509991E6, TestMode = 0x509AA7C9, Vertebra = 0x513CDFC1, PaletteSkin = 0x71257E8B, ExcludeFromPinning = 0x900C6ADD, Palette = 0x900C6AE5, BallConnector = 0x900C6CDD, Rigblock = 0x9138FD8D, RigblockEffect = 0x4FE3913, GameBackground = 0x64AC354 }
enum class LayerIndices { ClearScene = 0, Planets = 7, PlanetRings = 8, TerrainRTT = 9, Terrain = 10, PlanetRibbons1 = 11, TerrainModels = 12, Level = 13, BlobShadows = 14, PreMain = 15, Main = 16, CreatureAnim = 17, PostMain = 18, CreatureFXAnim = 19, EffectsMask = 20, UI = 30 }
The available layer indices that can be used for adding renderers.
enum class LayerIndices2 { Clear = 1, EffectsBackground = 3, Unk4 = 4, Unk5 = 5, Unk6 = 6, TerrainRTT = 7, Terrain = 8, PlanetNationalBoundaries = 9, UnkA = 0xA, BlobShadows = 0xB, UnkC = 0xC, UnkD = 0xD, UnkE = 0xE, UnkF = 0x0F, Unk11 = 0x11, Unk12 = 0x12, Unk14 = 0x14, Unk15 = 0x15, EffectsForeground = 0x16, PlanetTradeRoutes = 0x19, Unk1A = 0x1A, Unk1B = 0x1B, Unk1E = 0x1E, Unk20 = 0x20, Unk21 = 0x21, Unk25 = 0x25 }
enum TextureMessages { kMsgTextureExtractCompleted = 0x522264D }
enum class CollisionMode: uint8_t { BoundingSphere = 0, BoundingBox = 1, HullTriangle = 2, MeshCluster = 3, MeshTriangle = 4 }
enum ModelFlags { kModelFlagUseColor = 0x2, kModelFlagObjectTypeColor = 0x8, kModelFlagOverrideRaycastMode = 0x100, kModelFlagHighRes = 0x2000, kModelFlagIsLoaded = 0x4000, kModelFlagVisible = 0x8000, kModelFlagOverrideBoundingBox = 0x10000, kModelFlagOverrideBoundingRadius = 0x20000, kModelFlagNeedsBake = 0x40000 }
enum TextureFlags { kTextureFlagIsLoading = 1, kTextureFlagForceLoad = 2, kTextureFlagSetLOD = 4, kTextureFlagModified = 8 }


using VertexShader = CompiledShader<IDirect3DVertexShader9>
using PixelShader = CompiledShader<IDirect3DPixelShader9>
using cRwRasterDirectResource = cRwDirectResource<RenderWare::Raster, 0x2F4E681C>
using TextureFilterCallback_t = bool(*)(Texture*)
using ModelPredicate_t = bool(*)(Model*, void*)
using BoneCallback_t = void(*)(int, Matrix4&, Vector3&, void*)


auto Addresses(ActiveState) -> namespace
ASSERT_SIZE(cBufferDraw, 0x1B4)
auto Addresses(cBufferDraw) -> namespace
ASSERT_SIZE(cPlane, 0x28)
ASSERT_SIZE(cFrustumCull, 0xF0)
auto Addresses(cFrustumCull) -> namespace
ASSERT_SIZE(cImageData, 0x14)
ASSERT_SIZE(cImageDataRaw, 0x2C)
ASSERT_SIZE(cLayerGroup, 0x20)
ASSERT_SIZE(cLightingConfig, 0x144)
ASSERT_SIZE(cMaterialInfo, 0x1C)
auto Addresses(cMaterialManager) -> namespace
ASSERT_SIZE(cMeshData, 0x58)
ASSERT_SIZE(cMITextureSet, 0x70)
ASSERT_SIZE(cModelInstance, 0x100)
ASSERT_SIZE(cModelInstanceAnimations, 0xA0)
ASSERT_SIZE(cModelManager, 0x60)
auto Addresses(cModelWorld) -> namespace
ASSERT_SIZE(PixelShader, 0x130)
auto Addresses(CompiledShader) -> namespace
auto GetVertexShaders() -> eastl::vector<VertexShader>&
auto GetPixelShaders() -> eastl::vector<PixelShader>&
auto ReadCompiledVertexShaders(IO::IStream* pStream) -> void
auto ReadCompiledPixelShaders(IO::IStream* pStream) -> void
ASSERT_SIZE(cRenderTargetManager, 0x2C)
auto GenerateScreenPlane(float z = 0.0) -> GeneratedMesh<PosUvVertex>*
auto Addresses(GlobalState) -> namespace
auto Addresses(IGraphicsManager) -> namespace
auto Addresses(ILightingManager) -> namespace
ASSERT_SIZE(Material, 0x48)
auto Addresses(IMaterialManager) -> namespace
auto Addresses(IModelManager) -> namespace
ASSERT_SIZE(cMWTransformedHull, 0x28)
ASSERT_SIZE(MorphHandleInfo, 0x5C)
auto Addresses(IModelWorld) -> namespace
ASSERT_SIZE(cRenderJobInfo, 11* 4)
auto GetMousePosition(int& mouseX, int& mouseY) -> void
auto Addresses(IRenderManager) -> namespace
auto Addresses(IRenderer) -> namespace
auto Addresses(IRenderTargetManager) -> namespace
auto GetMainColorRTT() -> RenderWare::Raster*
auto GetMainDepthRTT() -> RenderWare::Raster*
auto Addresses(IShadowManager) -> namespace
auto Addresses(IShadowWorld) -> namespace
auto Addresses(ITextureManager) -> namespace
ASSERT_SIZE(PlanetThumbnailRequest, 0x2C)
auto Addresses(IThumbnailManager) -> namespace
ASSERT_SIZE(MaterialShader, 0x48)
auto Addresses(MaterialShader) -> namespace
ASSERT_SIZE(Model, 0x94)
ASSERT_SIZE(cMWModelInternal, 0x13C)
auto Addresses(Model) -> namespace
ASSERT_SIZE(RenderStatistics, 0x2C)
auto Addresses(RenderUtils) -> namespace
ASSERT_SIZE(ShaderBuilder, 0x2C8)
auto Addresses(ShaderBuilder) -> namespace
ASSERT_SIZE(StandardShader, 0x348)
auto Addresses(StandardShader) -> namespace

Enum documentation

enum class Graphics::LayerIndices

The available layer indices that can be used for adding renderers.

Most of these have been copied from Darkspore globals.lua, so they might not match for Spore.

enum class Graphics::LayerIndices2



Used by effects renderer.





Renders RTTs used by the planet: water reflection & refraction and scatter map.


Renders planet land, water, atmosphere, etc. Terrain::cTerrainSphere.


Renders the national boundaries in a planet. Used by PlanetRibbonGfx (part of Simulator::cPlanetModel).



Used by Simulator BlobShadowManager.










Used by effects renderer, renders foreground screen effects.


Renders the trade route ribbons in a planet. Used by PlanetRibbonGfx (part of Simulator::cPlanetModel).







enum class Graphics::CollisionMode: uint8_t


Only use the bounding radius to intersect.


Only use the bounding box to intersect.


Check intersection with the hull mesh.


Check intersection with the LOD0 mesh, in an optimized but more imprecise way.


Check intersection with the LOD0 mesh triangle geometry, the slowest but most precise.

enum Graphics::TextureFlags


Tells the texture is still loading.


Forces the texture to load. If no .raster exists, this will look for rw4 as well.


If enabled, SetLOD() will be called to the texture with the current level of detail.


Tells that the texture has been modified and the changes have not been saved.

Typedef documentation

typedef bool(*Graphics::ModelPredicate_t)(Model*, void*)

typedef void(*Graphics::BoneCallback_t)(int, Matrix4&, Vector3&, void*)

Function documentation