Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
BlendMode.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
13#pragma once
14
15#include "../../core/Types.hpp"
16
17namespace esengine {
18
22enum class BlendMode : u8 {
23 Normal = 0, // SrcAlpha, OneMinusSrcAlpha (default alpha blending)
24 Additive = 1, // SrcAlpha, One (glow, particles)
25 Multiply = 2, // DstColor, OneMinusSrcAlpha (shadows, multiply)
26 Screen = 3, // One, OneMinusSrcColor (lighten)
27 PremultipliedAlpha = 4, // One, OneMinusSrcAlpha (premultiplied alpha)
28 PmaAdditive = 5, // One, One (additive with premultiplied alpha source)
29 Lighten = 6, // GL_MAX blend equation (take brighter pixel)
30 Darken = 7, // GL_MIN blend equation (take darker pixel)
31 Overlay = 8, // Screen on light, Multiply on dark (requires shader)
32 // No blending: the source replaces the destination. Every other mode reads the
33 // destination for each fragment, which an opaque sprite pays for nothing, and
34 // — the reason this exists — an opaque draw is the only kind that may WRITE
35 // depth, since a blended one has to stay behind the painter's order. Last in
36 // the list rather than first because these values are serialized into material
37 // assets; Normal must stay 0.
38 None = 9,
39};
40
41} // namespace esengine
Core type definitions and utilities for ESEngine.
BlendMode
Predefined blend modes for rendering.
Definition BlendMode.hpp:22
std::uint8_t u8
Unsigned 8-bit integer.
Definition Types.hpp:41