C# Class renderers.Rasterizer

Represents a software rasterizer that can render BFSOctrees. It supports phong shading and can render models consisting of 200k - 750k voxels in realtime on multi-core systems. The rasterizer is used for testing purposes. If a voxel covers many pixels, the rasterizer doesn't color all of them for performance reasons. It only colors the pixel nearest to the voxel center. This information is encoded in textures which are sent to the GPU, which then fills all pixels of the image (via shaders).
Afficher le fichier Open project: denniskb/asvo

Méthodes publiques

Свойство Type Description
_colorBuffer Color[][]
_depthBuffer SharedDepthBuffer
horRes int

Méthodes publiques

Méthode Description
Rasterizer ( int horRes, int vertRes )

Creates a new Rasterizer.

draw ( GraphicsDevice device ) : void

Called by Game1, draws the final image. This happens independent of a call to Rasterizer.render. If this method is called without calling Rasterizer.render prior to it, an empty screen appears.

loadContent ( GraphicsDevice device, ContentManager cm ) : void

Called by Game1. Initializes textures, buffers, etc.

render ( Object3D object3D, Camera fromPerspective, int threadIndex ) : void

Renders the sparse voxel octree stored in obj. - Viewing frustum culling - Level of detail

Private Methods

Méthode Description
traverse ( Object3D obj, uint offset, int x, int y, int z, Matrix projection, Matrix worldView, Matrix worldViewProjection, byte level, float halfDim, int threadIndex, Vector3 octreeMin ) : void

Traverses all octree nodes and draws them. Used by Rasterizer.render.

Method Details

Rasterizer() public méthode

Creates a new Rasterizer.
public Rasterizer ( int horRes, int vertRes )
horRes int Horizontal screen resolution.
vertRes int Vertixal screen resolution.

draw() public méthode

Called by Game1, draws the final image. This happens independent of a call to Rasterizer.render. If this method is called without calling Rasterizer.render prior to it, an empty screen appears.
public draw ( GraphicsDevice device ) : void
device GraphicsDevice
Résultat void

loadContent() public méthode

Called by Game1. Initializes textures, buffers, etc.
public loadContent ( GraphicsDevice device, ContentManager cm ) : void
device GraphicsDevice
cm ContentManager
Résultat void

render() public méthode

Renders the sparse voxel octree stored in obj. - Viewing frustum culling - Level of detail
public render ( Object3D object3D, Camera fromPerspective, int threadIndex ) : void
object3D Object3D The object to be rendered.
fromPerspective Camera The camera this model shall be rendered from.
threadIndex int The index of the calling thread, starting by 0.
Résultat void

Property Details

_colorBuffer public_oe property

public Color[][] _colorBuffer
Résultat Color[][]

_depthBuffer public_oe property

public SharedDepthBuffer _depthBuffer
Résultat SharedDepthBuffer

horRes public_oe property

public int horRes
Résultat int