DIE Engine
Loading...
Searching...
No Matches
postfx.h File Reference
#include <smmintrin.h>
#include <stdint.h>

Go to the source code of this file.

Functions

void motionBlurSSE4 (uint32_t *frame, uint32_t *previous, uint16_t blend, size_t size)
 Blend the previous frame into the current one (motion blur).
void fadeToSSE4 (uint32_t *frame, size_t size, uint32_t color, uint16_t factor)
 Fade the frame towards a solid color.
void darken4SSE4 (uint32_t *p0, uint32_t *p1, uint32_t *p2, uint32_t *p3, uint16_t factor)
 Scale 4 scattered pixels by a common factor.
void vignetteSSE4 (uint32_t *frame, size_t width, size_t height, int inner_radius, int outer_radius)
 Apply a circular vignette (darkened corners).
void gammaSSE4 (uint32_t *frame, size_t width, size_t height, float ks[3])
 Apply a per-channel smoothstep tone curve.

Function Documentation

◆ darken4SSE4()

void darken4SSE4 ( uint32_t * p0,
uint32_t * p1,
uint32_t * p2,
uint32_t * p3,
uint16_t factor )
inline

Scale 4 scattered pixels by a common factor.

Parameters
factorQ8 darkening factor (0 .. 256 = black .. unchanged)

◆ fadeToSSE4()

void fadeToSSE4 ( uint32_t * frame,
size_t size,
uint32_t color,
uint16_t factor )
inline

Fade the frame towards a solid color.

Parameters
frameframe to fade, in place
sizenumber of pixels (the trailing size % 4 pixels are untouched)
colorpacked ARGB target color
factorQ8 fade amount (0 .. 256 = no change .. full color)

◆ gammaSSE4()

void gammaSSE4 ( uint32_t * frame,
size_t width,
size_t height,
float ks[3] )
inline

Apply a per-channel smoothstep tone curve.

Parameters
ksper-channel gains {kr, kg, kb} (1.0 = full smoothstep)

◆ motionBlurSSE4()

void motionBlurSSE4 ( uint32_t * frame,
uint32_t * previous,
uint16_t blend,
size_t size )
inline

Blend the previous frame into the current one (motion blur).

DIE ENGINE Depth Integration Engine / A modern ray-caster (c) Fred's Lab 2024-2026 Frédéric Meslin / info@.nosp@m.fred.nosp@m.slab..nosp@m.net SPDX-License-Identifier: MIT If used commercially, contributions, donations are highly appreciated.

postfx functions

Parameters
framecurrent frame, receives the blended result
previousprevious frame, overwritten with the blended result
blendQ8 blend factor (0 .. 256 = no blur .. full previous frame)
sizenumber of pixels (the trailing size % 4 pixels are untouched)

◆ vignetteSSE4()

void vignetteSSE4 ( uint32_t * frame,
size_t width,
size_t height,
int inner_radius,
int outer_radius )
inline

Apply a circular vignette (darkened corners).

Parameters
inner_radiusradius where the darkening starts, in pixels
outer_radiusradius where the frame turns black, in pixels