| TGX 1.1.4 A tiny 2D/3D graphics library optimized for 32 bits microcontrollers.

Loading...
Searching...
No Matches
Functions
Shaders.h File Reference

Triangle shader functions. More...

`#include "ShaderParams.h"`

Go to the source code of this file.

## Functions
TGX_INLINE int | tgx::shaderclip (int v, int maxv)
| for texture clamping
template<typename color_t , typename ZBUFFER_t >
void | tgx::shader_test (const int32_t oox, const int32_t ooy, const int32_t lx, const int32_t ly, const int32_t dx1, const int32_t dy1, int32_t O1, const tgx::RasterizerVec4 &fP1, const int32_t dx2, const int32_t dy2, int32_t O2, const tgx::RasterizerVec4 &fP2, const int32_t dx3, const int32_t dy3, int32_t O3, const tgx::RasterizerVec4 &fP3, const tgx::RasterizerParams< color_t, color_t, ZBUFFER_t > &data)
| For test purposes...
TGX_INLINE int | tgx::tgx_clamp_i32 (const int x, const int lo, const int hi)
TGX_INLINE uint16_t | tgx::tgx_rgb565_pack_raw_u16 (const int r, const int g, const int b)
TGX_INLINE int | tgx::tgx_rgb565_r5 (const RGB565 c)
TGX_INLINE int | tgx::tgx_rgb565_g6 (const RGB565 c)
TGX_INLINE int | tgx::tgx_rgb565_b5 (const RGB565 c)
TGX_INLINE RGB565 | tgx::tgx_rgb565_modulate256 (const RGB565 c, const int mr, const int mg, const int mb)
TGX_INLINE RGB565 | tgx::tgx_rgb565_bilinear_fast (const RGB565 &C00, const RGB565 &C10, const RGB565 &C01, const RGB565 &C11, const float ax, const float ay)
TGX_INLINE RGB565 | tgx::tgx_rgb565_bilinear_modulate256 (const RGB565 &C00, const RGB565 &C10, const RGB565 &C01, const RGB565 &C11, const float ax, const float ay, const int mr, const int mg, const int mb)
TGX_INLINE RGB565 | tgx::tgx_make_rgb565_from_raw (const int r, const int g, const int b)
template<typename color_t , typename ZBUFFER_t , bool USE_ZBUFFER, bool USE_GOURAUD, bool USE_TEXTURE, bool USE_ORTHO, bool TEXTURE_BILINEAR, bool TEXTURE_WRAP, bool USE_UNLIT, bool USE_TEXTURE_AFFINE>
TGX_UBER_SHADER_INLINE void | tgx::uber_shader_inline (const int32_t oox, const int32_t ooy, const int32_t lx, const int32_t ly, const int32_t dx1, const int32_t dy1, int32_t O1, const RasterizerVec4 &fP1, const int32_t dx2, const int32_t dy2, int32_t O2, const RasterizerVec4 &fP2, const int32_t dx3, const int32_t dy3, int32_t O3, const RasterizerVec4 &fP3, const RasterizerParams< color_t, color_t, ZBUFFER_t > &data)
| UBER-SHADER for all 3D rendering variants. More...
template<typename color_t , typename ZBUFFER_t , bool USE_ZBUFFER, bool USE_GOURAUD, bool USE_TEXTURE, bool USE_ORTHO, bool TEXTURE_BILINEAR, bool TEXTURE_WRAP, bool USE_UNLIT, bool USE_TEXTURE_AFFINE>
void | tgx::uber_shader (const int32_t oox, const int32_t ooy, const int32_t lx, const int32_t ly, const int32_t dx1, const int32_t dy1, int32_t O1, const RasterizerVec4 &fP1, const int32_t dx2, const int32_t dy2, int32_t O2, const RasterizerVec4 &fP2, const int32_t dx3, const int32_t dy3, int32_t O3, const RasterizerVec4 &fP3, const RasterizerParams< color_t, color_t, ZBUFFER_t > &data)
| UBER-SHADER for all 3D rendering variants. More...
template<int SHADER_FLAGS_ENABLED, typename color_t , typename ZBUFFER_t >
TGX_SHADER_SELECT_INLINE void | tgx::shader_select (const int32_t oox, const int32_t ooy, const int32_t lx, const int32_t ly, const int32_t dx1, const int32_t dy1, int32_t O1, const RasterizerVec4 &fP1, const int32_t dx2, const int32_t dy2, int32_t O2, const RasterizerVec4 &fP2, const int32_t dx3, const int32_t dy3, int32_t O3, const RasterizerVec4 &fP3, const RasterizerParams< color_t, color_t, ZBUFFER_t > &data)
| META-Shader THAT DISPATCH TO THE CORRECT Shader ABOVE (IF ENABLED).
template<bool USE_BLENDING, typename color_t_im >
void | tgx::shader_2D_gradient (const int32_t oox, const int32_t ooy, const int32_t lx, const int32_t ly, const int32_t dx1, const int32_t dy1, int32_t O1, const RasterizerVec4 &fP1, const int32_t dx2, const int32_t dy2, int32_t O2, const RasterizerVec4 &fP2, const int32_t dx3, const int32_t dy3, int32_t O3, const RasterizerVec4 &fP3, const RasterizerParams< color_t_im, color_t_im, float > &data)
| 2D shader (gradient)
template<bool USE_BLENDING, bool USE_MASKING, bool USE_GRADIENT, typename color_t_im , typename color_t_tex >
void | tgx::shader_2D_texture (const int32_t oox, const int32_t ooy, const int32_t lx, const int32_t ly, const int32_t dx1, const int32_t dy1, int32_t O1, const RasterizerVec4 &fP1, const int32_t dx2, const int32_t dy2, int32_t O2, const RasterizerVec4 &fP2, const int32_t dx3, const int32_t dy3, int32_t O3, const RasterizerVec4 &fP3, const RasterizerParams< color_t_im, color_t_tex, float > &data)
| 2D shader (texture)
template<typename BLEND_OP , typename color_t_im , typename color_t_tex >
void | tgx::shader_2D_texture_blend_op (const int32_t oox, const int32_t ooy, const int32_t lx, const int32_t ly, const int32_t dx1, const int32_t dy1, int32_t O1, const RasterizerVec4 &fP1, const int32_t dx2, const int32_t dy2, int32_t O2, const RasterizerVec4 &fP2, const int32_t dx3, const int32_t dy3, int32_t O3, const RasterizerVec4 &fP3, const RasterizerParams< color_t_im, color_t_tex, float, BLEND_OP > &data)
| 2D shader (texture with custom blending operator)

## Detailed Description

Triangle shader functions.

## Function Documentation

## ◆ uber_shader_inline()

template<typename color_t , typename ZBUFFER_t , bool USE_ZBUFFER, bool USE_GOURAUD, bool USE_TEXTURE, bool USE_ORTHO, bool TEXTURE_BILINEAR, bool TEXTURE_WRAP, bool USE_UNLIT, bool USE_TEXTURE_AFFINE>

TGX_UBER_SHADER_INLINE void tgx::uber_shader_inline | ( | const int32_t | oox,
|  | const int32_t | ooy,
|  | const int32_t | lx,
|  | const int32_t | ly,
|  | const int32_t | dx1,
|  | const int32_t | dy1,
|  | int32_t | O1,
|  | const RasterizerVec4 & | fP1,
|  | const int32_t | dx2,
|  | const int32_t | dy2,
|  | int32_t | O2,
|  | const RasterizerVec4 & | fP2,
|  | const int32_t | dx3,
|  | const int32_t | dy3,
|  | int32_t | O3,
|  | const RasterizerVec4 & | fP3,
|  | const RasterizerParams< color_t, color_t, ZBUFFER_t > & | data
| ) |  |
| inline

UBER-SHADER for all 3D rendering variants.

forced-inline version

## ◆ uber_shader()

template<typename color_t , typename ZBUFFER_t , bool USE_ZBUFFER, bool USE_GOURAUD, bool USE_TEXTURE, bool USE_ORTHO, bool TEXTURE_BILINEAR, bool TEXTURE_WRAP, bool USE_UNLIT, bool USE_TEXTURE_AFFINE>

void tgx::uber_shader | ( | const int32_t | oox,
|  | const int32_t | ooy,
|  | const int32_t | lx,
|  | const int32_t | ly,
|  | const int32_t | dx1,
|  | const int32_t | dy1,
|  | int32_t | O1,
|  | const RasterizerVec4 & | fP1,
|  | const int32_t | dx2,
|  | const int32_t | dy2,
|  | int32_t | O2,
|  | const RasterizerVec4 & | fP2,
|  | const int32_t | dx3,
|  | const int32_t | dy3,
|  | int32_t | O3,
|  | const RasterizerVec4 & | fP3,
|  | const RasterizerParams< color_t, color_t, ZBUFFER_t > & | data
| ) |  |

UBER-SHADER for all 3D rendering variants.

Uses compile-time flags to generate optimized code for each specific case.