scene_data_inc.glsl 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // Scene data stores all our 3D rendering globals for a frame such as our matrices
  2. // where this information is independent of the different RD implementations.
  3. // This enables us to use this UBO in our main scene render shaders but also in
  4. // effects that need access to this data.
  5. struct SceneData {
  6. highp mat4 projection_matrix;
  7. highp mat4 inv_projection_matrix;
  8. highp mat4 inv_view_matrix;
  9. highp mat4 view_matrix;
  10. // only used for multiview
  11. highp mat4 projection_matrix_view[MAX_VIEWS];
  12. highp mat4 inv_projection_matrix_view[MAX_VIEWS];
  13. highp vec4 eye_offset[MAX_VIEWS];
  14. highp vec2 viewport_size;
  15. highp vec2 screen_pixel_size;
  16. // Use vec4s because std140 doesn't play nice with vec2s, z and w are wasted.
  17. highp vec4 directional_penumbra_shadow_kernel[32];
  18. highp vec4 directional_soft_shadow_kernel[32];
  19. highp vec4 penumbra_shadow_kernel[32];
  20. highp vec4 soft_shadow_kernel[32];
  21. mediump mat3 radiance_inverse_xform;
  22. mediump vec4 ambient_light_color_energy;
  23. mediump float ambient_color_sky_mix;
  24. bool use_ambient_light;
  25. bool use_ambient_cubemap;
  26. bool use_reflection_cubemap;
  27. highp vec2 shadow_atlas_pixel_size;
  28. highp vec2 directional_shadow_pixel_size;
  29. uint directional_light_count;
  30. mediump float dual_paraboloid_side;
  31. highp float z_far;
  32. highp float z_near;
  33. bool roughness_limiter_enabled;
  34. mediump float roughness_limiter_amount;
  35. mediump float roughness_limiter_limit;
  36. mediump float opaque_prepass_threshold;
  37. bool fog_enabled;
  38. highp float fog_density;
  39. highp float fog_height;
  40. highp float fog_height_density;
  41. mediump vec3 fog_light_color;
  42. mediump float fog_sun_scatter;
  43. mediump float fog_aerial_perspective;
  44. highp float time;
  45. mediump float reflection_multiplier; // one normally, zero when rendering reflections
  46. bool material_uv2_mode;
  47. vec2 taa_jitter;
  48. float emissive_exposure_normalization;
  49. float IBL_exposure_normalization;
  50. bool pancake_shadows;
  51. uint camera_visible_layers;
  52. float pass_alpha_multiplier;
  53. uint pad3;
  54. };