summaryrefslogtreecommitdiffstats
path: root/editor/plugins/material_editor_plugin.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-02-11 16:01:55 +0100
committerGitHub <noreply@github.com>2020-02-11 16:01:55 +0100
commit1eb424ec9549bdd086dfb54c847d107519be73d9 (patch)
treed9a3ec0c72f3a4eda02e16ed883f560e02cf1ccf /editor/plugins/material_editor_plugin.cpp
parent3e3f8a47616327d7faeb17f558bb81a943385e82 (diff)
parentdb81928e08cb58d5f67908c6dfcf9433e572ffe8 (diff)
downloadredot-engine-1eb424ec9549bdd086dfb54c847d107519be73d9.tar.gz
Merge pull request #36098 from godotengine/vulkan
Add initial Vulkan support, master branch goes UNSTABLE
Diffstat (limited to 'editor/plugins/material_editor_plugin.cpp')
-rw-r--r--editor/plugins/material_editor_plugin.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp
index 750f814319..4e44082853 100644
--- a/editor/plugins/material_editor_plugin.cpp
+++ b/editor/plugins/material_editor_plugin.cpp
@@ -59,7 +59,7 @@ void MaterialEditor::_notification(int p_what) {
if (p_what == NOTIFICATION_DRAW) {
- Ref<Texture> checkerboard = get_icon("Checkerboard", "EditorIcons");
+ Ref<Texture2D> checkerboard = get_icon("Checkerboard", "EditorIcons");
Size2 size = get_size();
draw_texture_rect(checkerboard, Rect2(Point2(), size), true);
@@ -225,7 +225,9 @@ EditorInspectorPluginMaterial::EditorInspectorPluginMaterial() {
env.instance();
Ref<ProceduralSky> proc_sky = memnew(ProceduralSky(true));
env->set_sky(proc_sky);
- env->set_background(Environment::BG_COLOR_SKY);
+ env->set_background(Environment::BG_COLOR);
+ env->set_ambient_source(Environment::AMBIENT_SOURCE_SKY);
+ env->set_reflection_source(Environment::REFLECTION_SOURCE_SKY);
}
MaterialEditorPlugin::MaterialEditorPlugin(EditorNode *p_node) {
@@ -235,18 +237,18 @@ MaterialEditorPlugin::MaterialEditorPlugin(EditorNode *p_node) {
add_inspector_plugin(plugin);
}
-String SpatialMaterialConversionPlugin::converts_to() const {
+String StandardMaterial3DConversionPlugin::converts_to() const {
return "ShaderMaterial";
}
-bool SpatialMaterialConversionPlugin::handles(const Ref<Resource> &p_resource) const {
+bool StandardMaterial3DConversionPlugin::handles(const Ref<Resource> &p_resource) const {
- Ref<SpatialMaterial> mat = p_resource;
+ Ref<StandardMaterial3D> mat = p_resource;
return mat.is_valid();
}
-Ref<Resource> SpatialMaterialConversionPlugin::convert(const Ref<Resource> &p_resource) const {
+Ref<Resource> StandardMaterial3DConversionPlugin::convert(const Ref<Resource> &p_resource) const {
- Ref<SpatialMaterial> mat = p_resource;
+ Ref<StandardMaterial3D> mat = p_resource;
ERR_FAIL_COND_V(!mat.is_valid(), Ref<Resource>());
Ref<ShaderMaterial> smat;
@@ -266,9 +268,9 @@ Ref<Resource> SpatialMaterialConversionPlugin::convert(const Ref<Resource> &p_re
for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) {
- // Texture parameter has to be treated specially since SpatialMaterial saved it
+ // Texture parameter has to be treated specially since StandardMaterial3D saved it
// as RID but ShaderMaterial needs Texture itself
- Ref<Texture> texture = mat->get_texture_by_name(E->get().name);
+ Ref<Texture2D> texture = mat->get_texture_by_name(E->get().name);
if (texture.is_valid()) {
smat->set_shader_param(E->get().name, texture);
} else {