scene_data_inc.glsl 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. // Used for billboards to cast correct shadows.
  15. highp mat4 main_cam_inv_view_matrix;
  16. highp vec2 viewport_size;
  17. highp vec2 screen_pixel_size;
  18. // Use vec4s because std140 doesn't play nice with vec2s, z and w are wasted.
  19. highp vec4 directional_penumbra_shadow_kernel[32];
  20. highp vec4 directional_soft_shadow_kernel[32];
  21. highp vec4 penumbra_shadow_kernel[32];
  22. highp vec4 soft_shadow_kernel[32];
  23. mediump mat3 radiance_inverse_xform;
  24. mediump vec4 ambient_light_color_energy;
  25. mediump float ambient_color_sky_mix;
  26. bool use_ambient_light;
  27. bool use_ambient_cubemap;
  28. bool use_reflection_cubemap;
  29. highp vec2 shadow_atlas_pixel_size;
  30. highp vec2 directional_shadow_pixel_size;
  31. uint directional_light_count;
  32. mediump float dual_paraboloid_side;
  33. highp float z_far;
  34. highp float z_near;
  35. bool roughness_limiter_enabled;
  36. mediump float roughness_limiter_amount;
  37. mediump float roughness_limiter_limit;
  38. mediump float opaque_prepass_threshold;
  39. bool fog_enabled;
  40. uint fog_mode;
  41. highp float fog_density;
  42. highp float fog_height;
  43. highp float fog_height_density;
  44. highp float fog_depth_curve;
  45. highp float fog_depth_begin;
  46. highp float taa_frame_count;
  47. mediump vec3 fog_light_color;
  48. highp float fog_depth_end;
  49. mediump float fog_sun_scatter;
  50. mediump float fog_aerial_perspective;
  51. highp float time;
  52. mediump float reflection_multiplier; // one normally, zero when rendering reflections
  53. vec2 taa_jitter;
  54. bool material_uv2_mode;
  55. float emissive_exposure_normalization;
  56. float IBL_exposure_normalization;
  57. bool pancake_shadows;
  58. uint camera_visible_layers;
  59. float pass_alpha_multiplier;
  60. };