1 #ifndef R2_LIGHT_PROJECTIVE_LAMBERT_BLINN_PHONG_SHADOW_VARIANCE_H 2 #define R2_LIGHT_PROJECTIVE_LAMBERT_BLINN_PHONG_SHADOW_VARIANCE_H 15 uniform sampler2D R2_light_projective_image;
16 uniform mat4x4 R2_transform_eye_to_light_eye;
17 uniform mat4x4 R2_transform_light_projection;
27 R2_transform_eye_to_light_eye,
28 R2_transform_light_projection);
51 diffuse * image_sample * attenuation,
52 specular * image_sample * attenuation);
55 #endif // R2_LIGHT_PROJECTIVE_LAMBERT_BLINN_PHONG_SHADOW_VARIANCE_H Vectors used when calculating projective lighting.
float R2_lightPositionalAttenuation(const R2_light_positional_t light, const float distance)
vec3 R2_lightSphericalSpecularBlinnPhongTerm(const R2_light_positional_t light, const R2_light_positional_vectors_t v, const vec3 specular_color, const float specular_exponent)
vec4 position
The eye-space position of the surface.
R2_light_projective_vectors_t R2_lightProjectiveVectors(const R2_light_positional_t light, const vec3 p, const vec3 n, const mat4x4 m_eye_to_light_eye, const mat4x4 m_light_projection)
float specular_exponent
The sampled surface specular exponent in the range [0, 256]
vec3 R2_lightSphericalDiffuseLambertTerm(const R2_light_positional_t light, const R2_light_positional_vectors_t v)
Reconstructed surface data, taken from the G-Buffer.
vec2 surface_light_uv
The surface position as UV coordinates from the perspective of the light.
float distance
The distance between the surface and light source.
vec3 normal
The eye-space normal vector of the surface.
float R2_varianceShadowFactor(const R2_shadow_variance_t s, const R2_light_projective_vectors_t v)
The main function that all deferred light shaders must implement.
Functions for variance shadows.
vec3 specular
The sampled surface specular color.
Functions and types related to spherical lighting.
Functions and types related to positional lighting.
The type of light values that all deferred light shaders calculate.
R2_light_output_t R2_deferredLightMain(const R2_reconstructed_surface_t surface)
Functions and types related to projective lighting.
R2_light_positional_vectors_t positional
The vectors for positional lighting.
float back_projected
A value that indicates whether or not the light fragment is back projected (0.0 means back projected...