summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/classes/OS.xml65
-rw-r--r--scene/resources/material.cpp6
-rw-r--r--servers/rendering/shader_language.cpp20
-rw-r--r--servers/rendering/shader_language.h8
4 files changed, 77 insertions, 22 deletions
diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml
index a5bd8e2768..ffc02f09a9 100644
--- a/doc/classes/OS.xml
+++ b/doc/classes/OS.xml
@@ -270,7 +270,60 @@
<method name="get_name" qualifiers="const">
<return type="String" />
<description>
- Returns the name of the host OS. Possible values are: [code]"Android"[/code], [code]"iOS"[/code], [code]"HTML5"[/code], [code]"macOS"[/code], [code]"Server"[/code], [code]"Windows"[/code], [code]"UWP"[/code], [code]"X11"[/code].
+ Returns the name of the host OS.
+ On Windows, this is [code]"Windows"[/code] or [code]"UWP"[/code] (Universal Windows Platform) if exported thereon.
+ On macOS, this is [code]"macOS"[/code].
+ On Linux-based operating systems, this is [code]"Linux"[/code].
+ On BSD-based operating systems, this is [code]"FreeBSD"[/code], [code]"NetBSD"[/code], [code]"OpenBSD"[/code], or [code]"BSD"[/code] as a fallback.
+ On Android, this is [code]"Android"[/code].
+ On iOS, this is [code]"iOS"[/code].
+ On the web, this is [code]"HTML5"[/code].
+ [b]Note:[/b] Custom builds of the engine may support additional platforms, such as consoles, yielding other return values.
+ [codeblocks]
+ [gdscript]
+ match OS.get_name():
+ "Windows", "UWP":
+ print("Windows")
+ "macOS":
+ print("macOS")
+ "Linux", "FreeBSD", "NetBSD", "OpenBSD", "BSD":
+ print("Linux/BSD")
+ "Android":
+ print("Android")
+ "iOS":
+ print("iOS")
+ "HTML5":
+ print("Web")
+ [/gdscript]
+ [csharp]
+ switch (OS.GetName())
+ {
+ case "Windows":
+ case "UWP":
+ GD.Print("Windows");
+ break;
+ case "macOS":
+ GD.Print("macOS");
+ break;
+ case "Linux":
+ case "FreeBSD":
+ case "NetBSD":
+ case "OpenBSD"
+ case "BSD":
+ GD.Print("Linux/BSD");
+ break;
+ case "Android":
+ GD.Print("Android");
+ break;
+ case "iOS":
+ GD.Print("iOS");
+ break;
+ case "HTML5":
+ GD.Print("Web");
+ break;
+ }
+ [/csharp]
+ [/codeblocks]
</description>
</method>
<method name="get_process_id" qualifiers="const">
@@ -327,11 +380,13 @@
<return type="String" />
<description>
Returns the absolute directory path where user data is written ([code]user://[/code]).
- On Linux, this is [code]~/.local/share/godot/app_userdata/[project_name][/code], or [code]~/.local/share/[custom_name][/code] if [code]use_custom_user_dir[/code] is set.
+ On Windows, this is [code]%AppData%\Godot\app_userdata\[project_name][/code], or [code]%AppData%\[custom_name][/code] if [code]use_custom_user_dir[/code] is set. [code]%AppData%[/code] expands to [code]%UserProfile%\AppData\Roaming[/code].
On macOS, this is [code]~/Library/Application Support/Godot/app_userdata/[project_name][/code], or [code]~/Library/Application Support/[custom_name][/code] if [code]use_custom_user_dir[/code] is set.
- On Windows, this is [code]%APPDATA%\Godot\app_userdata\[project_name][/code], or [code]%APPDATA%\[custom_name][/code] if [code]use_custom_user_dir[/code] is set. [code]%APPDATA%[/code] expands to [code]%USERPROFILE%\AppData\Roaming[/code].
- If the project name is empty, [code]user://[/code] falls back to [code]res://[/code].
- Not to be confused with [method get_data_dir], which returns the [i]global[/i] (non-project-specific) user data directory.
+ On Linux and BSD, this is [code]~/.local/share/godot/app_userdata/[project_name][/code], or [code]~/.local/share/[custom_name][/code] if [code]use_custom_user_dir[/code] is set.
+ On Android and iOS, this is a sandboxed directory in either internal or external storage, depending on the user's configuration.
+ On the web, this is a virtual directory managed by the browser.
+ If the project name is empty, [code][project_name][/code] falls back to [code][unnamed project][/code].
+ Not to be confused with [method get_data_dir], which returns the [i]global[/i] (non-project-specific) user home directory.
</description>
</method>
<method name="has_environment" qualifiers="const">
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index 50e2de91f7..3f14c7bb62 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -449,10 +449,10 @@ void BaseMaterial3D::_update_shader() {
texfilter_str = "filter_linear_mipmap";
break;
case TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC:
- texfilter_str = "filter_nearest_mipmap_anisotropy";
+ texfilter_str = "filter_nearest_mipmap_anisotropic";
break;
case TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC:
- texfilter_str = "filter_linear_mipmap_anisotropy";
+ texfilter_str = "filter_linear_mipmap_anisotropic";
break;
case TEXTURE_FILTER_MAX:
break; // Internal value, skip.
@@ -2569,7 +2569,7 @@ void BaseMaterial3D::_bind_methods() {
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "uv2_world_triplanar"), "set_flag", "get_flag", FLAG_UV2_USE_WORLD_TRIPLANAR);
ADD_GROUP("Sampling", "texture_");
- ADD_PROPERTY(PropertyInfo(Variant::INT, "texture_filter", PROPERTY_HINT_ENUM, "Nearest,Linear,Nearest Mipmap,Linear Mipmap,Nearest Mipmap Anisotropy,Linear Mipmap Anisotropy"), "set_texture_filter", "get_texture_filter");
+ ADD_PROPERTY(PropertyInfo(Variant::INT, "texture_filter", PROPERTY_HINT_ENUM, "Nearest,Linear,Nearest Mipmap,Linear Mipmap,Nearest Mipmap Anisotropic,Linear Mipmap Anisotropic"), "set_texture_filter", "get_texture_filter");
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "texture_repeat"), "set_flag", "get_flag", FLAG_USE_TEXTURE_REPEAT);
ADD_GROUP("Shadows", "");
diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp
index a84944ffc2..7253d9877f 100644
--- a/servers/rendering/shader_language.cpp
+++ b/servers/rendering/shader_language.cpp
@@ -214,8 +214,8 @@ const char *ShaderLanguage::token_names[TK_MAX] = {
"FILTER_LINEAR",
"FILTER_NEAREST_MIPMAP",
"FILTER_LINEAR_MIPMAP",
- "FILTER_NEAREST_MIPMAP_ANISOTROPY",
- "FILTER_LINEAR_MIPMAP_ANISOTROPY",
+ "FILTER_NEAREST_MIPMAP_ANISOTROPIC",
+ "FILTER_LINEAR_MIPMAP_ANISOTROPIC",
"REPEAT_ENABLE",
"REPEAT_DISABLE",
"SHADER_TYPE",
@@ -328,8 +328,8 @@ const ShaderLanguage::KeyWord ShaderLanguage::keyword_list[] = {
{ TK_FILTER_LINEAR, "filter_linear" },
{ TK_FILTER_NEAREST_MIPMAP, "filter_nearest_mipmap" },
{ TK_FILTER_LINEAR_MIPMAP, "filter_linear_mipmap" },
- { TK_FILTER_NEAREST_MIPMAP_ANISOTROPY, "filter_nearest_mipmap_anisotropy" },
- { TK_FILTER_LINEAR_MIPMAP_ANISOTROPY, "filter_linear_mipmap_anisotropy" },
+ { TK_FILTER_NEAREST_MIPMAP_ANISOTROPIC, "filter_nearest_mipmap_anisotropic" },
+ { TK_FILTER_LINEAR_MIPMAP_ANISOTROPIC, "filter_linear_mipmap_anisotropic" },
{ TK_REPEAT_ENABLE, "repeat_enable" },
{ TK_REPEAT_DISABLE, "repeat_disable" },
{ TK_SHADER_TYPE, "shader_type" },
@@ -8106,10 +8106,10 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
uniform2.filter = FILTER_NEAREST_MIPMAP;
} else if (tk.type == TK_FILTER_LINEAR_MIPMAP) {
uniform2.filter = FILTER_LINEAR_MIPMAP;
- } else if (tk.type == TK_FILTER_NEAREST_MIPMAP_ANISOTROPY) {
- uniform2.filter = FILTER_NEAREST_MIPMAP_ANISOTROPY;
- } else if (tk.type == TK_FILTER_LINEAR_MIPMAP_ANISOTROPY) {
- uniform2.filter = FILTER_LINEAR_MIPMAP_ANISOTROPY;
+ } else if (tk.type == TK_FILTER_NEAREST_MIPMAP_ANISOTROPIC) {
+ uniform2.filter = FILTER_NEAREST_MIPMAP_ANISOTROPIC;
+ } else if (tk.type == TK_FILTER_LINEAR_MIPMAP_ANISOTROPIC) {
+ uniform2.filter = FILTER_LINEAR_MIPMAP_ANISOTROPIC;
} else if (tk.type == TK_REPEAT_DISABLE) {
uniform2.repeat = REPEAT_DISABLE;
} else if (tk.type == TK_REPEAT_ENABLE) {
@@ -9559,10 +9559,10 @@ Error ShaderLanguage::complete(const String &p_code, const ShaderCompileInfo &p_
if (options.is_empty()) {
options.push_back("filter_linear");
options.push_back("filter_linear_mipmap");
- options.push_back("filter_linear_mipmap_anisotropy");
+ options.push_back("filter_linear_mipmap_anisotropic");
options.push_back("filter_nearest");
options.push_back("filter_nearest_mipmap");
- options.push_back("filter_nearest_mipmap_anisotropy");
+ options.push_back("filter_nearest_mipmap_anisotropic");
options.push_back("hint_albedo");
options.push_back("hint_anisotropy");
options.push_back("hint_black");
diff --git a/servers/rendering/shader_language.h b/servers/rendering/shader_language.h
index 02a2ef3a67..8502a250b6 100644
--- a/servers/rendering/shader_language.h
+++ b/servers/rendering/shader_language.h
@@ -179,8 +179,8 @@ public:
TK_FILTER_LINEAR,
TK_FILTER_NEAREST_MIPMAP,
TK_FILTER_LINEAR_MIPMAP,
- TK_FILTER_NEAREST_MIPMAP_ANISOTROPY,
- TK_FILTER_LINEAR_MIPMAP_ANISOTROPY,
+ TK_FILTER_NEAREST_MIPMAP_ANISOTROPIC,
+ TK_FILTER_LINEAR_MIPMAP_ANISOTROPIC,
TK_REPEAT_ENABLE,
TK_REPEAT_DISABLE,
TK_SHADER_TYPE,
@@ -322,8 +322,8 @@ public:
FILTER_LINEAR,
FILTER_NEAREST_MIPMAP,
FILTER_LINEAR_MIPMAP,
- FILTER_NEAREST_MIPMAP_ANISOTROPY,
- FILTER_LINEAR_MIPMAP_ANISOTROPY,
+ FILTER_NEAREST_MIPMAP_ANISOTROPIC,
+ FILTER_LINEAR_MIPMAP_ANISOTROPIC,
FILTER_DEFAULT,
};