Squeak Class Documentation category index | class index  
 
B3DRenderEngine
  category: Balloon3D-Engine
  superclass: B3DEnginePart
  subclasses: B3DPrimitiveEngine B3DPickerEngine B3DMapperEngine

I represent a facade for all Balloon 3D operations. Clients should only interact with me, not with any of the parts of the engine directly. However, clients may configure me to use certain parts in the 3D rendering pipeline.

Instance variables:
vertexBuffer <B3DVertexBuffer> The vertex buffer passed on through the entire pipeline
transformer <B3DEnginePart> The part performing transform operations
shader <B3DEnginePart> The part performing vertex shading operations
clipper <B3DEnginePart> The part performing view frustum clipping
rasterizer <B3DEnginePart> The part performing final pixel rasterization

instance methods
  attributes
  clearDepthBuffer
clearViewport:
color
color:
cullFace:
fogType:density:rangeStart:rangeEnd:color:
lineWidth
lineWidth:
material
material:
materialColor
materialColor:
normal
normal:
pointSize
pointSize:
polygonMode
polygonMode:
popMaterial
popTexture
pushMaterial
pushTexture
swapInterval
swapInterval:
texCoords
texCoords:
texture
texture:
vertex
vertex:
viewport
viewport:

  draw primitives
  drawPolygonAfter:
drawPolygonMesh:
render:

  indexed primitives
  drawIndexedLines:vertices:normals:colors:texCoords:
drawIndexedQuads:vertices:normals:colors:texCoords:
drawIndexedTriangles:vertices:normals:colors:texCoords:
drawLines:normals:colors:texCoords:
drawPoints:normals:colors:texCoords:

  initialize
  destroy
finish
flush
initialize
reset

  mapping
  asMapperEngine

  morphic-support
  restoreMorphicBackground:under:
restoreMorphicForeground:above:

  picking
  asPickerAt:
asPickerAt:extent:
pickingMatrixAt:extent:
pickingMatrixFor:at:extent:

  private-access
  clipRect
clipRect:
getClipper
getRasterizer
getShader
getTransformer
getVertexBuffer
target
target:
viewportOffset
viewportOffset:

  private-rendering
  privateClipVB:
privateNeedsClipVB:
privateNeedsShadingVB
privatePostClipVB:
privatePreClipVB:
privateRasterizeVB:
privateShadeVB:
privateTransformVB:
privateVisibleVB:
renderPrimitive

  properties
  hasProperty:
properties
removeProperty:
setProperty:toValue:
valueOfProperty:
valueOfProperty:ifAbsent:

  shading
  addLight:
removeLight:
trackAmbientColor
trackAmbientColor:
trackDiffuseColor
trackDiffuseColor:
trackEmissionColor
trackEmissionColor:
trackSpecularColor
trackSpecularColor:

  testing
  hasFrameBufferAccess
isAccelerated

  transforming
  loadIdentity
lookFrom:to:up:
perspective:
popMatrix
pushMatrix
rotateBy:
scaleBy:
transformBy:
translateBy:

class methods
  accessing
  clipper
rasterizer
shader
transformer

  instance creation
  defaultForPlatformOn:
new
newOn:

  testing
  isAvailable
isAvailableFor:

instance methods
  attributes top  
 

clearDepthBuffer


 

clearViewport:


 

color


 

color:


 

cullFace:

Set backface culling. aSymbol must be either #cw, #ccw or nil.


 

fogType:density:rangeStart:rangeEnd:color:

Unsupported here


 

lineWidth

Return the current line width


 

lineWidth:

Set the current line width


 

material


 

material:


 

materialColor


 

materialColor:


 

normal


 

normal:


 

pointSize

Return the current point size


 

pointSize:

Set the current point size


 

polygonMode

Return the current polygon mode (either #points, #lines or nil)


 

polygonMode:

Set the current polygon mode (either #points, #lines or nil)


 

popMaterial


 

popTexture


 

pushMaterial


 

pushTexture


 

swapInterval

Return the swap interval for the receiver (only in HW implementations).


 

swapInterval:

Set the swap interval for the receiver (only in HW implementations).


 

texCoords


 

texCoords:


 

texture


 

texture:

Note: For convenience; the object can be anything that understands #asTexture


 

vertex


 

vertex:


 

viewport


 

viewport:


  draw primitives top  
 

drawPolygonAfter:


 

drawPolygonMesh:

Draw a generic polygon mesh


 

render:


  indexed primitives top  
 

drawIndexedLines:vertices:normals:colors:texCoords:


 

drawIndexedQuads:vertices:normals:colors:texCoords:


 

drawIndexedTriangles:vertices:normals:colors:texCoords:


 

drawLines:normals:colors:texCoords:


 

drawPoints:normals:colors:texCoords:


  initialize top  
 

destroy

Utility - destroy all resources associated with any part of the engine


 

finish

Flush the pipeline and force changes to the output medium


 

flush

Flush the entire pipeline


 

initialize


 

reset


  mapping top  
 

asMapperEngine


  morphic-support top  
 

restoreMorphicBackground:under:

If necessary upload the contents of aRectangle from the rendering target into the engine.


 

restoreMorphicForeground:above:

If necessary upload the contents of aRectangle from the rendering target into the engine.


  picking top  
 

asPickerAt:


 

asPickerAt:extent:


 

pickingMatrixAt:extent:

Return a matrix for picking at the given point using the given extent.


 

pickingMatrixFor:at:extent:

Return a matrix for picking at the given point using the given extent.


  private-access top  
 

clipRect

Return the current clipRect


 

clipRect:

Set the current clipRect


 

getClipper

Private. Return the clipper used with this engine.


 

getRasterizer

Private. Return the rasterizer used with this engine.


 

getShader

Private. Return the shader used with this engine.


 

getTransformer

Private. Return the transformer used with this engine.


 

getVertexBuffer

Private. Return the vertex buffer used with this engine.


 

target

Return the rendering target


 

target:

Set the rendering target


 

viewportOffset

Return the offset for the viewport


 

viewportOffset:

Set the offset for the viewport


  private-rendering top  
 

privateClipVB:

OBSOLETE. Clip the objects in the vertex buffer.


 

privateNeedsClipVB:

Determine if a vertex buffer with the given visibility flag must be clipped.
Return false if either visibleFlag == true (meaning the vertex buffer is completely inside the view frustum) or the rasterizer can clip by itself (it usually can).


 

privateNeedsShadingVB

Return true if the objects in the vertex buffer needs separate shading.
This is determined by checking if
a) lighting is enabled
b) at least one light exists
c) at least one material exists


 

privatePostClipVB:

Clip the objects in the vertex buffer.


 

privatePreClipVB:

Clip the objects in the vertex buffer.


 

privateRasterizeVB:

Rasterize the current primitive from the vertex buffer.


 

privateShadeVB:

Shade all the vertices in the vertex buffer using selected materials and lights


 

privateTransformVB:

Transform the contents of the vertex buffer.
Transforming may include normals (if lighting enabled) and textures (if textures enabled).


 

privateVisibleVB:

Return the visibility of the objects in the vertex buffer.
Return:
true - if completely inside view frustum
false - if completely outside view frustum
nil - if partly inside/outside view frustum


 

renderPrimitive

This is the main rendering loop for all operations


  properties top  
 

hasProperty:

Answer whether the receiver has the given property. Deemed to have it only if I have a property dictionary entry for it and that entry is neither nil nor false


 

properties


 

removeProperty:


 

setProperty:toValue:


 

valueOfProperty:


 

valueOfProperty:ifAbsent:


  shading top  
 

addLight:

Add the given light source to the engine.
Return a handle that can be used to modify the light source later on


 

removeLight:

Remove the light with the given handle from the engine.


 

trackAmbientColor


 

trackAmbientColor:


 

trackDiffuseColor


 

trackDiffuseColor:


 

trackEmissionColor


 

trackEmissionColor:


 

trackSpecularColor


 

trackSpecularColor:


  testing top  
 

hasFrameBufferAccess


 

isAccelerated


  transforming top  
 

loadIdentity


 

lookFrom:to:up:


 

perspective:


 

popMatrix


 

pushMatrix


 

rotateBy:


 

scaleBy:


 

transformBy:


 

translateBy:


class methods
  accessing top  
 

clipper

Return the transformer to use with this engine


 

rasterizer

Return the rasterizer to use with this engine


 

shader

Return the shader to use with this engine


 

transformer

Return the transformer to use with this engine


  instance creation top  
 

defaultForPlatformOn:

Return the render engine that is most appropriate for the current host platform.


 

new

Answer a new instance of the receiver (which is a class) with no indexable variables. Fail if the class is indexable.


 

newOn:


  testing top  
 

isAvailable

Return true if this engine is available (e.g., all of its parts are avaiable)


 

isAvailableFor:

Return true if this engine is available for the given output medium