| 1 |
/* Fragment shader utilities used by both Gouraud and Phong shading. |
| 2 |
|
| 3 |
Used by ../castlerendererinternalshader.pas to construct the final shader. |
| 4 |
When you change this file, rerun `make' and then recompile Pascal sources. |
| 5 |
*/ |
| 6 |
|
| 7 |
/* Wrapper for calling PLUG texture_coord_shift */ |
| 8 |
vec2 texture_coord_shifted(in vec2 tex_coord) |
| 9 |
{ |
| 10 |
/* PLUG: texture_coord_shift (tex_coord) */ |
| 11 |
return tex_coord; |
| 12 |
} |
| 13 |
|
| 14 |
// Declare functions defined in tone_mapping.fs |
| 15 |
|
| 16 |
/* sRGB to linear conversion. |
| 17 |
Leaves alpha unmodified. |
| 18 |
|
| 19 |
Input is returned unchanged if CASTLE_GAMMA_CORRECTION not defined. |
| 20 |
*/ |
| 21 |
vec4 castle_texture_color_to_linear(const in vec4 srgbIn); |
| 22 |
|
| 23 |
/* sRGB to linear conversion. |
| 24 |
Input is returned unchanged if CASTLE_GAMMA_CORRECTION not defined. |
| 25 |
*/ |
| 26 |
vec3 castle_texture_color_to_linear(const in vec3 srgbIn); |
| 27 |
|
| 28 |
/* Linear to sRGB conversion and applying tone mapping. |
| 29 |
Input is returned unchanged if |
| 30 |
neither CASTLE_GAMMA_CORRECTION nor CASTLE_TONE_MAPPING are defined. |
| 31 |
*/ |
| 32 |
vec3 castle_linear_to_screen(const in vec3 color); |