R2 Core Shaders

R2SurfaceTypes.h
Go to the documentation of this file.
1 #ifndef R2_SURFACE_TYPES_H
2 #define R2_SURFACE_TYPES_H
3
4 /// \file R2SurfaceTypes.h
5 /// \brief Types for deferred surface shading
6
7 #include "R2SurfaceOutput.h"
8
9 /// Interpolated vertex data that all deferred surface shaders will receive.
10
11 struct R2_vertex_data_t {
12 /// Eye-space surface position
13 vec4 position_eye;
14 /// Clip-space surface position
15 vec4 position_clip;
16 /// Positive eye-space Z position
17 float positive_eye_z;
18 /// Object-space UV
19 vec2 uv;
20 /// Object-space vertex normal
21 vec3 normal_vertex;
22 /// Tangent vector
23 vec3 tangent;
24 /// Bitangent vector
25 vec3 bitangent;
26 };
27
28 /// Derived surface data that all deferred surface shaders will receive.
29
30 struct R2_surface_derived_t {
31 /// Final uncompressed eye-space normal produced by bump/normal mapping
32 vec3 normal_bumped;
33 };
34
35 /// Textures that are required by all surfaces
36
37 struct R2_surface_textures_t {
38 /// RGB normal map texture
39 sampler2D normal;
40 };
41
42 /// Matrices related to the rendered instance that all deferred surface shaders will receive.
43
44 struct R2_surface_matrices_instance_t {
45 /// Object-space to Eye-space matrix
46 mat4x4 transform_modelview;
47 /// Object-space to Eye-space normal matrix
48 mat3x3 transform_normal;
49 /// UV matrix
50 mat3x3 transform_uv;
51 };
52
53 #endif // R2_SURFACE_TYPES_H
R2_vertex_data_t::uv
vec2 uv
Object-space UV.
Definition: R2SurfaceTypes.h:19
R2_surface_matrices_instance_t::transform_normal
mat3x3 transform_normal
Object-space to Eye-space normal matrix.
Definition: R2SurfaceTypes.h:48
R2_vertex_data_t::normal_vertex
vec3 normal_vertex
Object-space vertex normal.
Definition: R2SurfaceTypes.h:21
R2_surface_derived_t::normal_bumped
vec3 normal_bumped
Final uncompressed eye-space normal produced by bump/normal mapping.
Definition: R2SurfaceTypes.h:32
R2_vertex_data_t::position_clip
vec4 position_clip
Clip-space surface position.
Definition: R2SurfaceTypes.h:15
R2_vertex_data_t::positive_eye_z
float positive_eye_z
Positive eye-space Z position.
Definition: R2SurfaceTypes.h:17
R2_vertex_data_t::tangent
vec3 tangent
Tangent vector.
Definition: R2SurfaceTypes.h:23
R2_vertex_data_t::position_eye
vec4 position_eye
Eye-space surface position.
Definition: R2SurfaceTypes.h:13
R2SurfaceOutput.h
Types describing calculated surfaces.
R2_surface_matrices_instance_t::transform_modelview
mat4x4 transform_modelview
Object-space to Eye-space matrix.
Definition: R2SurfaceTypes.h:46
R2_surface_matrices_instance_t::transform_uv
mat3x3 transform_uv
UV matrix.
Definition: R2SurfaceTypes.h:50
R2_surface_textures_t
Textures that are required by all surfaces.
Definition: R2SurfaceTypes.h:37
R2_vertex_data_t
Interpolated vertex data that all deferred surface shaders will receive.
Definition: R2SurfaceTypes.h:11
R2_vertex_data_t::bitangent
vec3 bitangent
Bitangent vector.
Definition: R2SurfaceTypes.h:25
R2_surface_textures_t::normal
sampler2D normal
RGB normal map texture.
Definition: R2SurfaceTypes.h:39
R2_surface_derived_t
Derived surface data that all deferred surface shaders will receive.
Definition: R2SurfaceTypes.h:30
R2_surface_matrices_instance_t
Matrices related to the rendered instance that all deferred surface shaders will receive.
Definition: R2SurfaceTypes.h:44