flaw-visual-0.1.0.0

LicenseMIT
Safe HaskellNone
LanguageHaskell2010

Flaw.Visual.Pipeline.Deferred

Contents

Description

 
Synopsis

Deferred pipeline with hardcoded shading model.

Opaque pass renders opaque geometry into couple of RTs and depth target:

  • albedo (RT0.RGB)
  • occlusion factor (RT0.A)
  • diffuse factor (RT1.R)
  • specular factor (RT1.G)
  • metalness factor (RT1.B)
  • glossiness (RT1.A)
  • view-space normal (RT2.RGB)
  • depth

Emission pass re-renders opaque geometry with non-zero emission into light RT.

Light pass renders light volumes (or fullscreen quads), calculate lighting and output resulting color.

outputDeferredPipelineOpaquePass Source #

Arguments

:: Node Float3

Result color

-> Node Float4

Albedo + occlusion

-> Node Float4

Material

-> Node Float3

View-space normal

-> Program () 

Output result for opaque pass.

renderDeferredPipelineOpaquePass :: Context c d => DeferredPipeline d -> Render c () Source #

Set up resources for opaque pass.

renderDeferredPipelineLightPass :: Context c d => DeferredPipeline d -> Render c () Source #

Set up resources for light pass.

deferredPipelineLightPassProgram Source #

Arguments

:: Node Float4x4

Inverse projection matrix.

-> (Node Float3 -> Program (Node Float3, Node Float3))

Light program, getting view-space position and returning direction to light and light color

-> Program () 

Light pass program.

deferredPipelineAmbientLightPassProgram Source #

Arguments

:: Node Float4x4

Inverse projection matrix.

-> Node Float3

Ambient light color.

-> Program () 

Ambient light pass program.