R2 Shaders
Functions
R2LightShaderMain.h File Reference

The main function that all deferred light shaders must implement. More...

#include "R2LightOutput.h"
#include "R2ReconstructedSurface.h"
Include dependency graph for R2LightShaderMain.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

R2_light_output_t R2_deferredLightMain (const R2_reconstructed_surface_t surface)
 

Detailed Description

The main function that all deferred light shaders must implement.

Definition in file R2LightShaderMain.h.

Function Documentation

§ R2_deferredLightMain()

R2_light_output_t R2_deferredLightMain ( const R2_reconstructed_surface_t  surface)

Calculate light values for the current light, based on the current contents of the G-buffer.

Parameters
surfaceReconstructed surface data taken from the G-Buffer
Returns
Calculated light values

Definition at line 13 of file R2LightAmbientWithOcclusion.h.

15 {
16  vec3 diffuse =
17  R2_lightAmbientTerm (R2_light_ambient, surface.uv);
18  vec3 specular =
19  vec3 (0.0);
20 
21  return R2_light_output_t (diffuse, specular);
22 }
vec2 uv
The UV coordinates of the current screen fragment.
The type of light values that all deferred light shaders calculate.
Definition: R2LightOutput.h:9
vec3 R2_lightAmbientTerm(const R2_light_ambient_t light, const vec2 uv)