Blender  V2.59
Public Member Functions | Public Attributes | Protected Attributes
RAS_OpenGLRasterizer Class Reference

#include <RAS_OpenGLRasterizer.h>

Inheritance diagram for RAS_OpenGLRasterizer:
Inheritance graph
[legend]

List of all members.

Public Member Functions

double GetTime ()
 RAS_OpenGLRasterizer (RAS_ICanvas *canv)
virtual ~RAS_OpenGLRasterizer ()
virtual void SetDepthMask (DepthMask depthmask)
virtual bool SetMaterial (const RAS_IPolyMaterial &mat)
virtual bool Init ()
virtual void Exit ()
virtual bool BeginFrame (int drawingmode, double time)
virtual void ClearColorBuffer ()
virtual void ClearDepthBuffer ()
virtual void ClearCachingInfo (void)
virtual void EndFrame ()
virtual void SetRenderArea ()
virtual void SetStereoMode (const StereoMode stereomode)
virtual RAS_IRasterizer::StereoMode GetStereoMode ()
virtual bool Stereo ()
virtual bool InterlacedStereo ()
virtual void SetEye (const StereoEye eye)
virtual StereoEye GetEye ()
virtual void SetEyeSeparation (const float eyeseparation)
virtual float GetEyeSeparation ()
virtual void SetFocalLength (const float focallength)
virtual float GetFocalLength ()
virtual void SwapBuffers ()
virtual void IndexPrimitives (class RAS_MeshSlot &ms)
virtual void IndexPrimitivesMulti (class RAS_MeshSlot &ms)
virtual void IndexPrimitives_3DText (class RAS_MeshSlot &ms, class RAS_IPolyMaterial *polymat, class RAS_IRenderTools *rendertools)
void IndexPrimitivesInternal (RAS_MeshSlot &ms, bool multi)
virtual void SetProjectionMatrix (MT_CmMatrix4x4 &mat)
virtual void SetProjectionMatrix (const MT_Matrix4x4 &mat)
virtual void SetViewMatrix (const MT_Matrix4x4 &mat, const MT_Matrix3x3 &ori, const MT_Point3 &pos, bool perspective)
virtual const MT_Point3GetCameraPosition ()
virtual bool GetCameraOrtho ()
virtual void SetFog (float start, float dist, float r, float g, float b)
virtual void SetFogColor (float r, float g, float b)
virtual void SetFogStart (float fogstart)
virtual void SetFogEnd (float fogend)
void DisableFog ()
virtual void DisplayFog ()
virtual bool IsFogEnabled ()
virtual void SetBackColor (float red, float green, float blue, float alpha)
virtual void SetDrawingMode (int drawingmode)
virtual int GetDrawingMode ()
virtual void SetCullFace (bool enable)
virtual void SetLines (bool enable)
virtual MT_Matrix4x4 GetFrustumMatrix (float left, float right, float bottom, float top, float frustnear, float frustfar, float focallength, bool perspective)
virtual MT_Matrix4x4 GetOrthoMatrix (float left, float right, float bottom, float top, float frustnear, float frustfar)
virtual void SetSpecularity (float specX, float specY, float specZ, float specval)
virtual void SetShinyness (float shiny)
virtual void SetDiffuse (float difX, float difY, float difZ, float diffuse)
virtual void SetEmissive (float eX, float eY, float eZ, float e)
virtual void SetAmbientColor (float red, float green, float blue)
virtual void SetAmbient (float factor)
virtual void SetPolygonOffset (float mult, float add)
virtual void FlushDebugLines ()
virtual void DrawDebugLine (const MT_Vector3 &from, const MT_Vector3 &to, const MT_Vector3 &color)
virtual void SetTexCoordNum (int num)
virtual void SetAttribNum (int num)
virtual void SetTexCoord (TexCoGen coords, int unit)
virtual void SetAttrib (TexCoGen coords, int unit)
void TexCoord (const RAS_TexVert &tv)
const MT_Matrix4x4GetViewMatrix () const
const MT_Matrix4x4GetViewInvMatrix () const
virtual void EnableMotionBlur (float motionblurvalue)
virtual void DisableMotionBlur ()
virtual float GetMotionBlurValue ()
virtual int GetMotionBlurState ()
virtual void SetMotionBlurState (int newstate)
virtual void SetBlendingMode (int blendmode)
virtual void SetFrontFace (bool ccw)

Public Attributes

std::vector< OglDebugLinem_debugLines

Protected Attributes

int m_drawingmode
TexCoGen m_texco [RAS_MAX_TEXCO]
TexCoGen m_attrib [RAS_MAX_ATTRIB]
int m_texco_num
int m_attrib_num
bool m_last_frontface
RAS_IPolyMaterial::TCachingInfo m_materialCachingInfo

Detailed Description

3D rendering device context.

Definition at line 62 of file RAS_OpenGLRasterizer.h.


Constructor & Destructor Documentation

RAS_OpenGLRasterizer::RAS_OpenGLRasterizer ( RAS_ICanvas canv)
RAS_OpenGLRasterizer::~RAS_OpenGLRasterizer ( ) [virtual]

Definition at line 106 of file RAS_OpenGLRasterizer.cpp.


Member Function Documentation

bool RAS_OpenGLRasterizer::BeginFrame ( int  drawingmode,
double  time 
) [virtual]

BeginFrame is called at the start of each frame.

Implements RAS_IRasterizer.

Definition at line 279 of file RAS_OpenGLRasterizer.cpp.

References RAS_ICanvas::BeginFrame(), GPU_BLEND_SOLID, GPU_set_material_blend_mode(), RAS_IRasterizer::KX_SOLID, m_drawingmode, and m_last_frontface.

void RAS_OpenGLRasterizer::ClearCachingInfo ( void  ) [virtual]

ClearCachingInfo clears the currently cached material.

Implements RAS_IRasterizer.

Definition at line 348 of file RAS_OpenGLRasterizer.cpp.

References m_materialCachingInfo.

Referenced by IndexPrimitives_3DText().

void RAS_OpenGLRasterizer::ClearColorBuffer ( ) [virtual]

ClearColorBuffer clears the color buffer.

Implements RAS_IRasterizer.

Definition at line 335 of file RAS_OpenGLRasterizer.cpp.

References RAS_ICanvas::ClearBuffer(), RAS_ICanvas::ClearColor(), and RAS_ICanvas::COLOR_BUFFER.

void RAS_OpenGLRasterizer::ClearDepthBuffer ( ) [virtual]

ClearDepthBuffer clears the depth buffer.

Implements RAS_IRasterizer.

Definition at line 342 of file RAS_OpenGLRasterizer.cpp.

References RAS_ICanvas::ClearBuffer(), and RAS_ICanvas::DEPTH_BUFFER.

Referenced by SetEye().

void RAS_OpenGLRasterizer::DisableFog ( ) [virtual]

Implements RAS_IRasterizer.

Definition at line 215 of file RAS_OpenGLRasterizer.cpp.

void RAS_OpenGLRasterizer::DisableMotionBlur ( ) [virtual]

Implements RAS_IRasterizer.

Definition at line 1155 of file RAS_OpenGLRasterizer.cpp.

void RAS_OpenGLRasterizer::DisplayFog ( ) [virtual]

Implements RAS_IRasterizer.

Definition at line 226 of file RAS_OpenGLRasterizer.cpp.

References RAS_IRasterizer::KX_SOLID, and m_drawingmode.

virtual void RAS_OpenGLRasterizer::DrawDebugLine ( const MT_Vector3 from,
const MT_Vector3 to,
const MT_Vector3 color 
) [inline, virtual]
void RAS_OpenGLRasterizer::EnableMotionBlur ( float  motionblurvalue) [virtual]

Implements RAS_IRasterizer.

Definition at line 1146 of file RAS_OpenGLRasterizer.cpp.

void RAS_OpenGLRasterizer::EndFrame ( ) [virtual]

EndFrame is called at the end of each frame.

Implements RAS_IRasterizer.

Definition at line 385 of file RAS_OpenGLRasterizer.cpp.

References RAS_ICanvas::EndFrame(), and FlushDebugLines().

Referenced by Exit().

void RAS_OpenGLRasterizer::Exit ( ) [virtual]

Exit cleans up the renderer.

Implements RAS_IRasterizer.

Reimplemented in RAS_ListRasterizer, and RAS_VAOpenGLRasterizer.

Definition at line 257 of file RAS_OpenGLRasterizer.cpp.

References EndFrame().

void RAS_OpenGLRasterizer::FlushDebugLines ( ) [virtual]

Implements RAS_IRasterizer.

Definition at line 353 of file RAS_OpenGLRasterizer.cpp.

References i, and m_debugLines.

Referenced by EndFrame().

bool RAS_OpenGLRasterizer::GetCameraOrtho ( ) [virtual]

Implements RAS_IRasterizer.

Definition at line 1076 of file RAS_OpenGLRasterizer.cpp.

const MT_Point3 & RAS_OpenGLRasterizer::GetCameraPosition ( ) [virtual]

Implements RAS_IRasterizer.

Definition at line 1071 of file RAS_OpenGLRasterizer.cpp.

int RAS_OpenGLRasterizer::GetDrawingMode ( ) [virtual]
Returns:
the current drawing mode: KX_BOUNDINGBOX, KX_WIREFRAME, KX_SOLID, KX_SHADED or KX_TEXTURED.

Implements RAS_IRasterizer.

Definition at line 323 of file RAS_OpenGLRasterizer.cpp.

References m_drawingmode.

RAS_IRasterizer::StereoEye RAS_OpenGLRasterizer::GetEye ( ) [virtual]

Implements RAS_IRasterizer.

Definition at line 521 of file RAS_OpenGLRasterizer.cpp.

float RAS_OpenGLRasterizer::GetEyeSeparation ( ) [virtual]

Implements RAS_IRasterizer.

Definition at line 532 of file RAS_OpenGLRasterizer.cpp.

float RAS_OpenGLRasterizer::GetFocalLength ( ) [virtual]

Implements RAS_IRasterizer.

Definition at line 543 of file RAS_OpenGLRasterizer.cpp.

MT_Matrix4x4 RAS_OpenGLRasterizer::GetFrustumMatrix ( float  left,
float  right,
float  bottom,
float  top,
float  frustnear,
float  frustfar,
float  focallength,
bool  perspective 
) [virtual]

Generates a projection matrix from the specified frustum.

Parameters:
leftthe left clipping plane
rightthe right clipping plane
bottomthe bottom clipping plane
topthe top clipping plane
frustnearthe near clipping plane
frustfarthe far clipping plane
Returns:
a 4x4 matrix representing the projection transform.

Implements RAS_IRasterizer.

Definition at line 937 of file RAS_OpenGLRasterizer.cpp.

References RAS_IRasterizer::RAS_STEREO_LEFTEYE, RAS_IRasterizer::RAS_STEREO_RIGHTEYE, MT_Matrix4x4::setValue(), and Stereo().

virtual int RAS_OpenGLRasterizer::GetMotionBlurState ( ) [inline, virtual]

Implements RAS_IRasterizer.

Definition at line 283 of file RAS_OpenGLRasterizer.h.

virtual float RAS_OpenGLRasterizer::GetMotionBlurValue ( ) [inline, virtual]

Implements RAS_IRasterizer.

Definition at line 282 of file RAS_OpenGLRasterizer.h.

MT_Matrix4x4 RAS_OpenGLRasterizer::GetOrthoMatrix ( float  left,
float  right,
float  bottom,
float  top,
float  frustnear,
float  frustfar 
) [virtual]

Generates a orthographic projection matrix from the specified frustum.

Parameters:
leftthe left clipping plane
rightthe right clipping plane
bottomthe bottom clipping plane
topthe top clipping plane
frustnearthe near clipping plane
frustfarthe far clipping plane
Returns:
a 4x4 matrix representing the projection transform.

Implements RAS_IRasterizer.

Definition at line 988 of file RAS_OpenGLRasterizer.cpp.

References MT_Matrix4x4::setValue().

RAS_IRasterizer::StereoMode RAS_OpenGLRasterizer::GetStereoMode ( ) [virtual]

Implements RAS_IRasterizer.

Definition at line 464 of file RAS_OpenGLRasterizer.cpp.

double RAS_OpenGLRasterizer::GetTime ( ) [virtual]

Implements RAS_IRasterizer.

Definition at line 1129 of file RAS_OpenGLRasterizer.cpp.

const MT_Matrix4x4 & RAS_OpenGLRasterizer::GetViewInvMatrix ( ) const [virtual]

Implements RAS_IRasterizer.

Definition at line 561 of file RAS_OpenGLRasterizer.cpp.

const MT_Matrix4x4 & RAS_OpenGLRasterizer::GetViewMatrix ( ) const [virtual]

Implements RAS_IRasterizer.

Definition at line 556 of file RAS_OpenGLRasterizer.cpp.

void RAS_OpenGLRasterizer::IndexPrimitives ( class RAS_MeshSlot ms) [virtual]

IndexPrimitives: Renders primitives from mesh slot.

Implements RAS_IRasterizer.

Reimplemented in RAS_ListRasterizer, and RAS_VAOpenGLRasterizer.

Definition at line 727 of file RAS_OpenGLRasterizer.cpp.

References IndexPrimitivesInternal().

void RAS_OpenGLRasterizer::IndexPrimitives_3DText ( class RAS_MeshSlot ms,
class RAS_IPolyMaterial polymat,
class RAS_IRenderTools rendertools 
) [virtual]
void RAS_OpenGLRasterizer::IndexPrimitivesInternal ( RAS_MeshSlot ms,
bool  multi 
)
void RAS_OpenGLRasterizer::IndexPrimitivesMulti ( class RAS_MeshSlot ms) [virtual]

Implements RAS_IRasterizer.

Reimplemented in RAS_ListRasterizer, and RAS_VAOpenGLRasterizer.

Definition at line 732 of file RAS_OpenGLRasterizer.cpp.

References IndexPrimitivesInternal().

bool RAS_OpenGLRasterizer::Init ( ) [virtual]

Init initialises the renderer.

Implements RAS_IRasterizer.

Reimplemented in RAS_ListRasterizer, and RAS_VAOpenGLRasterizer.

Definition at line 110 of file RAS_OpenGLRasterizer.cpp.

References GPU_BLEND_SOLID, GPU_set_material_blend_mode(), GPU_state_init(), and m_last_frontface.

bool RAS_OpenGLRasterizer::InterlacedStereo ( ) [virtual]
bool RAS_OpenGLRasterizer::IsFogEnabled ( ) [virtual]

Implements RAS_IRasterizer.

Definition at line 220 of file RAS_OpenGLRasterizer.cpp.

void RAS_OpenGLRasterizer::SetAmbient ( float  factor) [virtual]

Implements RAS_IRasterizer.

Definition at line 151 of file RAS_OpenGLRasterizer.cpp.

void RAS_OpenGLRasterizer::SetAmbientColor ( float  red,
float  green,
float  blue 
) [virtual]

Implements RAS_IRasterizer.

Definition at line 143 of file RAS_OpenGLRasterizer.cpp.

void RAS_OpenGLRasterizer::SetAttrib ( TexCoGen  coords,
int  unit 
) [virtual]

Implements RAS_IRasterizer.

Definition at line 657 of file RAS_OpenGLRasterizer.cpp.

References m_attrib, and RAS_MAX_ATTRIB.

void RAS_OpenGLRasterizer::SetAttribNum ( int  num) [virtual]

Implements RAS_IRasterizer.

Definition at line 643 of file RAS_OpenGLRasterizer.cpp.

References m_attrib_num, and RAS_MAX_ATTRIB.

void RAS_OpenGLRasterizer::SetBackColor ( float  red,
float  green,
float  blue,
float  alpha 
) [virtual]

Implements RAS_IRasterizer.

Definition at line 158 of file RAS_OpenGLRasterizer.cpp.

void RAS_OpenGLRasterizer::SetBlendingMode ( int  blendmode) [virtual]

Implements RAS_IRasterizer.

Definition at line 1161 of file RAS_OpenGLRasterizer.cpp.

References GPU_set_material_blend_mode().

void RAS_OpenGLRasterizer::SetCullFace ( bool  enable) [virtual]

Sets face culling

Implements RAS_IRasterizer.

Definition at line 1081 of file RAS_OpenGLRasterizer.cpp.

Referenced by IndexPrimitivesInternal().

void RAS_OpenGLRasterizer::SetDepthMask ( DepthMask  depthmask) [virtual]

SetDepthMask enables or disables writing a fragment's depth value to the Z buffer.

Implements RAS_IRasterizer.

Definition at line 329 of file RAS_OpenGLRasterizer.cpp.

References RAS_IRasterizer::KX_DEPTHMASK_DISABLED.

void RAS_OpenGLRasterizer::SetDiffuse ( float  difX,
float  difY,
float  difZ,
float  diffuse 
) [virtual]

Sets the diffuse color component of the lighting equation.

Implements RAS_IRasterizer.

Definition at line 1116 of file RAS_OpenGLRasterizer.cpp.

void RAS_OpenGLRasterizer::SetDrawingMode ( int  drawingmode) [virtual]
Parameters:
drawingmode= KX_BOUNDINGBOX, KX_WIREFRAME, KX_SOLID, KX_SHADED or KX_TEXTURED.

Implements RAS_IRasterizer.

Reimplemented in RAS_ListRasterizer, and RAS_VAOpenGLRasterizer.

Definition at line 315 of file RAS_OpenGLRasterizer.cpp.

References RAS_IRasterizer::KX_WIREFRAME, and m_drawingmode.

void RAS_OpenGLRasterizer::SetEmissive ( float  eX,
float  eY,
float  eZ,
float  e 
) [virtual]

Sets the emissive color component of the lighting equation.

Implements RAS_IRasterizer.

Definition at line 1122 of file RAS_OpenGLRasterizer.cpp.

void RAS_OpenGLRasterizer::SetEye ( const StereoEye  eye) [virtual]
void RAS_OpenGLRasterizer::SetEyeSeparation ( const float  eyeseparation) [virtual]

Sets the distance between eyes for stereo mode.

Implements RAS_IRasterizer.

Definition at line 527 of file RAS_OpenGLRasterizer.cpp.

void RAS_OpenGLRasterizer::SetFocalLength ( const float  focallength) [virtual]

Sets the focal length for stereo mode.

Implements RAS_IRasterizer.

Definition at line 537 of file RAS_OpenGLRasterizer.cpp.

void RAS_OpenGLRasterizer::SetFog ( float  start,
float  dist,
float  r,
float  g,
float  b 
) [virtual]

Implements RAS_IRasterizer.

Definition at line 199 of file RAS_OpenGLRasterizer.cpp.

References g.

void RAS_OpenGLRasterizer::SetFogColor ( float  r,
float  g,
float  b 
) [virtual]

Implements RAS_IRasterizer.

Definition at line 171 of file RAS_OpenGLRasterizer.cpp.

References g.

void RAS_OpenGLRasterizer::SetFogEnd ( float  fogend) [virtual]

Implements RAS_IRasterizer.

Definition at line 191 of file RAS_OpenGLRasterizer.cpp.

void RAS_OpenGLRasterizer::SetFogStart ( float  fogstart) [virtual]

Implements RAS_IRasterizer.

Definition at line 183 of file RAS_OpenGLRasterizer.cpp.

void RAS_OpenGLRasterizer::SetFrontFace ( bool  ccw) [virtual]

Implements RAS_IRasterizer.

Definition at line 1194 of file RAS_OpenGLRasterizer.cpp.

References m_last_frontface.

void RAS_OpenGLRasterizer::SetLines ( bool  enable) [virtual]

Sets wireframe mode.

Implements RAS_IRasterizer.

Definition at line 1089 of file RAS_OpenGLRasterizer.cpp.

bool RAS_OpenGLRasterizer::SetMaterial ( const RAS_IPolyMaterial mat) [virtual]

SetMaterial sets the material settings for subsequent primitives to be rendered with. The material will be cached.

Implements RAS_IRasterizer.

Definition at line 250 of file RAS_OpenGLRasterizer.cpp.

References RAS_IPolyMaterial::Activate(), and m_materialCachingInfo.

virtual void RAS_OpenGLRasterizer::SetMotionBlurState ( int  newstate) [inline, virtual]

Implements RAS_IRasterizer.

Definition at line 284 of file RAS_OpenGLRasterizer.h.

void RAS_OpenGLRasterizer::SetPolygonOffset ( float  mult,
float  add 
) [virtual]

Sets a polygon offset. z depth will be: z1 = mult*z0 + add

Implements RAS_IRasterizer.

Definition at line 1134 of file RAS_OpenGLRasterizer.cpp.

References RAS_IRasterizer::KX_SHADED, and m_drawingmode.

void RAS_OpenGLRasterizer::SetProjectionMatrix ( MT_CmMatrix4x4 mat) [virtual]

Implements RAS_IRasterizer.

Definition at line 916 of file RAS_OpenGLRasterizer.cpp.

void RAS_OpenGLRasterizer::SetProjectionMatrix ( const MT_Matrix4x4 mat) [virtual]

Set the projection matrix for the rasterizer. This projects from camera coordinates to window coordinates.

Parameters:
matThe projection matrix.

Implements RAS_IRasterizer.

Definition at line 925 of file RAS_OpenGLRasterizer.cpp.

References MT_Matrix4x4::getValue().

void RAS_OpenGLRasterizer::SetRenderArea ( ) [virtual]
void RAS_OpenGLRasterizer::SetShinyness ( float  shiny) [virtual]

Sets the specular exponent component of the lighting equation.

Implements RAS_IRasterizer.

Definition at line 1108 of file RAS_OpenGLRasterizer.cpp.

void RAS_OpenGLRasterizer::SetSpecularity ( float  specX,
float  specY,
float  specZ,
float  specval 
) [virtual]

Sets the specular color component of the lighting equation.

Implements RAS_IRasterizer.

Definition at line 1097 of file RAS_OpenGLRasterizer.cpp.

void RAS_OpenGLRasterizer::SetStereoMode ( const StereoMode  stereomode) [virtual]

SetStereoMode will set the stereo mode

Implements RAS_IRasterizer.

Definition at line 459 of file RAS_OpenGLRasterizer.cpp.

void RAS_OpenGLRasterizer::SetTexCoord ( TexCoGen  coords,
int  unit 
) [virtual]

Implements RAS_IRasterizer.

Definition at line 650 of file RAS_OpenGLRasterizer.cpp.

References m_texco, and RAS_MAX_TEXCO.

void RAS_OpenGLRasterizer::SetTexCoordNum ( int  num) [virtual]

Implements RAS_IRasterizer.

Definition at line 636 of file RAS_OpenGLRasterizer.cpp.

References m_texco_num, and RAS_MAX_TEXCO.

void RAS_OpenGLRasterizer::SetViewMatrix ( const MT_Matrix4x4 mat,
const MT_Matrix3x3 ori,
const MT_Point3 pos,
bool  perspective 
) [virtual]
bool RAS_OpenGLRasterizer::Stereo ( ) [virtual]

Stereo can be used to query if the rasterizer is in stereo mode.

Returns:
true if stereo mode is enabled.

Implements RAS_IRasterizer.

Definition at line 469 of file RAS_OpenGLRasterizer.cpp.

References RAS_IRasterizer::RAS_STEREO_NOSTEREO.

Referenced by GetFrustumMatrix(), and SetViewMatrix().

void RAS_OpenGLRasterizer::SwapBuffers ( ) [virtual]

SwapBuffers swaps the back buffer with the front buffer.

Implements RAS_IRasterizer.

Definition at line 549 of file RAS_OpenGLRasterizer.cpp.

References RAS_ICanvas::SwapBuffers().

void RAS_OpenGLRasterizer::TexCoord ( const RAS_TexVert tv)

Member Data Documentation

TexCoGen RAS_OpenGLRasterizer::m_attrib[RAS_MAX_ATTRIB] [protected]

Definition at line 104 of file RAS_OpenGLRasterizer.h.

Referenced by IndexPrimitives_3DText(), SetAttrib(), and TexCoord().

Definition at line 106 of file RAS_OpenGLRasterizer.h.

Referenced by IndexPrimitives_3DText(), SetAttribNum(), and TexCoord().

Definition at line 268 of file RAS_OpenGLRasterizer.h.

Referenced by FlushDebugLines().

Definition at line 108 of file RAS_OpenGLRasterizer.h.

Referenced by BeginFrame(), Init(), and SetFrontFace().

Stores the caching information for the last material activated.

Definition at line 111 of file RAS_OpenGLRasterizer.h.

Referenced by ClearCachingInfo(), and SetMaterial().

TexCoGen RAS_OpenGLRasterizer::m_texco[RAS_MAX_TEXCO] [protected]

Definition at line 103 of file RAS_OpenGLRasterizer.h.

Referenced by SetTexCoord(), and TexCoord().

Definition at line 105 of file RAS_OpenGLRasterizer.h.

Referenced by SetTexCoordNum(), and TexCoord().


The documentation for this class was generated from the following files: