C# Class Nez.DeferredLighting.DeferredLightingRenderer

handles deferred lighting. This Renderer should be ordered after any of your Renderers that render to a RenderTexture. Any renderLayers rendered by this Renderer should have Renderables with DeferredSpriteMaterials (or null Material to use the default, diffuse only Material).
Inheritance: Renderer
显示文件 Open project: prime31/Nez

Public Properties

Property Type Description
diffuseRT RenderTexture
enableDebugBufferRender bool
lightRT RenderTexture
normalRT RenderTexture
renderLayers int[]

Public Methods

Method Description
DeferredLightingRenderer ( int renderOrder, int lightLayer ) : System
onSceneBackBufferSizeChanged ( int newWidth, int newHeight ) : void
render ( Scene scene ) : void

we override render completely here so we can do our thing with multiple render targets

setAmbientColor ( Color color ) : DeferredLightingRenderer

ambient lighting color. Alpha is ignored

setClearColor ( Color color ) : DeferredLightingRenderer

clear color for the diffuse portion of the gbuffer

unload ( ) : void

Protected Methods

Method Description
debugRender ( Scene scene, Camera cam ) : void

Private Methods

Method Description
clearRenderTargets ( ) : void
renderAllBuffers ( Scene scene ) : void
renderFinalCombine ( Scene scene ) : void
renderLight ( AreaLight light ) : void
renderLight ( DeferredLight light ) : void
renderLight ( DirLight light ) : void
renderLight ( PointLight light ) : void
renderLight ( SpotLight light ) : void
renderLights ( Scene scene ) : void
renderSprites ( Scene scene ) : void

Method Details

DeferredLightingRenderer() public method

public DeferredLightingRenderer ( int renderOrder, int lightLayer ) : System
renderOrder int
lightLayer int
return System

debugRender() protected method

protected debugRender ( Scene scene, Camera cam ) : void
scene Scene
cam Camera
return void

onSceneBackBufferSizeChanged() public method

public onSceneBackBufferSizeChanged ( int newWidth, int newHeight ) : void
newWidth int
newHeight int
return void

render() public method

we override render completely here so we can do our thing with multiple render targets
public render ( Scene scene ) : void
scene Scene scene.
return void

setAmbientColor() public method

ambient lighting color. Alpha is ignored
public setAmbientColor ( Color color ) : DeferredLightingRenderer
color Color Color.
return DeferredLightingRenderer

setClearColor() public method

clear color for the diffuse portion of the gbuffer
public setClearColor ( Color color ) : DeferredLightingRenderer
color Color Color.
return DeferredLightingRenderer

unload() public method

public unload ( ) : void
return void

Property Details

diffuseRT public_oe property

public RenderTexture diffuseRT
return RenderTexture

enableDebugBufferRender public_oe property

if true, all stages of the deferred pipeline are rendered after the final combine
public bool enableDebugBufferRender
return bool

lightRT public_oe property

public RenderTexture lightRT
return RenderTexture

normalRT public_oe property

public RenderTexture normalRT
return RenderTexture

renderLayers public_oe property

the renderLayers this Renderer will render
public int[] renderLayers
return int[]