Class TGLRenderer

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TGLRenderer = class(TObject)

Description

Hierarchy

  • TObject
  • TGLRenderer

Overview

Fields

Public PrepareRenderShape: Cardinal;

Methods

Public constructor Create(AttributesClass: TRenderingAttributesClass; ACache: TGLRendererContextCache);
Public destructor Destroy; override;
Public procedure Prepare(State: TX3DGraphTraverseState);
Public procedure UnprepareTexture(Node: TAbstractTextureNode);
Public procedure UnprepareAll;
Public procedure RenderBegin(ABaseLights: TLightInstancesList; LightRenderEvent: TLightRenderEvent; const APass: TRenderingPass);
Public procedure RenderEnd;
Public procedure RenderShape(Shape: TX3DRendererShape; Fog: IAbstractFogObject);
Public procedure UpdateGeneratedTextures(Shape: TShape; TextureNode: TAbstractTextureNode; const Render: TRenderFromViewFunction; const ProjectionNear, ProjectionFar: Single; var NeedsRestoreViewport: boolean; CurrentViewpoint: TAbstractViewpointNode; CameraViewKnown: boolean; const CameraPosition, CameraDirection, CameraUp: TVector3Single);
Public procedure PrepareScreenEffect(Node: TScreenEffectNode);

Properties

Public property Attributes: TRenderingAttributes read FAttributes;
Public property Cache: TGLRendererContextCache read FCache;

Description

Fields

Public PrepareRenderShape: Cardinal;

If > 0, RenderShape will not actually render, only prepare per-shape resources for fast rendering (arrays and vbos).

Methods

Public constructor Create(AttributesClass: TRenderingAttributesClass; ACache: TGLRendererContextCache);

Constructor. Always pass a cache instance — preferably, something created and used by many scenes.

Public destructor Destroy; override;
 
Public procedure Prepare(State: TX3DGraphTraverseState);

Prepare given State, to be able to render shapes with it. Between preparing and unpreparing, nodes passed here are "frozen": do not change, do not free them.

Public procedure UnprepareTexture(Node: TAbstractTextureNode);

Release resources for this texture.

Public procedure UnprepareAll;

Release every OpenGL and VRML resource. That is release any knowledge connecting us to the current OpenGL context and any knowledge about your prepared VRML nodes, states etc.

Calling UnprepareAll is valid (and ignored) call if everything is already released.

Destructor callls UnprepareAll automatically. So be sure to either call UnprepareAll or destroy this renderer when your OpenGL context is still active.

Public procedure RenderBegin(ABaseLights: TLightInstancesList; LightRenderEvent: TLightRenderEvent; const APass: TRenderingPass);
 
Public procedure RenderEnd;
 
Public procedure RenderShape(Shape: TX3DRendererShape; Fog: IAbstractFogObject);
 
Public procedure UpdateGeneratedTextures(Shape: TShape; TextureNode: TAbstractTextureNode; const Render: TRenderFromViewFunction; const ProjectionNear, ProjectionFar: Single; var NeedsRestoreViewport: boolean; CurrentViewpoint: TAbstractViewpointNode; CameraViewKnown: boolean; const CameraPosition, CameraDirection, CameraUp: TVector3Single);

Update generated texture for this shape.

NeedsRestoreViewport will be set to True if viewport was (possibly) changed by this procedure (otherwise, NeedsRestoreViewport will not be modified).

Public procedure PrepareScreenEffect(Node: TScreenEffectNode);

Load GLSL shader for the ScreenEffect node. Makes sure that Node.ShaderLoaded is true. When changing Node.ShaderLoaded false to true tries to initialize the shader, setting Node.Shader if some GLSL program was successfully loaded.

The GLSL program (TGLSLProgram) will be stored here, and will be automatically freed during UnprepareAll call.

Properties

Public property Attributes: TRenderingAttributes read FAttributes;

Rendering attributes. You can change them only when renderer is not tied to the current OpenGL context, so only after construction or after UnprepareAll call (before any Prepare or Render* calls).

Public property Cache: TGLRendererContextCache read FCache;
 

Generated by PasDoc 0.13.0 on 2014-10-26 05:15:14