You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Remove SCREEN_TEXTURE, DEPTH_TEXTURE, and NORMAL_ROUGHNESS_TEXTURE
in favour of texture hints
This commit is contained in:
@@ -2036,7 +2036,6 @@ void RendererCanvasRenderRD::CanvasShaderData::set_code(const String &p_code) {
|
||||
actions.render_mode_values["blend_premul_alpha"] = Pair<int *, int>(&blend_mode, BLEND_MODE_PMALPHA);
|
||||
actions.render_mode_values["blend_disabled"] = Pair<int *, int>(&blend_mode, BLEND_MODE_DISABLED);
|
||||
|
||||
actions.usage_flag_pointers["SCREEN_TEXTURE"] = &uses_screen_texture;
|
||||
actions.usage_flag_pointers["texture_sdf"] = &uses_sdf;
|
||||
actions.usage_flag_pointers["TIME"] = &uses_time;
|
||||
|
||||
@@ -2048,6 +2047,7 @@ void RendererCanvasRenderRD::CanvasShaderData::set_code(const String &p_code) {
|
||||
ERR_FAIL_COND_MSG(err != OK, "Shader compilation failed.");
|
||||
|
||||
uses_screen_texture_mipmaps = gen_code.uses_screen_texture_mipmaps;
|
||||
uses_screen_texture = gen_code.uses_screen_texture;
|
||||
|
||||
if (version.is_null()) {
|
||||
version = canvas_singleton->shader.canvas_shader.version_create();
|
||||
@@ -2425,7 +2425,6 @@ RendererCanvasRenderRD::RendererCanvasRenderRD() {
|
||||
actions.renames["SPECULAR_SHININESS_TEXTURE"] = "specular_texture";
|
||||
actions.renames["SPECULAR_SHININESS"] = "specular_shininess";
|
||||
actions.renames["SCREEN_UV"] = "screen_uv";
|
||||
actions.renames["SCREEN_TEXTURE"] = "screen_texture";
|
||||
actions.renames["SCREEN_PIXEL_SIZE"] = "canvas_data.screen_pixel_size";
|
||||
actions.renames["FRAGCOORD"] = "gl_FragCoord";
|
||||
actions.renames["POINT_COORD"] = "gl_PointCoord";
|
||||
@@ -2446,7 +2445,6 @@ RendererCanvasRenderRD::RendererCanvasRenderRD() {
|
||||
actions.renames["screen_uv_to_sdf"] = "screen_uv_to_sdf";
|
||||
|
||||
actions.usage_defines["COLOR"] = "#define COLOR_USED\n";
|
||||
actions.usage_defines["SCREEN_TEXTURE"] = "#define SCREEN_TEXTURE_USED\n";
|
||||
actions.usage_defines["SCREEN_UV"] = "#define SCREEN_UV_USED\n";
|
||||
actions.usage_defines["SCREEN_PIXEL_SIZE"] = "@SCREEN_UV";
|
||||
actions.usage_defines["NORMAL"] = "#define NORMAL_USED\n";
|
||||
@@ -2461,7 +2459,6 @@ RendererCanvasRenderRD::RendererCanvasRenderRD() {
|
||||
actions.custom_samplers["TEXTURE"] = "texture_sampler";
|
||||
actions.custom_samplers["NORMAL_TEXTURE"] = "texture_sampler";
|
||||
actions.custom_samplers["SPECULAR_SHININESS_TEXTURE"] = "texture_sampler";
|
||||
actions.custom_samplers["SCREEN_TEXTURE"] = "material_samplers[3]"; //mipmap and filter for screen texture
|
||||
actions.sampler_array_name = "material_samplers";
|
||||
actions.base_texture_binding_index = 1;
|
||||
actions.texture_layout_set = MATERIAL_UNIFORM_SET;
|
||||
@@ -2634,8 +2631,10 @@ RendererCanvasRenderRD::RendererCanvasRenderRD() {
|
||||
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
|
||||
|
||||
void fragment() {
|
||||
vec4 c = textureLod(SCREEN_TEXTURE, SCREEN_UV, 0.0);
|
||||
vec4 c = textureLod(screen_texture, SCREEN_UV, 0.0);
|
||||
|
||||
if (c.a > 0.0001) {
|
||||
c.rgb /= c.a;
|
||||
@@ -2659,8 +2658,10 @@ void fragment() {
|
||||
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform sampler2D screen_texture : hint_screen_texture, repeat_disable, filter_nearest;
|
||||
|
||||
void fragment() {
|
||||
vec4 c = textureLod(SCREEN_TEXTURE, SCREEN_UV, 0.0);
|
||||
vec4 c = textureLod(screen_texture, SCREEN_UV, 0.0);
|
||||
COLOR.rgb = c.rgb;
|
||||
}
|
||||
)");
|
||||
|
||||
Reference in New Issue
Block a user