ColorBlindnessPostProcessor
Implements
Index
Constructors
constructor
Parameters
_colorBlindnessMode: ColorBlindnessMode
simulate: boolean = false
Returns ColorBlindnessPostProcessor
Accessors
colorBlindnessMode
Returns ColorBlindnessMode
Parameters
colorBlindMode: ColorBlindnessMode
Returns void
simulate
Returns boolean
Parameters
value: boolean
Returns void
Methods
initialize
Called once when the post processor is added to the graphics context
Parameters
graphicsContext: ExcaliburGraphicsContextWebGL
Returns void
process
sourceis the current (MSAA-resolved) screen framebuffer, render the result intodestination, for example with a ShaderPass or ShaderPipeline.Parameters
source: Framebuffer
destination: Framebuffer
Returns void
PostProcessors apply a shader effect to the entire screen at the end of the frame.
Implement PostProcessor.process: the current (MSAA-resolved) screen arrives as
sourceand the result must be rendered intodestination— typically with a ShaderPass or ShaderPipeline. Because the shape matches ShaderPipelineLike, effect objects like BloomEffect or BlurEffect can be added as post processors directly:game.graphicsContext.addPostProcessor(new ex.BloomEffect({ graphicsContext }));Use ShaderPipelinePostProcessor to build one from a list of fragment sources.
Fragment shaders in a ShaderPass/ShaderPipeline get these built-ins:
uniform sampler2D u_image- the current screen (or previous pass output)uniform vec2 u_resolution- the destination resolution (in pixels)uniform vec2 u_texelSize-1.0 / source resolutionuniform float u_time_ms- total time in millisecondsuniform float u_elapsed_ms- elapsed milliseconds since the last framein vec2 v_uv- 0-1 UV over the screenThe deprecated single-pass path receives
u_imageat slot 0 plusu_time_ms,u_elapsed_ms, andu_resolutionwhen declared; custom uniforms can be updated in PostProcessor.onUpdate.