| TGX 1.0.8 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...
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>
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 >
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()

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>

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.