summaryrefslogtreecommitdiff
path: root/drivers/gles2/rasterizer_scene_gles2.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gles2/rasterizer_scene_gles2.h')
-rw-r--r--drivers/gles2/rasterizer_scene_gles2.h132
1 files changed, 11 insertions, 121 deletions
diff --git a/drivers/gles2/rasterizer_scene_gles2.h b/drivers/gles2/rasterizer_scene_gles2.h
index 7babcfeed1..174cdd8e2e 100644
--- a/drivers/gles2/rasterizer_scene_gles2.h
+++ b/drivers/gles2/rasterizer_scene_gles2.h
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */
+/* Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -38,19 +38,6 @@
#include "shaders/effect_blur.glsl.gen.h"
#include "shaders/scene.glsl.gen.h"
#include "shaders/tonemap.glsl.gen.h"
-/*
-
-
-#include "drivers/gles3/shaders/exposure.glsl.gen.h"
-#include "drivers/gles3/shaders/resolve.glsl.gen.h"
-#include "drivers/gles3/shaders/scene.glsl.gen.h"
-#include "drivers/gles3/shaders/screen_space_reflection.glsl.gen.h"
-#include "drivers/gles3/shaders/ssao.glsl.gen.h"
-#include "drivers/gles3/shaders/ssao_blur.glsl.gen.h"
-#include "drivers/gles3/shaders/ssao_minify.glsl.gen.h"
-#include "drivers/gles3/shaders/subsurf_scattering.glsl.gen.h"
-
-*/
class RasterizerSceneGLES2 : public RasterizerScene {
public:
@@ -109,103 +96,6 @@ public:
Color default_ambient;
Color default_bg;
- // ResolveShaderGLES3 resolve_shader;
- // ScreenSpaceReflectionShaderGLES3 ssr_shader;
- // EffectBlurShaderGLES3 effect_blur_shader;
- // SubsurfScatteringShaderGLES3 sss_shader;
- // SsaoMinifyShaderGLES3 ssao_minify_shader;
- // SsaoShaderGLES3 ssao_shader;
- // SsaoBlurShaderGLES3 ssao_blur_shader;
- // ExposureShaderGLES3 exposure_shader;
-
- /*
- struct SceneDataUBO {
- //this is a std140 compatible struct. Please read the OpenGL 3.3 Specificaiton spec before doing any changes
- float projection_matrix[16];
- float inv_projection_matrix[16];
- float camera_inverse_matrix[16];
- float camera_matrix[16];
- float ambient_light_color[4];
- float bg_color[4];
- float fog_color_enabled[4];
- float fog_sun_color_amount[4];
-
- float ambient_energy;
- float bg_energy;
- float z_offset;
- float z_slope_scale;
- float shadow_dual_paraboloid_render_zfar;
- float shadow_dual_paraboloid_render_side;
- float viewport_size[2];
- float screen_pixel_size[2];
- float shadow_atlas_pixel_size[2];
- float shadow_directional_pixel_size[2];
-
- float time;
- float z_far;
- float reflection_multiplier;
- float subsurface_scatter_width;
- float ambient_occlusion_affect_light;
-
- uint32_t fog_depth_enabled;
- float fog_depth_begin;
- float fog_depth_curve;
- uint32_t fog_transmit_enabled;
- float fog_transmit_curve;
- uint32_t fog_height_enabled;
- float fog_height_min;
- float fog_height_max;
- float fog_height_curve;
- // make sure this struct is padded to be a multiple of 16 bytes for webgl
-
- } ubo_data;
-
- GLuint scene_ubo;
-
- struct EnvironmentRadianceUBO {
-
- float transform[16];
- float ambient_contribution;
- uint8_t padding[12];
-
- } env_radiance_data;
-
- GLuint env_radiance_ubo;
-
- GLuint sky_array;
-
- GLuint directional_ubo;
-
- GLuint spot_array_ubo;
- GLuint omni_array_ubo;
- GLuint reflection_array_ubo;
-
- GLuint immediate_buffer;
- GLuint immediate_array;
-
- uint32_t ubo_light_size;
- uint8_t *spot_array_tmp;
- uint8_t *omni_array_tmp;
- uint8_t *reflection_array_tmp;
-
- int max_ubo_lights;
- int max_forward_lights_per_object;
- int max_ubo_reflections;
- int max_skeleton_bones;
-
- bool used_contact_shadows;
-
- int spot_light_count;
- int omni_light_count;
- int directional_light_count;
- int reflection_probe_count;
-
- bool used_sss;
- bool using_contact_shadows;
-
- VS::ViewportDebugDraw debug_draw;
- */
-
bool cull_front;
bool cull_disabled;
@@ -225,7 +115,7 @@ public:
uint64_t shadow_atlas_realloc_tolerance_msec;
- struct ShadowAtlas : public RID_Data {
+ struct ShadowAtlas {
enum {
QUADRANT_SHIFT = 27,
SHADOW_INDEX_MASK = (1 << QUADRANT_SHIFT) - 1,
@@ -273,7 +163,7 @@ public:
Vector<ShadowCubeMap> shadow_cubemaps;
- RID_Owner<ShadowAtlas> shadow_atlas_owner;
+ RID_PtrOwner<ShadowAtlas> shadow_atlas_owner;
RID shadow_atlas_create();
void shadow_atlas_set_size(RID p_atlas, int p_size);
@@ -304,7 +194,7 @@ public:
/* REFLECTION PROBE INSTANCE */
- struct ReflectionProbeInstance : public RID_Data {
+ struct ReflectionProbeInstance {
RasterizerStorageGLES2::ReflectionProbe *probe_ptr;
RID probe;
@@ -330,7 +220,7 @@ public:
Transform transform;
};
- mutable RID_Owner<ReflectionProbeInstance> reflection_probe_instance_owner;
+ mutable RID_PtrOwner<ReflectionProbeInstance> reflection_probe_instance_owner;
ReflectionProbeInstance **reflection_probe_instances;
int reflection_probe_count;
@@ -345,7 +235,7 @@ public:
/* ENVIRONMENT API */
- struct Environment : public RID_Data {
+ struct Environment {
VS::EnvironmentBG bg_mode;
RID sky;
@@ -423,7 +313,7 @@ public:
glow_intensity(0.8),
glow_strength(1.0),
glow_bloom(0.0),
- glow_blend_mode(VS::GLOW_BLEND_MODE_SOFTLIGHT),
+ glow_blend_mode(VS::ENV_GLOW_BLEND_MODE_SOFTLIGHT),
glow_hdr_bleed_threshold(1.0),
glow_hdr_bleed_scale(2.0),
glow_hdr_luminance_cap(12.0),
@@ -459,7 +349,7 @@ public:
}
};
- mutable RID_Owner<Environment> environment_owner;
+ mutable RID_PtrOwner<Environment> environment_owner;
virtual RID environment_create();
@@ -496,7 +386,7 @@ public:
/* LIGHT INSTANCE */
- struct LightInstance : public RID_Data {
+ struct LightInstance {
struct ShadowTransform {
CameraMatrix camera;
@@ -530,7 +420,7 @@ public:
Set<RID> shadow_atlases; // atlases where this light is registered
};
- mutable RID_Owner<LightInstance> light_instance_owner;
+ mutable RID_PtrOwner<LightInstance> light_instance_owner;
virtual RID light_instance_create(RID p_light);
virtual void light_instance_set_transform(RID p_light_instance, const Transform &p_transform);