Debian Codegraph @

src/scene/glsl/generated-pascal/bump_mapping.vs.inc

raw
1 { -*- buffer-read-only: t -*- }
2 { DON'T EDIT -- this file was automatically generated from "source/bump_mapping.vs" }
3 '/* Bump mapping shader effect.' + LineEnding +
4 ' Included by EnableShaderBumpMapping in ../castlerendererinternalshader.pas unit.' + LineEnding +
5 '*/' + LineEnding +
6 '' + LineEnding +
7 'attribute vec3 castle_Tangent;' + LineEnding +
8 '// attribute vec3 castle_bitangent; // GLSL doesn''t receive this vector anymore, instead GPU can compute it' + LineEnding +
9 'varying mat3 castle_tangent_to_eye_space;' + LineEnding +
10 '' + LineEnding +
11 '// avoid redeclaring variables when no "separate compilation units" available (OpenGLES)' + LineEnding +
12 '#ifndef GL_ES' + LineEnding +
13 ' #if defined(CASTLE_HAS_NORMALS)' + LineEnding +
14 ' uniform mat3 castle_NormalMatrix;' + LineEnding +
15 ' attribute vec3 castle_Normal;' + LineEnding +
16 ' #endif' + LineEnding +
17 '#endif' + LineEnding +
18 '' + LineEnding +
19 'void PLUG_vertex_eye_space(const in vec4 vertex_eye, const in vec3 normal_eye)' + LineEnding +
20 '{' + LineEnding +
21 ' #if defined(CASTLE_HAS_NORMALS)' + LineEnding +
22 ' vec3 bitangent = cross(castle_Normal, castle_Tangent);' + LineEnding +
23 ' mat3 castle_tangent_to_object_space = mat3(' + LineEnding +
24 ' castle_Tangent,' + LineEnding +
25 ' bitangent,' + LineEnding +
26 ' castle_Normal' + LineEnding +
27 ' );' + LineEnding +
28 ' castle_tangent_to_eye_space = castle_NormalMatrix * castle_tangent_to_object_space;' + LineEnding +
29 ' #else' + LineEnding +
30 ' /* Fallback in case you use bump mapping with unlit material that ignores normals. */' + LineEnding +
31 ' castle_tangent_to_eye_space = mat3(1.0);' + LineEnding +
32 ' #endif' + LineEnding +
33 '' + LineEnding +
34 ' /* PLUG: bump_mapping_tangent_space_calculations (vertex_eye, castle_tangent_to_object_space) */' + LineEnding +
35 '}' + LineEnding +
36 ''