Skip to content

Commit

Permalink
docs: Add premultiplication info
Browse files Browse the repository at this point in the history
  • Loading branch information
eonarheim committed Jan 18, 2024
1 parent ecf17b6 commit b0db627
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions site/docs/04-graphics/4.2-material.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ Excalibur only supports GLSL ES 300 shaders `#version 300 es`, this version decl

:::

:::warning

Excalibur deals in pre-multiplied alphas! This means your shader transparency might not be what you expect.

Generally this can be solved by adding `fragColor.rgb = fragColor.rgb * fragColor.a;` or similar to your code.

Check out [this great post](https://www.realtimerendering.com/blog/gpus-prefer-premultiplication/) about premultiplied alphas

:::

Once a [[Material|material]] is created it can be added/removed from the [[Actor|actor's]] [[GraphicsComponent|graphics component]] by accessing the [[GraphicsComponent.material]] property.

## Passing parameters to Materials
Expand Down

0 comments on commit b0db627

Please sign in to comment.