C# 클래스 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).
파일 보기 프로젝트 열기: denniskb/asvo

공개 프로퍼티들

프로퍼티 타입 설명
_colorBuffer Color[][]
_depthBuffer SharedDepthBuffer
horRes int

공개 메소드들

메소드 설명
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

비공개 메소드들

메소드 설명
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.

메소드 상세

Rasterizer() 공개 메소드

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

draw() 공개 메소드

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
리턴 void

loadContent() 공개 메소드

Called by Game1. Initializes textures, buffers, etc.
public loadContent ( GraphicsDevice device, ContentManager cm ) : void
device GraphicsDevice
cm ContentManager
리턴 void

render() 공개 메소드

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.
리턴 void

프로퍼티 상세

_colorBuffer 공개적으로 프로퍼티

public Color[][] _colorBuffer
리턴 Color[][]

_depthBuffer 공개적으로 프로퍼티

public SharedDepthBuffer _depthBuffer
리턴 SharedDepthBuffer

horRes 공개적으로 프로퍼티

public int horRes
리턴 int