mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-18 12:16:33 -04:00
switch mobile, fix shader
This commit is contained in:
parent
6d009d0fc1
commit
d4190fbd9e
7 changed files with 21 additions and 14 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,2 +1,5 @@
|
|||
.DS_Store
|
||||
.vscode/*
|
||||
|
||||
# for ipc files (inter process communication)
|
||||
app/sandbox
|
|
@ -72,5 +72,5 @@ open_debug={
|
|||
[rendering]
|
||||
|
||||
textures/canvas_textures/default_texture_filter=2
|
||||
renderer/rendering_method="mobile"
|
||||
textures/default_filters/anisotropic_filtering_level=1
|
||||
anti_aliasing/quality/use_taa=true
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
resource_local_to_scene = true
|
||||
shader = ExtResource("10_2auwe")
|
||||
shader_parameter/ext_texture_is_bgra = null
|
||||
shader_parameter/fill_alpha = null
|
||||
shader_parameter/show_render = null
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bm5nj"]
|
||||
corner_radius_top_left = 25
|
||||
|
|
|
@ -8,19 +8,19 @@ const WARN_CLR = Color.YELLOW
|
|||
const SILENT_CLR = Color.DIM_GRAY
|
||||
|
||||
|
||||
func logr(msg) -> void:
|
||||
func logr(msg: Variant) -> void:
|
||||
print_rich(str(msg))
|
||||
logged.emit(str(msg))
|
||||
|
||||
|
||||
func logerr(msg) -> void:
|
||||
func logerr(msg: Variant) -> void:
|
||||
printerr(str(msg))
|
||||
var rich_clr = "[color=%s]%s[/color]" % [Color.RED.to_html(), str(msg)]
|
||||
logged.emit(rich_clr)
|
||||
error.emit(msg)
|
||||
|
||||
|
||||
func logclr(msg, color: Color) -> void:
|
||||
func logclr(msg: Variant, color: Color) -> void:
|
||||
var rich_clr = "[color=%s]%s[/color]" % [color.to_html(), str(msg)]
|
||||
print_rich(rich_clr)
|
||||
logged.emit(rich_clr)
|
||||
|
|
|
@ -20,8 +20,8 @@ func get_string(section: String, key: String) -> String:
|
|||
return value
|
||||
|
||||
|
||||
func get_value(section: String, key: String):
|
||||
var value
|
||||
func get_value(section: String, key: String) -> Variant:
|
||||
var value: Variant
|
||||
if config.has_section_key(section, key):
|
||||
value = config.get_value(section, key)
|
||||
# Debug.logr(key + "=" + str(value))
|
||||
|
|
|
@ -70,7 +70,7 @@ func ext_texture_format(format: RenderingDevice.DataFormat) -> void:
|
|||
|
||||
|
||||
func first_frame_drawn() -> void:
|
||||
set_param("fill_alpha", true)
|
||||
set_param("show_render", true)
|
||||
|
||||
|
||||
func set_param(param: StringName, value: Variant) -> void:
|
||||
|
|
|
@ -1,14 +1,18 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
uniform bool ext_texture_is_bgra;
|
||||
uniform bool fill_alpha;
|
||||
uniform bool show_render;
|
||||
|
||||
const vec4 zero = vec4(0);
|
||||
|
||||
void fragment() {
|
||||
if (show_render) {
|
||||
COLOR = vec4(COLOR.rgb, 1);
|
||||
} else {
|
||||
COLOR = zero;
|
||||
}
|
||||
|
||||
if (ext_texture_is_bgra) {
|
||||
COLOR = COLOR.bgra; // Swizzle BGRA to RGBA
|
||||
}
|
||||
|
||||
if (fill_alpha) {
|
||||
COLOR = vec4(COLOR.r, COLOR.g, COLOR.b, 1);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue