summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-03-27 22:14:50 +0100
committerGitHub <noreply@github.com>2020-03-27 22:14:50 +0100
commitfcfffd729789cd80aa77056ca089697b52297d04 (patch)
treefc1bb58e900436c48c03c52106eb57250442ae35 /editor
parent307b1b3a5835ecdb477859785c673a07e248f904 (diff)
parenta6f3bc7c696af03e3875f78e098d2476e409d15e (diff)
Merge pull request #37361 from reduz/server-renames
Renaming of servers for coherency.
Diffstat (limited to 'editor')
-rw-r--r--editor/animation_track_editor_plugins.cpp8
-rw-r--r--editor/editor_inspector.cpp2
-rw-r--r--editor/editor_node.cpp34
-rw-r--r--editor/editor_plugin.cpp62
-rw-r--r--editor/editor_resource_preview.cpp2
-rw-r--r--editor/import/editor_import_collada.cpp8
-rw-r--r--editor/import/resource_importer_texture.cpp2
-rw-r--r--editor/import/resource_importer_texture.h8
-rw-r--r--editor/node_3d_editor_gizmos.cpp42
-rw-r--r--editor/plugins/animation_player_editor_plugin.cpp70
-rw-r--r--editor/plugins/audio_stream_editor_plugin.cpp2
-rw-r--r--editor/plugins/canvas_item_editor_plugin.cpp18
-rw-r--r--editor/plugins/editor_preview_plugins.cpp194
-rw-r--r--editor/plugins/material_editor_plugin.cpp36
-rw-r--r--editor/plugins/node_3d_editor_plugin.cpp198
-rw-r--r--editor/plugins/node_3d_editor_plugin.h2
-rw-r--r--editor/plugins/polygon_2d_editor_plugin.cpp4
-rw-r--r--editor/plugins/shader_editor_plugin.cpp12
-rw-r--r--editor/plugins/shader_editor_plugin.h2
-rw-r--r--editor/plugins/texture_region_editor_plugin.cpp4
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp6
-rw-r--r--editor/plugins/visual_shader_editor_plugin.cpp4
-rw-r--r--editor/property_editor.cpp2
-rw-r--r--editor/scene_tree_dock.cpp2
24 files changed, 362 insertions, 362 deletions
diff --git a/editor/animation_track_editor_plugins.cpp b/editor/animation_track_editor_plugins.cpp
index ea0d7511fe..4467366c3f 100644
--- a/editor/animation_track_editor_plugins.cpp
+++ b/editor/animation_track_editor_plugins.cpp
@@ -303,7 +303,7 @@ void AnimationTrackEditAudio::draw_key(int p_index, float p_pixels_sec, int p_x,
Vector<Color> color;
color.push_back(Color(0.75, 0.75, 0.75));
- VS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, color);
+ RS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, color);
if (p_selected) {
Color accent = get_theme_color("accent_color", "Editor");
@@ -673,7 +673,7 @@ void AnimationTrackEditSubAnim::draw_key(int p_index, float p_pixels_sec, int p_
}
if (lines.size() > 2) {
- VS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, colorv);
+ RS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, colorv);
}
int limit = to_x - from_x - 4;
@@ -926,7 +926,7 @@ void AnimationTrackEditTypeAudio::draw_key(int p_index, float p_pixels_sec, int
Vector<Color> color;
color.push_back(Color(0.75, 0.75, 0.75));
- VS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, color);
+ RS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, color);
Color cut_color = get_theme_color("accent_color", "Editor");
cut_color.a = 0.7;
@@ -1255,7 +1255,7 @@ void AnimationTrackEditTypeAnimation::draw_key(int p_index, float p_pixels_sec,
}
if (lines.size() > 2) {
- VS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, colorv);
+ RS::get_singleton()->canvas_item_add_multiline(get_canvas_item(), lines, colorv);
}
int limit = to_x - from_x - 4;
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 181811207c..013ba88c30 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -1569,7 +1569,7 @@ void EditorInspector::update_tree() {
} else if (!(p.usage & PROPERTY_USAGE_EDITOR) || _is_property_disabled_by_feature_profile(p.name))
continue;
- if (p.usage & PROPERTY_USAGE_HIGH_END_GFX && VS::get_singleton()->is_low_end())
+ if (p.usage & PROPERTY_USAGE_HIGH_END_GFX && RS::get_singleton()->is_low_end())
continue; //do not show this property in low end gfx
if (p.name == "script" && (hide_script || bool(object->call("_hide_script_from_inspector")))) {
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 6b332ca300..2ba67ae879 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -61,9 +61,9 @@
#include "scene/gui/texture_progress.h"
#include "scene/gui/tool_button.h"
#include "scene/resources/packed_scene.h"
-#include "servers/navigation_2d_server.h"
-#include "servers/navigation_server.h"
-#include "servers/physics_2d_server.h"
+#include "servers/navigation_server_2d.h"
+#include "servers/navigation_server_3d.h"
+#include "servers/physics_server_2d.h"
#include "editor/audio_stream_preview.h"
#include "editor/debugger/editor_debugger_node.h"
@@ -358,13 +358,13 @@ void EditorNode::_notification(int p_what) {
scene_root->set_default_canvas_item_texture_repeat(tr);
}
- VS::DOFBokehShape dof_shape = VS::DOFBokehShape(int(GLOBAL_GET("rendering/quality/filters/depth_of_field_bokeh_shape")));
- VS::get_singleton()->camera_effects_set_dof_blur_bokeh_shape(dof_shape);
- VS::DOFBlurQuality dof_quality = VS::DOFBlurQuality(int(GLOBAL_GET("rendering/quality/filters/depth_of_field_bokeh_quality")));
+ RS::DOFBokehShape dof_shape = RS::DOFBokehShape(int(GLOBAL_GET("rendering/quality/filters/depth_of_field_bokeh_shape")));
+ RS::get_singleton()->camera_effects_set_dof_blur_bokeh_shape(dof_shape);
+ RS::DOFBlurQuality dof_quality = RS::DOFBlurQuality(int(GLOBAL_GET("rendering/quality/filters/depth_of_field_bokeh_quality")));
bool dof_jitter = GLOBAL_GET("rendering/quality/filters/depth_of_field_use_jitter");
- VS::get_singleton()->camera_effects_set_dof_blur_quality(dof_quality, dof_jitter);
- VS::get_singleton()->environment_set_ssao_quality(VS::EnvironmentSSAOQuality(int(GLOBAL_GET("rendering/quality/ssao/quality"))), GLOBAL_GET("rendering/quality/ssao/half_size"));
- VS::get_singleton()->screen_space_roughness_limiter_set_active(GLOBAL_GET("rendering/quality/filters/screen_space_roughness_limiter"), GLOBAL_GET("rendering/quality/filters/screen_space_roughness_limiter_curve"));
+ RS::get_singleton()->camera_effects_set_dof_blur_quality(dof_quality, dof_jitter);
+ RS::get_singleton()->environment_set_ssao_quality(RS::EnvironmentSSAOQuality(int(GLOBAL_GET("rendering/quality/ssao/quality"))), GLOBAL_GET("rendering/quality/ssao/half_size"));
+ RS::get_singleton()->screen_space_roughness_limiter_set_active(GLOBAL_GET("rendering/quality/filters/screen_space_roughness_limiter"), GLOBAL_GET("rendering/quality/filters/screen_space_roughness_limiter_curve"));
}
ResourceImporterTexture::get_singleton()->update_imports();
@@ -404,9 +404,9 @@ void EditorNode::_notification(int p_what) {
_initializing_addons = false;
}
- VisualServer::get_singleton()->viewport_set_hide_scenario(get_scene_root()->get_viewport_rid(), true);
- VisualServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport_rid(), true);
- VisualServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(), true);
+ RenderingServer::get_singleton()->viewport_set_hide_scenario(get_scene_root()->get_viewport_rid(), true);
+ RenderingServer::get_singleton()->viewport_set_hide_canvas(get_scene_root()->get_viewport_rid(), true);
+ RenderingServer::get_singleton()->viewport_set_disable_environment(get_viewport()->get_viewport_rid(), true);
feature_profile_manager->notify_changed();
@@ -5530,12 +5530,12 @@ EditorNode::EditorNode() {
InputFilter::get_singleton()->set_use_accumulated_input(true);
Resource::_get_local_scene_func = _resource_get_edited_scene;
- VisualServer::get_singleton()->set_debug_generate_wireframes(true);
+ RenderingServer::get_singleton()->set_debug_generate_wireframes(true);
- NavigationServer::get_singleton()->set_active(false); // no nav by default if editor
+ NavigationServer3D::get_singleton()->set_active(false); // no nav by default if editor
- PhysicsServer::get_singleton()->set_active(false); // no physics by default if editor
- Physics2DServer::get_singleton()->set_active(false); // no physics by default if editor
+ PhysicsServer3D::get_singleton()->set_active(false); // no physics by default if editor
+ PhysicsServer2D::get_singleton()->set_active(false); // no physics by default if editor
ScriptServer::set_scripting_enabled(false); // no scripting by default if editor
EditorHelp::generate_doc(); //before any editor classes are created
@@ -6011,7 +6011,7 @@ EditorNode::EditorNode() {
scene_root = memnew(SubViewport);
//scene_root->set_usage(Viewport::USAGE_2D); canvas BG mode prevents usage of this as 2D
- VisualServer::get_singleton()->viewport_set_hide_scenario(scene_root->get_viewport_rid(), true);
+ RenderingServer::get_singleton()->viewport_set_hide_scenario(scene_root->get_viewport_rid(), true);
scene_root->set_disable_input(true);
scene_root->set_as_audio_listener_2d(true);
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp
index 2cafbe3cca..8faaabc1fb 100644
--- a/editor/editor_plugin.cpp
+++ b/editor/editor_plugin.cpp
@@ -41,7 +41,7 @@
#include "plugins/node_3d_editor_plugin.h"
#include "scene/3d/camera_3d.h"
#include "scene/gui/popup_menu.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
Array EditorInterface::_make_mesh_previews(const Array &p_meshes, int p_preview_size) {
@@ -64,25 +64,25 @@ Vector<Ref<Texture2D>> EditorInterface::make_mesh_previews(const Vector<Ref<Mesh
int size = p_preview_size;
- RID scenario = VS::get_singleton()->scenario_create();
+ RID scenario = RS::get_singleton()->scenario_create();
- RID viewport = VS::get_singleton()->viewport_create();
- VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_ALWAYS);
- VS::get_singleton()->viewport_set_scenario(viewport, scenario);
- VS::get_singleton()->viewport_set_size(viewport, size, size);
- VS::get_singleton()->viewport_set_transparent_background(viewport, true);
- VS::get_singleton()->viewport_set_active(viewport, true);
- RID viewport_texture = VS::get_singleton()->viewport_get_texture(viewport);
+ RID viewport = RS::get_singleton()->viewport_create();
+ RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_ALWAYS);
+ RS::get_singleton()->viewport_set_scenario(viewport, scenario);
+ RS::get_singleton()->viewport_set_size(viewport, size, size);
+ RS::get_singleton()->viewport_set_transparent_background(viewport, true);
+ RS::get_singleton()->viewport_set_active(viewport, true);
+ RID viewport_texture = RS::get_singleton()->viewport_get_texture(viewport);
- RID camera = VS::get_singleton()->camera_create();
- VS::get_singleton()->viewport_attach_camera(viewport, camera);
+ RID camera = RS::get_singleton()->camera_create();
+ RS::get_singleton()->viewport_attach_camera(viewport, camera);
- RID light = VS::get_singleton()->directional_light_create();
- RID light_instance = VS::get_singleton()->instance_create2(light, scenario);
+ RID light = RS::get_singleton()->directional_light_create();
+ RID light_instance = RS::get_singleton()->instance_create2(light, scenario);
- RID light2 = VS::get_singleton()->directional_light_create();
- VS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7));
- RID light_instance2 = VS::get_singleton()->instance_create2(light2, scenario);
+ RID light2 = RS::get_singleton()->directional_light_create();
+ RS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7));
+ RID light_instance2 = RS::get_singleton()->instance_create2(light2, scenario);
EditorProgress ep("mlib", TTR("Creating Mesh Previews"), p_meshes.size());
@@ -101,8 +101,8 @@ Vector<Ref<Texture2D>> EditorInterface::make_mesh_previews(const Vector<Ref<Mesh
mesh_xform = (*p_transforms)[i];
}
- RID inst = VS::get_singleton()->instance_create2(mesh->get_rid(), scenario);
- VS::get_singleton()->instance_set_transform(inst, mesh_xform);
+ RID inst = RS::get_singleton()->instance_create2(mesh->get_rid(), scenario);
+ RS::get_singleton()->instance_set_transform(inst, mesh_xform);
AABB aabb = mesh->get_aabb();
Vector3 ofs = aabb.position + aabb.size * 0.5;
@@ -121,32 +121,32 @@ Vector<Ref<Texture2D>> EditorInterface::make_mesh_previews(const Vector<Ref<Mesh
xform.invert();
xform = mesh_xform * xform;
- VS::get_singleton()->camera_set_transform(camera, xform * Transform(Basis(), Vector3(0, 0, 3)));
- VS::get_singleton()->camera_set_orthogonal(camera, m * 2, 0.01, 1000.0);
+ RS::get_singleton()->camera_set_transform(camera, xform * Transform(Basis(), Vector3(0, 0, 3)));
+ RS::get_singleton()->camera_set_orthogonal(camera, m * 2, 0.01, 1000.0);
- VS::get_singleton()->instance_set_transform(light_instance, xform * Transform().looking_at(Vector3(-2, -1, -1), Vector3(0, 1, 0)));
- VS::get_singleton()->instance_set_transform(light_instance2, xform * Transform().looking_at(Vector3(+1, -1, -2), Vector3(0, 1, 0)));
+ RS::get_singleton()->instance_set_transform(light_instance, xform * Transform().looking_at(Vector3(-2, -1, -1), Vector3(0, 1, 0)));
+ RS::get_singleton()->instance_set_transform(light_instance2, xform * Transform().looking_at(Vector3(+1, -1, -2), Vector3(0, 1, 0)));
ep.step(TTR("Thumbnail..."), i);
Main::iteration();
Main::iteration();
- Ref<Image> img = VS::get_singleton()->texture_2d_get(viewport_texture);
+ Ref<Image> img = RS::get_singleton()->texture_2d_get(viewport_texture);
ERR_CONTINUE(!img.is_valid() || img->empty());
Ref<ImageTexture> it(memnew(ImageTexture));
it->create_from_image(img);
- VS::get_singleton()->free(inst);
+ RS::get_singleton()->free(inst);
textures.push_back(it);
}
- VS::get_singleton()->free(viewport);
- VS::get_singleton()->free(light);
- VS::get_singleton()->free(light_instance);
- VS::get_singleton()->free(light2);
- VS::get_singleton()->free(light_instance2);
- VS::get_singleton()->free(camera);
- VS::get_singleton()->free(scenario);
+ RS::get_singleton()->free(viewport);
+ RS::get_singleton()->free(light);
+ RS::get_singleton()->free(light_instance);
+ RS::get_singleton()->free(light2);
+ RS::get_singleton()->free(light_instance2);
+ RS::get_singleton()->free(camera);
+ RS::get_singleton()->free(scenario);
return textures;
}
diff --git a/editor/editor_resource_preview.cpp b/editor/editor_resource_preview.cpp
index 398850f2d6..4db8fb98f1 100644
--- a/editor/editor_resource_preview.cpp
+++ b/editor/editor_resource_preview.cpp
@@ -465,7 +465,7 @@ void EditorResourcePreview::stop() {
preview_sem.post();
while (!exited) {
OS::get_singleton()->delay_usec(10000);
- VisualServer::get_singleton()->sync(); //sync pending stuff, as thread may be blocked on visual server
+ RenderingServer::get_singleton()->sync(); //sync pending stuff, as thread may be blocked on visual server
}
Thread::wait_to_finish(thread);
memdelete(thread);
diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp
index e67dd37b88..6c089d7020 100644
--- a/editor/import/editor_import_collada.cpp
+++ b/editor/import/editor_import_collada.cpp
@@ -922,10 +922,10 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me
if (has_weights) {
Vector<float> weights;
Vector<int> bones;
- weights.resize(VS::ARRAY_WEIGHTS_SIZE);
- bones.resize(VS::ARRAY_WEIGHTS_SIZE);
+ weights.resize(RS::ARRAY_WEIGHTS_SIZE);
+ bones.resize(RS::ARRAY_WEIGHTS_SIZE);
//float sum=0.0;
- for (int l = 0; l < VS::ARRAY_WEIGHTS_SIZE; l++) {
+ for (int l = 0; l < RS::ARRAY_WEIGHTS_SIZE; l++) {
if (l < vertex_array[k].weights.size()) {
weights.write[l] = vertex_array[k].weights[l].weight;
bones.write[l] = vertex_array[k].weights[l].bone_idx;
@@ -963,7 +963,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me
////////////////////////////
Array d = surftool->commit_to_arrays();
- d.resize(VS::ARRAY_MAX);
+ d.resize(RS::ARRAY_MAX);
Array mr;
diff --git a/editor/import/resource_importer_texture.cpp b/editor/import/resource_importer_texture.cpp
index 0090d30b9c..c218697423 100644
--- a/editor/import/resource_importer_texture.cpp
+++ b/editor/import/resource_importer_texture.cpp
@@ -36,7 +36,7 @@
#include "editor/editor_file_system.h"
#include "editor/editor_node.h"
-void ResourceImporterTexture::_texture_reimport_roughness(const Ref<StreamTexture> &p_tex, const String &p_normal_path, VS::TextureDetectRoughnessChannel p_channel) {
+void ResourceImporterTexture::_texture_reimport_roughness(const Ref<StreamTexture> &p_tex, const String &p_normal_path, RS::TextureDetectRoughnessChannel p_channel) {
MutexLock lock(singleton->mutex);
diff --git a/editor/import/resource_importer_texture.h b/editor/import/resource_importer_texture.h
index ed0fe1be89..5f5fb75585 100644
--- a/editor/import/resource_importer_texture.h
+++ b/editor/import/resource_importer_texture.h
@@ -35,7 +35,7 @@
#include "core/io/resource_importer.h"
#include "core/os/file_access.h"
#include "scene/resources/texture.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
class StreamTexture;
@@ -63,16 +63,16 @@ protected:
int flags;
String normal_path_for_roughness;
- VS::TextureDetectRoughnessChannel channel_for_roughness;
+ RS::TextureDetectRoughnessChannel channel_for_roughness;
MakeInfo() {
flags = 0;
- channel_for_roughness = VS::TEXTURE_DETECT_ROUGNHESS_R;
+ channel_for_roughness = RS::TEXTURE_DETECT_ROUGNHESS_R;
}
};
Map<StringName, MakeInfo> make_flags;
- static void _texture_reimport_roughness(const Ref<StreamTexture> &p_tex, const String &p_normal_path, VisualServer::TextureDetectRoughnessChannel p_channel);
+ static void _texture_reimport_roughness(const Ref<StreamTexture> &p_tex, const String &p_normal_path, RenderingServer::TextureDetectRoughnessChannel p_channel);
static void _texture_reimport_3d(const Ref<StreamTexture> &p_tex);
static void _texture_reimport_normal(const Ref<StreamTexture> &p_tex);
diff --git a/editor/node_3d_editor_gizmos.cpp b/editor/node_3d_editor_gizmos.cpp
index 67f0d991bd..40c17a9fc3 100644
--- a/editor/node_3d_editor_gizmos.cpp
+++ b/editor/node_3d_editor_gizmos.cpp
@@ -86,7 +86,7 @@ void EditorNode3DGizmo::clear() {
for (int i = 0; i < instances.size(); i++) {
if (instances[i].instance.is_valid())
- VS::get_singleton()->free(instances[i].instance);
+ RS::get_singleton()->free(instances[i].instance);
}
billboard_handle = false;
@@ -168,16 +168,16 @@ void EditorNode3DGizmo::set_spatial_node(Node3D *p_node) {
void EditorNode3DGizmo::Instance::create_instance(Node3D *p_base, bool p_hidden) {
- instance = VS::get_singleton()->instance_create2(mesh->get_rid(), p_base->get_world()->get_scenario());
- VS::get_singleton()->instance_attach_object_instance_id(instance, p_base->get_instance_id());
+ instance = RS::get_singleton()->instance_create2(mesh->get_rid(), p_base->get_world()->get_scenario());
+ RS::get_singleton()->instance_attach_object_instance_id(instance, p_base->get_instance_id());
if (skin_reference.is_valid()) {
- VS::get_singleton()->instance_attach_skeleton(instance, skin_reference->get_skeleton());
+ RS::get_singleton()->instance_attach_skeleton(instance, skin_reference->get_skeleton());
}
if (extra_margin)
- VS::get_singleton()->instance_set_extra_visibility_margin(instance, 1);
- VS::get_singleton()->instance_geometry_set_cast_shadows_setting(instance, VS::SHADOW_CASTING_SETTING_OFF);
+ RS::get_singleton()->instance_set_extra_visibility_margin(instance, 1);
+ RS::get_singleton()->instance_geometry_set_cast_shadows_setting(instance, RS::SHADOW_CASTING_SETTING_OFF);
int layer = p_hidden ? 0 : 1 << Node3DEditorViewport::GIZMO_EDIT_LAYER;
- VS::get_singleton()->instance_set_layer_mask(instance, layer); //gizmos are 26
+ RS::get_singleton()->instance_set_layer_mask(instance, layer); //gizmos are 26
}
void EditorNode3DGizmo::add_mesh(const Ref<ArrayMesh> &p_mesh, bool p_billboard, const Ref<SkinReference> &p_skin_reference, const Ref<Material> &p_material) {
@@ -191,9 +191,9 @@ void EditorNode3DGizmo::add_mesh(const Ref<ArrayMesh> &p_mesh, bool p_billboard,
ins.material = p_material;
if (valid) {
ins.create_instance(spatial_node, hidden);
- VS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform());
+ RS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform());
if (ins.material.is_valid()) {
- VS::get_singleton()->instance_geometry_set_material_override(ins.instance, p_material->get_rid());
+ RS::get_singleton()->instance_geometry_set_material_override(ins.instance, p_material->get_rid());
}
}
@@ -246,7 +246,7 @@ void EditorNode3DGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Mate
ins.mesh = mesh;
if (valid) {
ins.create_instance(spatial_node, hidden);
- VS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform());
+ RS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform());
}
instances.push_back(ins);
@@ -310,7 +310,7 @@ void EditorNode3DGizmo::add_unscaled_billboard(const Ref<Material> &p_material,
ins.billboard = true;
if (valid) {
ins.create_instance(spatial_node, hidden);
- VS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform());
+ RS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform());
}
selectable_icon_size = p_scale;
@@ -346,8 +346,8 @@ void EditorNode3DGizmo::add_handles(const Vector<Vector3> &p_handles, const Ref<
Ref<ArrayMesh> mesh = memnew(ArrayMesh);
Array a;
- a.resize(VS::ARRAY_MAX);
- a[VS::ARRAY_VERTEX] = p_handles;
+ a.resize(RS::ARRAY_MAX);
+ a[RS::ARRAY_VERTEX] = p_handles;
Vector<Color> colors;
{
colors.resize(p_handles.size());
@@ -364,7 +364,7 @@ void EditorNode3DGizmo::add_handles(const Vector<Vector3> &p_handles, const Ref<
w[i] = col;
}
}
- a[VS::ARRAY_COLOR] = colors;
+ a[RS::ARRAY_COLOR] = colors;
mesh->add_surface_from_arrays(Mesh::PRIMITIVE_POINTS, a);
mesh->surface_set_material(0, p_material);
@@ -384,7 +384,7 @@ void EditorNode3DGizmo::add_handles(const Vector<Vector3> &p_handles, const Ref<
ins.extra_margin = true;
if (valid) {
ins.create_instance(spatial_node, hidden);
- VS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform());
+ RS::get_singleton()->instance_set_transform(ins.instance, spatial_node->get_global_transform());
}
instances.push_back(ins);
if (!p_secondary) {
@@ -410,14 +410,14 @@ void EditorNode3DGizmo::add_solid_box(Ref<Material> &p_material, Vector3 p_size,
cubem.set_size(p_size);
Array arrays = cubem.surface_get_arrays(0);
- PackedVector3Array vertex = arrays[VS::ARRAY_VERTEX];
+ PackedVector3Array vertex = arrays[RS::ARRAY_VERTEX];
Vector3 *w = vertex.ptrw();
for (int i = 0; i < vertex.size(); ++i) {
w[i] += p_position;
}
- arrays[VS::ARRAY_VERTEX] = vertex;
+ arrays[RS::ARRAY_VERTEX] = vertex;
Ref<ArrayMesh> m = memnew(ArrayMesh);
m->add_surface_from_arrays(cubem.surface_get_primitive_type(0), arrays);
@@ -708,7 +708,7 @@ void EditorNode3DGizmo::transform() {
ERR_FAIL_COND(!spatial_node);
ERR_FAIL_COND(!valid);
for (int i = 0; i < instances.size(); i++) {
- VS::get_singleton()->instance_set_transform(instances[i].instance, spatial_node->get_global_transform());
+ RS::get_singleton()->instance_set_transform(instances[i].instance, spatial_node->get_global_transform());
}
}
@@ -720,7 +720,7 @@ void EditorNode3DGizmo::free() {
for (int i = 0; i < instances.size(); i++) {
if (instances[i].instance.is_valid())
- VS::get_singleton()->free(instances[i].instance);
+ RS::get_singleton()->free(instances[i].instance);
instances.write[i].instance = RID();
}
@@ -733,7 +733,7 @@ void EditorNode3DGizmo::set_hidden(bool p_hidden) {
hidden = p_hidden;
int layer = hidden ? 0 : 1 << Node3DEditorViewport::GIZMO_EDIT_LAYER;
for (int i = 0; i < instances.size(); ++i) {
- VS::get_singleton()->instance_set_layer_mask(instances[i].instance, layer);
+ RS::get_singleton()->instance_set_layer_mask(instances[i].instance, layer);
}
}
@@ -1585,7 +1585,7 @@ Position3DNode3DGizmoPlugin::Position3DNode3DGizmoPlugin() {
mat->set_transparency(StandardMaterial3D::TRANSPARENCY_ALPHA);
Array d;
- d.resize(VS::ARRAY_MAX);
+ d.resize(RS::ARRAY_MAX);
d[Mesh::ARRAY_VERTEX] = cursor_points;
d[Mesh::ARRAY_COLOR] = cursor_colors;
pos3d_mesh->add_surface_from_arrays(Mesh::PRIMITIVE_LINES, d);
diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp
index 41af2ab0cc..0b0f93bcb5 100644
--- a/editor/plugins/animation_player_editor_plugin.cpp
+++ b/editor/plugins/animation_player_editor_plugin.cpp
@@ -41,7 +41,7 @@
#include "editor/plugins/canvas_item_editor_plugin.h" // For onion skinning.
#include "editor/plugins/node_3d_editor_plugin.h" // For onion skinning.
#include "scene/main/window.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
void AnimationPlayerEditor::_node_removed(Node *p_node) {
@@ -947,8 +947,8 @@ void AnimationPlayerEditor::forward_canvas_force_draw_over_viewport(Control *p_o
alpha += alpha_step;
if (onion.captures_valid[cidx]) {
- VS::get_singleton()->canvas_item_add_texture_rect_region(
- ci, dst_rect, VS::get_singleton()->viewport_get_texture(onion.captures[cidx]), src_rect, Color(1, 1, 1, alpha));
+ RS::get_singleton()->canvas_item_add_texture_rect_region(
+ ci, dst_rect, RS::get_singleton()->viewport_get_texture(onion.captures[cidx]), src_rect, Color(1, 1, 1, alpha));
}
cidx++;
@@ -961,8 +961,8 @@ void AnimationPlayerEditor::forward_canvas_force_draw_over_viewport(Control *p_o
alpha -= alpha_step;
if (onion.captures_valid[cidx]) {
- VS::get_singleton()->canvas_item_add_texture_rect_region(
- ci, dst_rect, VS::get_singleton()->viewport_get_texture(onion.captures[cidx]), src_rect, Color(1, 1, 1, alpha));
+ RS::get_singleton()->canvas_item_add_texture_rect_region(
+ ci, dst_rect, RS::get_singleton()->viewport_get_texture(onion.captures[cidx]), src_rect, Color(1, 1, 1, alpha));
}
cidx++;
@@ -1318,17 +1318,17 @@ void AnimationPlayerEditor::_allocate_onion_layers() {
bool is_present = onion.differences_only && i == captures - 1;
// Each capture is a viewport with a canvas item attached that renders a full-size rect with the contents of the main viewport.
- onion.captures.write[i] = VS::get_singleton()->viewport_create();
+ onion.captures.write[i] = RS::get_singleton()->viewport_create();
- VS::get_singleton()->viewport_set_size(onion.captures[i], capture_size.width, capture_size.height);
- VS::get_singleton()->viewport_set_update_mode(onion.captures[i], VS::VIEWPORT_UPDATE_ALWAYS);
- VS::get_singleton()->viewport_set_transparent_background(onion.captures[i], !is_present);
- VS::get_singleton()->viewport_attach_canvas(onion.captures[i], onion.capture.canvas);
+ RS::get_singleton()->viewport_set_size(onion.captures[i], capture_size.width, capture_size.height);
+ RS::get_singleton()->viewport_set_update_mode(onion.captures[i], RS::VIEWPORT_UPDATE_ALWAYS);
+ RS::get_singleton()->viewport_set_transparent_background(onion.captures[i], !is_present);
+ RS::get_singleton()->viewport_attach_canvas(onion.captures[i], onion.capture.canvas);
}
// Reset the capture canvas item to the current root viewport texture (defensive).
- VS::get_singleton()->canvas_item_clear(onion.capture.canvas_item);
- VS::get_singleton()->canvas_item_add_texture_rect(onion.capture.canvas_item, Rect2(Point2(), capture_size), get_tree()->get_root()->get_texture()->get_rid());
+ RS::get_singleton()->canvas_item_clear(onion.capture.canvas_item);
+ RS::get_singleton()->canvas_item_add_texture_rect(onion.capture.canvas_item, Rect2(Point2(), capture_size), get_tree()->get_root()->get_texture()->get_rid());
onion.capture_size = capture_size;
}
@@ -1337,7 +1337,7 @@ void AnimationPlayerEditor::_free_onion_layers() {
for (int i = 0; i < onion.captures.size(); i++) {
if (onion.captures[i].is_valid()) {
- VS::get_singleton()->free(onion.captures[i]);
+ RS::get_singleton()->free(onion.captures[i]);
}
}
onion.captures.clear();
@@ -1421,18 +1421,18 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() {
// Tweak the root viewport to ensure it's rendered before our target.
RID root_vp = get_tree()->get_root()->get_viewport_rid();
Rect2 root_vp_screen_rect = Rect2(Vector2(), get_tree()->get_root()->get_size());
- VS::get_singleton()->viewport_attach_to_screen(root_vp, Rect2());
- VS::get_singleton()->viewport_set_update_mode(root_vp, VS::VIEWPORT_UPDATE_ALWAYS);
+ RS::get_singleton()->viewport_attach_to_screen(root_vp, Rect2());
+ RS::get_singleton()->viewport_set_update_mode(root_vp, RS::VIEWPORT_UPDATE_ALWAYS);
RID present_rid;
if (onion.differences_only) {
// Capture present scene as it is.
- VS::get_singleton()->canvas_item_set_material(onion.capture.canvas_item, RID());
+ RS::get_singleton()->canvas_item_set_material(onion.capture.canvas_item, RID());
present_rid = onion.captures[onion.captures.size() - 1];
- VS::get_singleton()->viewport_set_active(present_rid, true);
- VS::get_singleton()->viewport_set_parent_viewport(root_vp, present_rid);
- VS::get_singleton()->draw(false);
- VS::get_singleton()->viewport_set_active(present_rid, false);
+ RS::get_singleton()->viewport_set_active(present_rid, true);
+ RS::get_singleton()->viewport_set_parent_viewport(root_vp, present_rid);
+ RS::get_singleton()->draw(false);
+ RS::get_singleton()->viewport_set_active(present_rid, false);
}
// Backup current animation state.
@@ -1441,10 +1441,10 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() {
// Render every past/future step with the capture shader.
- VS::get_singleton()->canvas_item_set_material(onion.capture.canvas_item, onion.capture.material->get_rid());
+ RS::get_singleton()->canvas_item_set_material(onion.capture.canvas_item, onion.capture.material->get_rid());
onion.capture.material->set_shader_param("bkg_color", GLOBAL_GET("rendering/environment/default_clear_color"));
onion.capture.material->set_shader_param("differences_only", onion.differences_only);
- onion.capture.material->set_shader_param("present", onion.differences_only ? VS::get_singleton()->viewport_get_texture(present_rid) : RID());
+ onion.capture.material->set_shader_param("present", onion.differences_only ? RS::get_singleton()->viewport_get_texture(present_rid) : RID());
int step_off_a = onion.past ? -onion.steps : 0;
int step_off_b = onion.future ? onion.steps : 0;
@@ -1468,19 +1468,19 @@ void AnimationPlayerEditor::_prepare_onion_layers_2() {
get_tree()->flush_transform_notifications(); // Needed for transforms of Node3Ds.
values_backup.update_skeletons(); // Needed for Skeletons (2D & 3D).
- VS::get_singleton()->viewport_set_active(onion.captures[cidx], true);
- VS::get_singleton()->viewport_set_parent_viewport(root_vp, onion.captures[cidx]);
- VS::get_singleton()->draw(false);
- VS::get_singleton()->viewport_set_active(onion.captures[cidx], false);
+ RS::get_singleton()->viewport_set_active(onion.captures[cidx], true);
+ RS::get_singleton()->viewport_set_parent_viewport(root_vp, onion.captures[cidx]);
+ RS::get_singleton()->draw(false);
+ RS::get_singleton()->viewport_set_active(onion.captures[cidx], false);
}
cidx++;
}
// Restore root viewport.
- VS::get_singleton()->viewport_set_parent_viewport(root_vp, RID());
- VS::get_singleton()->viewport_attach_to_screen(root_vp, root_vp_screen_rect);
- VS::get_singleton()->viewport_set_update_mode(root_vp, VS::VIEWPORT_UPDATE_WHEN_VISIBLE);
+ RS::get_singleton()->viewport_set_parent_viewport(root_vp, RID());
+ RS::get_singleton()->viewport_attach_to_screen(root_vp, root_vp_screen_rect);
+ RS::get_singleton()->viewport_set_update_mode(root_vp, RS::VIEWPORT_UPDATE_WHEN_VISIBLE);
// Restore animation state
// (Seeking with update=true wouldn't do the trick because the current value of the properties
@@ -1764,9 +1764,9 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay
onion.last_frame = 0;
onion.can_overlay = false;
onion.capture_size = Size2();
- onion.capture.canvas = VS::get_singleton()->canvas_create();
- onion.capture.canvas_item = VS::get_singleton()->canvas_item_create();
- VS::get_singleton()->canvas_item_set_parent(onion.capture.canvas_item, onion.capture.canvas);
+ onion.capture.canvas = RS::get_singleton()->canvas_create();
+ onion.capture.canvas_item = RS::get_singleton()->canvas_item_create();
+ RS::get_singleton()->canvas_item_set_parent(onion.capture.canvas_item, onion.capture.canvas);
onion.capture.material = Ref<ShaderMaterial>(memnew(ShaderMaterial));
@@ -1792,14 +1792,14 @@ AnimationPlayerEditor::AnimationPlayerEditor(EditorNode *p_editor, AnimationPlay
COLOR = vec4(capture_samp.rgb * dir_color.rgb, bkg_mask * diff_mask); \
} \
");
- VS::get_singleton()->material_set_shader(onion.capture.material->get_rid(), onion.capture.shader->get_rid());
+ RS::get_singleton()->material_set_shader(onion.capture.material->get_rid(), onion.capture.shader->get_rid());
}
AnimationPlayerEditor::~AnimationPlayerEditor() {
_free_onion_layers();
- VS::get_singleton()->free(onion.capture.canvas);
- VS::get_singleton()->free(onion.capture.canvas_item);
+ RS::get_singleton()->free(onion.capture.canvas);
+ RS::get_singleton()->free(onion.capture.canvas_item);
}
void AnimationPlayerEditorPlugin::_notification(int p_what) {
diff --git a/editor/plugins/audio_stream_editor_plugin.cpp b/editor/plugins/audio_stream_editor_plugin.cpp
index 6cffda49d0..0459ac7618 100644
--- a/editor/plugins/audio_stream_editor_plugin.cpp
+++ b/editor/plugins/audio_stream_editor_plugin.cpp
@@ -89,7 +89,7 @@ void AudioStreamEditor::_draw_preview() {
Vector<Color> color;
color.push_back(get_theme_color("contrast_color_2", "Editor"));
- VS::get_singleton()->canvas_item_add_multiline(_preview->get_canvas_item(), lines, color);
+ RS::get_singleton()->canvas_item_add_multiline(_preview->get_canvas_item(), lines, color);
}
void AudioStreamEditor::_preview_changed(ObjectID p_which) {
diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp
index ba9cba5515..c7ddcd5e46 100644
--- a/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/editor/plugins/canvas_item_editor_plugin.cpp
@@ -3427,7 +3427,7 @@ void CanvasItemEditor::_draw_straight_line(Point2 p_from, Point2 p_to, Color p_c
}
}
if (points.size() >= 2) {
- VisualServer::get_singleton()->canvas_item_add_line(ci, points[0], points[1], p_color);
+ RenderingServer::get_singleton()->canvas_item_add_line(ci, points[0], points[1], p_color);
}
}
@@ -3455,7 +3455,7 @@ void CanvasItemEditor::_draw_axis() {
};
for (int i = 0; i < 4; i++) {
- VisualServer::get_singleton()->canvas_item_add_line(ci, screen_endpoints[i], screen_endpoints[(i + 1) % 4], area_axis_color);
+ RenderingServer::get_singleton()->canvas_item_add_line(ci, screen_endpoints[i], screen_endpoints[(i + 1) % 4], area_axis_color);
}
}
}
@@ -3512,8 +3512,8 @@ void CanvasItemEditor::_draw_bones() {
outline_colors.push_back(bone_outline_color);
}
- VisualServer::get_singleton()->canvas_item_add_polygon(ci, bone_shape_outline, outline_colors);
- VisualServer::get_singleton()->canvas_item_add_primitive(ci, bone_shape, colors, Vector<Vector2>(), RID());
+ RenderingServer::get_singleton()->canvas_item_add_polygon(ci, bone_shape_outline, outline_colors);
+ RenderingServer::get_singleton()->canvas_item_add_primitive(ci, bone_shape, colors, Vector<Vector2>(), RID());
}
}
}
@@ -3744,7 +3744,7 @@ void CanvasItemEditor::_draw_viewport() {
}
RID ci = viewport->get_canvas_item();
- VisualServer::get_singleton()->canvas_item_add_set_transform(ci, Transform2D());
+ RenderingServer::get_singleton()->canvas_item_add_set_transform(ci, Transform2D());
EditorPluginList *over_plugin_list = editor->get_editor_plugins_over();
if (!over_plugin_list->empty()) {
@@ -4911,7 +4911,7 @@ void CanvasItemEditor::_popup_callback(int p_op) {
bool preview = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(PREVIEW_CANVAS_SCALE));
preview = !preview;
- VS::get_singleton()->canvas_set_disable_scale(!preview);
+ RS::get_singleton()->canvas_set_disable_scale(!preview);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(PREVIEW_CANVAS_SCALE), preview);
} break;
@@ -5818,13 +5818,13 @@ void CanvasItemEditorPlugin::make_visible(bool p_visible) {
if (p_visible) {
canvas_item_editor->show();
canvas_item_editor->set_physics_process(true);
- VisualServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(), false);
+ RenderingServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(), false);
} else {
canvas_item_editor->hide();
canvas_item_editor->set_physics_process(false);
- VisualServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(), true);
+ RenderingServer::get_singleton()->viewport_set_hide_canvas(editor->get_scene_root()->get_viewport_rid(), true);
}
}
@@ -6307,7 +6307,7 @@ CanvasItemEditorViewport::CanvasItemEditorViewport(EditorNode *p_node, CanvasIte
label_desc->hide();
canvas_item_editor->get_controls_container()->add_child(label_desc);
- VS::get_singleton()->canvas_set_disable_scale(true);
+ RS::get_singleton()->canvas_set_disable_scale(true);
}
CanvasItemEditorViewport::~CanvasItemEditorViewport() {
diff --git a/editor/plugins/editor_preview_plugins.cpp b/editor/plugins/editor_preview_plugins.cpp
index 3c173ab783..a8c4bddccf 100644
--- a/editor/plugins/editor_preview_plugins.cpp
+++ b/editor/plugins/editor_preview_plugins.cpp
@@ -328,19 +328,19 @@ Ref<Texture2D> EditorMaterialPreviewPlugin::generate(const RES &p_from, const Si
if (material->get_shader_mode() == Shader::MODE_SPATIAL) {
- VS::get_singleton()->mesh_surface_set_material(sphere, 0, material->get_rid());
+ RS::get_singleton()->mesh_surface_set_material(sphere, 0, material->get_rid());
- VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_ONCE); //once used for capture
+ RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_ONCE); //once used for capture
preview_done = false;
- VS::get_singleton()->request_frame_drawn_callback(const_cast<EditorMaterialPreviewPlugin *>(this), "_preview_done", Variant());
+ RS::get_singleton()->request_frame_drawn_callback(const_cast<EditorMaterialPreviewPlugin *>(this), "_preview_done", Variant());
while (!preview_done) {
OS::get_singleton()->delay_usec(10);
}
- Ref<Image> img = VS::get_singleton()->texture_2d_get(viewport_texture);
- VS::get_singleton()->mesh_surface_set_material(sphere, 0, RID());
+ Ref<Image> img = RS::get_singleton()->texture_2d_get(viewport_texture);
+ RS::get_singleton()->mesh_surface_set_material(sphere, 0, RID());
ERR_FAIL_COND_V(!img.is_valid(), Ref<ImageTexture>());
@@ -358,35 +358,35 @@ Ref<Texture2D> EditorMaterialPreviewPlugin::generate(const RES &p_from, const Si
EditorMaterialPreviewPlugin::EditorMaterialPreviewPlugin() {
- scenario = VS::get_singleton()->scenario_create();
+ scenario = RS::get_singleton()->scenario_create();
- viewport = VS::get_singleton()->viewport_create();
- VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_DISABLED);
- VS::get_singleton()->viewport_set_scenario(viewport, scenario);
- VS::get_singleton()->viewport_set_size(viewport, 128, 128);
- VS::get_singleton()->viewport_set_transparent_background(viewport, true);
- VS::get_singleton()->viewport_set_active(viewport, true);
- viewport_texture = VS::get_singleton()->viewport_get_texture(viewport);
+ viewport = RS::get_singleton()->viewport_create();
+ RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_DISABLED);
+ RS::get_singleton()->viewport_set_scenario(viewport, scenario);
+ RS::get_singleton()->viewport_set_size(viewport, 128, 128);
+ RS::get_singleton()->viewport_set_transparent_background(viewport, true);
+ RS::get_singleton()->viewport_set_active(viewport, true);
+ viewport_texture = RS::get_singleton()->viewport_get_texture(viewport);
- camera = VS::get_singleton()->camera_create();
- VS::get_singleton()->viewport_attach_camera(viewport, camera);
- VS::get_singleton()->camera_set_transform(camera, Transform(Basis(), Vector3(0, 0, 3)));
- VS::get_singleton()->camera_set_perspective(camera, 45, 0.1, 10);
+ camera = RS::get_singleton()->camera_create();
+ RS::get_singleton()->viewport_attach_camera(viewport, camera);
+ RS::get_singleton()->camera_set_transform(camera, Transform(Basis(), Vector3(0, 0, 3)));
+ RS::get_singleton()->camera_set_perspective(camera, 45, 0.1, 10);
- light = VS::get_singleton()->directional_light_create();
- light_instance = VS::get_singleton()->instance_create2(light, scenario);
- VS::get_singleton()->instance_set_transform(light_instance, Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0)));
+ light = RS::get_singleton()->directional_light_create();
+ light_instance = RS::get_singleton()->instance_create2(light, scenario);
+ RS::get_singleton()->instance_set_transform(light_instance, Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0)));
- light2 = VS::get_singleton()->directional_light_create();
- VS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7));
- //VS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7));
+ light2 = RS::get_singleton()->directional_light_create();
+ RS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7));
+ //RS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7));
- light_instance2 = VS::get_singleton()->instance_create2(light2, scenario);
+ light_instance2 = RS::get_singleton()->instance_create2(light2, scenario);
- VS::get_singleton()->instance_set_transform(light_instance2, Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1)));
+ RS::get_singleton()->instance_set_transform(light_instance2, Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1)));
- sphere = VS::get_singleton()->mesh_create();
- sphere_instance = VS::get_singleton()->instance_create2(sphere, scenario);
+ sphere = RS::get_singleton()->mesh_create();
+ sphere_instance = RS::get_singleton()->instance_create2(sphere, scenario);
int lats = 32;
int lons = 32;
@@ -453,25 +453,25 @@ EditorMaterialPreviewPlugin::EditorMaterialPreviewPlugin() {
}
Array arr;
- arr.resize(VS::ARRAY_MAX);
- arr[VS::ARRAY_VERTEX] = vertices;
- arr[VS::ARRAY_NORMAL] = normals;
- arr[VS::ARRAY_TANGENT] = tangents;
- arr[VS::ARRAY_TEX_UV] = uvs;
- VS::get_singleton()->mesh_add_surface_from_arrays(sphere, VS::PRIMITIVE_TRIANGLES, arr);
+ arr.resize(RS::ARRAY_MAX);
+ arr[RS::ARRAY_VERTEX] = vertices;
+ arr[RS::ARRAY_NORMAL] = normals;
+ arr[RS::ARRAY_TANGENT] = tangents;
+ arr[RS::ARRAY_TEX_UV] = uvs;
+ RS::get_singleton()->mesh_add_surface_from_arrays(sphere, RS::PRIMITIVE_TRIANGLES, arr);
}
EditorMaterialPreviewPlugin::~EditorMaterialPreviewPlugin() {
- VS::get_singleton()->free(sphere);
- VS::get_singleton()->free(sphere_instance);
- VS::get_singleton()->free(viewport);
- VS::get_singleton()->free(light);
- VS::get_singleton()->free(light_instance);
- VS::get_singleton()->free(light2);
- VS::get_singleton()->free(light_instance2);
- VS::get_singleton()->free(camera);
- VS::get_singleton()->free(scenario);
+ RS::get_singleton()->free(sphere);
+ RS::get_singleton()->free(sphere_instance);
+ RS::get_singleton()->free(viewport);
+ RS::get_singleton()->free(light);
+ RS::get_singleton()->free(light_instance);
+ RS::get_singleton()->free(light2);
+ RS::get_singleton()->free(light_instance2);
+ RS::get_singleton()->free(camera);
+ RS::get_singleton()->free(scenario);
}
///////////////////////////////////////////////////////////////////////////
@@ -706,7 +706,7 @@ Ref<Texture2D> EditorMeshPreviewPlugin::generate(const RES &p_from, const Size2
Ref<Mesh> mesh = p_from;
ERR_FAIL_COND_V(mesh.is_null(), Ref<Texture2D>());
- VS::get_singleton()->instance_set_base(mesh_instance, mesh->get_rid());
+ RS::get_singleton()->instance_set_base(mesh_instance, mesh->get_rid());
AABB aabb = mesh->get_aabb();
Vector3 ofs = aabb.position + aabb.size * 0.5;
@@ -723,21 +723,21 @@ Ref<Texture2D> EditorMeshPreviewPlugin::generate(const RES &p_from, const Size2
xform.basis.scale(Vector3(m, m, m));
xform.origin = -xform.basis.xform(ofs); //-ofs*m;
xform.origin.z -= rot_aabb.size.z * 2;
- VS::get_singleton()->instance_set_transform(mesh_instance, xform);
+ RS::get_singleton()->instance_set_transform(mesh_instance, xform);
- VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_ONCE); //once used for capture
+ RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_ONCE); //once used for capture
preview_done = false;
- VS::get_singleton()->request_frame_drawn_callback(const_cast<EditorMeshPreviewPlugin *>(this), "_preview_done", Variant());
+ RS::get_singleton()->request_frame_drawn_callback(const_cast<EditorMeshPreviewPlugin *>(this), "_preview_done", Variant());
while (!preview_done) {
OS::get_singleton()->delay_usec(10);
}
- Ref<Image> img = VS::get_singleton()->texture_2d_get(viewport_texture);
+ Ref<Image> img = RS::get_singleton()->texture_2d_get(viewport_texture);
ERR_FAIL_COND_V(img.is_null(), Ref<ImageTexture>());
- VS::get_singleton()->instance_set_base(mesh_instance, RID());
+ RS::get_singleton()->instance_set_base(mesh_instance, RID());
img->convert(Image::FORMAT_RGBA8);
@@ -759,49 +759,49 @@ Ref<Texture2D> EditorMeshPreviewPlugin::generate(const RES &p_from, const Size2
EditorMeshPreviewPlugin::EditorMeshPreviewPlugin() {
- scenario = VS::get_singleton()->scenario_create();
+ scenario = RS::get_singleton()->scenario_create();
- viewport = VS::get_singleton()->viewport_create();
- VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_DISABLED);
- VS::get_singleton()->viewport_set_scenario(viewport, scenario);
- VS::get_singleton()->viewport_set_size(viewport, 128, 128);
- VS::get_singleton()->viewport_set_transparent_background(viewport, true);
- VS::get_singleton()->viewport_set_active(viewport, true);
- viewport_texture = VS::get_singleton()->viewport_get_texture(viewport);
+ viewport = RS::get_singleton()->viewport_create();
+ RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_DISABLED);
+ RS::get_singleton()->viewport_set_scenario(viewport, scenario);
+ RS::get_singleton()->viewport_set_size(viewport, 128, 128);
+ RS::get_singleton()->viewport_set_transparent_background(viewport, true);
+ RS::get_singleton()->viewport_set_active(viewport, true);
+ viewport_texture = RS::get_singleton()->viewport_get_texture(viewport);
- camera = VS::get_singleton()->camera_create();
- VS::get_singleton()->viewport_attach_camera(viewport, camera);
- VS::get_singleton()->camera_set_transform(camera, Transform(Basis(), Vector3(0, 0, 3)));
- //VS::get_singleton()->camera_set_perspective(camera,45,0.1,10);
- VS::get_singleton()->camera_set_orthogonal(camera, 1.0, 0.01, 1000.0);
+ camera = RS::get_singleton()->camera_create();
+ RS::get_singleton()->viewport_attach_camera(viewport, camera);
+ RS::get_singleton()->camera_set_transform(camera, Transform(Basis(), Vector3(0, 0, 3)));
+ //RS::get_singleton()->camera_set_perspective(camera,45,0.1,10);
+ RS::get_singleton()->camera_set_orthogonal(camera, 1.0, 0.01, 1000.0);
- light = VS::get_singleton()->directional_light_create();
- light_instance = VS::get_singleton()->instance_create2(light, scenario);
- VS::get_singleton()->instance_set_transform(light_instance, Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0)));
+ light = RS::get_singleton()->directional_light_create();
+ light_instance = RS::get_singleton()->instance_create2(light, scenario);
+ RS::get_singleton()->instance_set_transform(light_instance, Transform().looking_at(Vector3(-1, -1, -1), Vector3(0, 1, 0)));
- light2 = VS::get_singleton()->directional_light_create();
- VS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7));
- //VS::get_singleton()->light_set_color(light2, VS::LIGHT_COLOR_SPECULAR, Color(0.0, 0.0, 0.0));
- light_instance2 = VS::get_singleton()->instance_create2(light2, scenario);
+ light2 = RS::get_singleton()->directional_light_create();
+ RS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7));
+ //RS::get_singleton()->light_set_color(light2, RS::LIGHT_COLOR_SPECULAR, Color(0.0, 0.0, 0.0));
+ light_instance2 = RS::get_singleton()->instance_create2(light2, scenario);
- VS::get_singleton()->instance_set_transform(light_instance2, Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1)));
+ RS::get_singleton()->instance_set_transform(light_instance2, Transform().looking_at(Vector3(0, 1, 0), Vector3(0, 0, 1)));
- //sphere = VS::get_singleton()->mesh_create();
- mesh_instance = VS::get_singleton()->instance_create();
- VS::get_singleton()->instance_set_scenario(mesh_instance, scenario);
+ //sphere = RS::get_singleton()->mesh_create();
+ mesh_instance = RS::get_singleton()->instance_create();
+ RS::get_singleton()->instance_set_scenario(mesh_instance, scenario);
}
EditorMeshPreviewPlugin::~EditorMeshPreviewPlugin() {
- //VS::get_singleton()->free(sphere);
- VS::get_singleton()->free(mesh_instance);
- VS::get_singleton()->free(viewport);
- VS::get_singleton()->free(light);
- VS::get_singleton()->free(light_instance);
- VS::get_singleton()->free(light2);
- VS::get_singleton()->free(light_instance2);
- VS::get_singleton()->free(camera);
- VS::get_singleton()->free(scenario);
+ //RS::get_singleton()->free(sphere);
+ RS::get_singleton()->free(mesh_instance);
+ RS::get_singleton()->free(viewport);
+ RS::get_singleton()->free(light);
+ RS::get_singleton()->free(light_instance);
+ RS::get_singleton()->free(light2);
+ RS::get_singleton()->free(light_instance2);
+ RS::get_singleton()->free(camera);
+ RS::get_singleton()->free(scenario);
}
///////////////////////////////////////////////////////////////////////////
@@ -849,16 +849,16 @@ Ref<Texture2D> EditorFontPreviewPlugin::generate_from_path(const String &p_path,
font->draw(canvas_item, pos, sampled_text);
preview_done = false;
- VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_ONCE); //once used for capture
- VS::get_singleton()->request_frame_drawn_callback(const_cast<EditorFontPreviewPlugin *>(this), "_preview_done", Variant());
+ RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_ONCE); //once used for capture
+ RS::get_singleton()->request_frame_drawn_callback(const_cast<EditorFontPreviewPlugin *>(this), "_preview_done", Variant());
while (!preview_done) {
OS::get_singleton()->delay_usec(10);
}
- VS::get_singleton()->canvas_item_clear(canvas_item);
+ RS::get_singleton()->canvas_item_clear(canvas_item);
- Ref<Image> img = VS::get_singleton()->texture_2d_get(viewport_texture);
+ Ref<Image> img = RS::get_singleton()->texture_2d_get(viewport_texture);
ERR_FAIL_COND_V(img.is_null(), Ref<ImageTexture>());
img->convert(Image::FORMAT_RGBA8);
@@ -891,22 +891,22 @@ Ref<Texture2D> EditorFontPreviewPlugin::generate(const RES &p_from, const Size2
EditorFontPreviewPlugin::EditorFontPreviewPlugin() {
- viewport = VS::get_singleton()->viewport_create();
- VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_DISABLED);
- VS::get_singleton()->viewport_set_size(viewport, 128, 128);
- VS::get_singleton()->viewport_set_active(viewport, true);
- viewport_texture = VS::get_singleton()->viewport_get_texture(viewport);
+ viewport = RS::get_singleton()->viewport_create();
+ RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_DISABLED);
+ RS::get_singleton()->viewport_set_size(viewport, 128, 128);
+ RS::get_singleton()->viewport_set_active(viewport, true);
+ viewport_texture = RS::get_singleton()->viewport_get_texture(viewport);
- canvas = VS::get_singleton()->canvas_create();
- canvas_item = VS::get_singleton()->canvas_item_create();
+ canvas = RS::get_singleton()->canvas_create();
+ canvas_item = RS::get_singleton()->canvas_item_create();
- VS::get_singleton()->viewport_attach_canvas(viewport, canvas);
- VS::get_singleton()->canvas_item_set_parent(canvas_item, canvas);
+ RS::get_singleton()->viewport_attach_canvas(viewport, canvas);
+ RS::get_singleton()->canvas_item_set_parent(canvas_item, canvas);
}
EditorFontPreviewPlugin::~EditorFontPreviewPlugin() {
- VS::get_singleton()->free(canvas_item);
- VS::get_singleton()->free(canvas);
- VS::get_singleton()->free(viewport);
+ RS::get_singleton()->free(canvas_item);
+ RS::get_singleton()->free(canvas);
+ RS::get_singleton()->free(viewport);
}
diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp
index 8129b9bd86..5623805201 100644
--- a/editor/plugins/material_editor_plugin.cpp
+++ b/editor/plugins/material_editor_plugin.cpp
@@ -256,14 +256,14 @@ Ref<Resource> StandardMaterial3DConversionPlugin::convert(const Ref<Resource> &p
Ref<Shader> shader;
shader.instance();
- String code = VS::get_singleton()->shader_get_code(mat->get_shader_rid());
+ String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid());
shader->set_code(code);
smat->set_shader(shader);
List<PropertyInfo> params;
- VS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
+ RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) {
@@ -273,7 +273,7 @@ Ref<Resource> StandardMaterial3DConversionPlugin::convert(const Ref<Resource> &p
if (texture.is_valid()) {
smat->set_shader_param(E->get().name, texture);
} else {
- Variant value = VS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
+ Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
smat->set_shader_param(E->get().name, value);
}
}
@@ -302,17 +302,17 @@ Ref<Resource> ParticlesMaterialConversionPlugin::convert(const Ref<Resource> &p_
Ref<Shader> shader;
shader.instance();
- String code = VS::get_singleton()->shader_get_code(mat->get_shader_rid());
+ String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid());
shader->set_code(code);
smat->set_shader(shader);
List<PropertyInfo> params;
- VS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
+ RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) {
- Variant value = VS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
+ Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
smat->set_shader_param(E->get().name, value);
}
@@ -340,17 +340,17 @@ Ref<Resource> CanvasItemMaterialConversionPlugin::convert(const Ref<Resource> &p
Ref<Shader> shader;
shader.instance();
- String code = VS::get_singleton()->shader_get_code(mat->get_shader_rid());
+ String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid());
shader->set_code(code);
smat->set_shader(shader);
List<PropertyInfo> params;
- VS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
+ RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) {
- Variant value = VS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
+ Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
smat->set_shader_param(E->get().name, value);
}
@@ -378,17 +378,17 @@ Ref<Resource> ProceduralSkyMaterialConversionPlugin::convert(const Ref<Resource>
Ref<Shader> shader;
shader.instance();
- String code = VS::get_singleton()->shader_get_code(mat->get_shader_rid());
+ String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid());
shader->set_code(code);
smat->set_shader(shader);
List<PropertyInfo> params;
- VS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
+ RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) {
- Variant value = VS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
+ Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
smat->set_shader_param(E->get().name, value);
}
@@ -416,17 +416,17 @@ Ref<Resource> PanoramaSkyMaterialConversionPlugin::convert(const Ref<Resource> &
Ref<Shader> shader;
shader.instance();
- String code = VS::get_singleton()->shader_get_code(mat->get_shader_rid());
+ String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid());
shader->set_code(code);
smat->set_shader(shader);
List<PropertyInfo> params;
- VS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
+ RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) {
- Variant value = VS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
+ Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
smat->set_shader_param(E->get().name, value);
}
@@ -454,17 +454,17 @@ Ref<Resource> PhysicalSkyMaterialConversionPlugin::convert(const Ref<Resource> &
Ref<Shader> shader;
shader.instance();
- String code = VS::get_singleton()->shader_get_code(mat->get_shader_rid());
+ String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid());
shader->set_code(code);
smat->set_shader(shader);
List<PropertyInfo> params;
- VS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
+ RS::get_singleton()->shader_get_param_list(mat->get_shader_rid(), &params);
for (List<PropertyInfo>::Element *E = params.front(); E; E = E->next()) {
- Variant value = VS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
+ Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E->get().name);
smat->set_shader_param(E->get().name, value);
}
diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp
index 07eaf3f63f..6f6d06b09d 100644
--- a/editor/plugins/node_3d_editor_plugin.cpp
+++ b/editor/plugins/node_3d_editor_plugin.cpp
@@ -496,7 +496,7 @@ ObjectID Node3DEditorViewport::_select_ray(const Point2 &p_pos, bool p_append, b
Vector3 pos = _get_ray_pos(p_pos);
Vector2 shrinked_pos = p_pos / viewport_container->get_stretch_shrink();
- Vector<ObjectID> instances = VisualServer::get_singleton()->instances_cull_ray(pos, ray, get_tree()->get_root()->get_world()->get_scenario());
+ Vector<ObjectID> instances = RenderingServer::get_singleton()->instances_cull_ray(pos, ray, get_tree()->get_root()->get_world()->get_scenario());
Set<Ref<EditorNode3DGizmo>> found_gizmos;
Node *edited_scene = get_tree()->get_edited_scene_root();
@@ -563,7 +563,7 @@ void Node3DEditorViewport::_find_items_at_pos(const Point2 &p_pos, bool &r_inclu
Vector3 ray = _get_ray(p_pos);
Vector3 pos = _get_ray_pos(p_pos);
- Vector<ObjectID> instances = VisualServer::get_singleton()->instances_cull_ray(pos, ray, get_tree()->get_root()->get_world()->get_scenario());
+ Vector<ObjectID> instances = RenderingServer::get_singleton()->instances_cull_ray(pos, ray, get_tree()->get_root()->get_world()->get_scenario());
Set<Ref<EditorNode3DGizmo>> found_gizmos;
r_includes_current = false;
@@ -686,7 +686,7 @@ void Node3DEditorViewport::_select_region() {
frustum.push_back(far);
}
- Vector<ObjectID> instances = VisualServer::get_singleton()->instances_cull_convex(frustum, get_tree()->get_root()->get_world()->get_scenario());
+ Vector<ObjectID> instances = RenderingServer::get_singleton()->instances_cull_convex(frustum, get_tree()->get_root()->get_world()->get_scenario());
Vector<Node *> selected;
Node *edited_scene = get_tree()->get_edited_scene_root();
@@ -2395,7 +2395,7 @@ void Node3DEditorViewport::_notification(int p_what) {
}
previewing = cam;
previewing->connect("tree_exited", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
- VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), cam->get_camera());
+ RS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), cam->get_camera());
surface->update();
}
}
@@ -2437,7 +2437,7 @@ void Node3DEditorViewport::_notification(int p_what) {
aabb_s.scale(se->aabb.size);
t.basis = t.basis * aabb_s;
- VisualServer::get_singleton()->instance_set_transform(se->sbox_instance, t);
+ RenderingServer::get_singleton()->instance_set_transform(se->sbox_instance, t);
}
if (changed || (spatial_editor->is_gizmo_visible() && !exist)) {
@@ -2643,7 +2643,7 @@ void Node3DEditorViewport::_draw() {
if (_edit.mode == TRANSFORM_ROTATE) {
Point2 center = _point_to_screen(_edit.center);
- VisualServer::get_singleton()->canvas_item_add_line(
+ RenderingServer::get_singleton()->canvas_item_add_line(
ci,
_edit.mouse_pos,
center,
@@ -3082,51 +3082,51 @@ void Node3DEditorViewport::_init_gizmo_instance(int p_idx) {
uint32_t layer = 1 << (GIZMO_BASE_LAYER + p_idx);
for (int i = 0; i < 3; i++) {
- move_gizmo_instance[i] = VS::get_singleton()->instance_create();
- VS::get_singleton()->instance_set_base(move_gizmo_instance[i], spatial_editor->get_move_gizmo(i)->get_rid());
- VS::get_singleton()->instance_set_scenario(move_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario());
- VS::get_singleton()->instance_set_visible(move_gizmo_instance[i], false);
- VS::get_singleton()->instance_geometry_set_cast_shadows_setting(move_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF);
- VS::get_singleton()->instance_set_layer_mask(move_gizmo_instance[i], layer);
-
- move_plane_gizmo_instance[i] = VS::get_singleton()->instance_create();
- VS::get_singleton()->instance_set_base(move_plane_gizmo_instance[i], spatial_editor->get_move_plane_gizmo(i)->get_rid());
- VS::get_singleton()->instance_set_scenario(move_plane_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario());
- VS::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], false);
- VS::get_singleton()->instance_geometry_set_cast_shadows_setting(move_plane_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF);
- VS::get_singleton()->instance_set_layer_mask(move_plane_gizmo_instance[i], layer);
-
- rotate_gizmo_instance[i] = VS::get_singleton()->instance_create();
- VS::get_singleton()->instance_set_base(rotate_gizmo_instance[i], spatial_editor->get_rotate_gizmo(i)->get_rid());
- VS::get_singleton()->instance_set_scenario(rotate_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario());
- VS::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], false);
- VS::get_singleton()->instance_geometry_set_cast_shadows_setting(rotate_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF);
- VS::get_singleton()->instance_set_layer_mask(rotate_gizmo_instance[i], layer);
-
- scale_gizmo_instance[i] = VS::get_singleton()->instance_create();
- VS::get_singleton()->instance_set_base(scale_gizmo_instance[i], spatial_editor->get_scale_gizmo(i)->get_rid());
- VS::get_singleton()->instance_set_scenario(scale_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario());
- VS::get_singleton()->instance_set_visible(scale_gizmo_instance[i], false);
- VS::get_singleton()->instance_geometry_set_cast_shadows_setting(scale_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF);
- VS::get_singleton()->instance_set_layer_mask(scale_gizmo_instance[i], layer);
-
- scale_plane_gizmo_instance[i] = VS::get_singleton()->instance_create();
- VS::get_singleton()->instance_set_base(scale_plane_gizmo_instance[i], spatial_editor->get_scale_plane_gizmo(i)->get_rid());
- VS::get_singleton()->instance_set_scenario(scale_plane_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario());
- VS::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], false);
- VS::get_singleton()->instance_geometry_set_cast_shadows_setting(scale_plane_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF);
- VS::get_singleton()->instance_set_layer_mask(scale_plane_gizmo_instance[i], layer);
+ move_gizmo_instance[i] = RS::get_singleton()->instance_create();
+ RS::get_singleton()->instance_set_base(move_gizmo_instance[i], spatial_editor->get_move_gizmo(i)->get_rid());
+ RS::get_singleton()->instance_set_scenario(move_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario());
+ RS::get_singleton()->instance_set_visible(move_gizmo_instance[i], false);
+ RS::get_singleton()->instance_geometry_set_cast_shadows_setting(move_gizmo_instance[i], RS::SHADOW_CASTING_SETTING_OFF);
+ RS::get_singleton()->instance_set_layer_mask(move_gizmo_instance[i], layer);
+
+ move_plane_gizmo_instance[i] = RS::get_singleton()->instance_create();
+ RS::get_singleton()->instance_set_base(move_plane_gizmo_instance[i], spatial_editor->get_move_plane_gizmo(i)->get_rid());
+ RS::get_singleton()->instance_set_scenario(move_plane_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario());
+ RS::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], false);
+ RS::get_singleton()->instance_geometry_set_cast_shadows_setting(move_plane_gizmo_instance[i], RS::SHADOW_CASTING_SETTING_OFF);
+ RS::get_singleton()->instance_set_layer_mask(move_plane_gizmo_instance[i], layer);
+
+ rotate_gizmo_instance[i] = RS::get_singleton()->instance_create();
+ RS::get_singleton()->instance_set_base(rotate_gizmo_instance[i], spatial_editor->get_rotate_gizmo(i)->get_rid());
+ RS::get_singleton()->instance_set_scenario(rotate_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario());
+ RS::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], false);
+ RS::get_singleton()->instance_geometry_set_cast_shadows_setting(rotate_gizmo_instance[i], RS::SHADOW_CASTING_SETTING_OFF);
+ RS::get_singleton()->instance_set_layer_mask(rotate_gizmo_instance[i], layer);
+
+ scale_gizmo_instance[i] = RS::get_singleton()->instance_create();
+ RS::get_singleton()->instance_set_base(scale_gizmo_instance[i], spatial_editor->get_scale_gizmo(i)->get_rid());
+ RS::get_singleton()->instance_set_scenario(scale_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario());
+ RS::get_singleton()->instance_set_visible(scale_gizmo_instance[i], false);
+ RS::get_singleton()->instance_geometry_set_cast_shadows_setting(scale_gizmo_instance[i], RS::SHADOW_CASTING_SETTING_OFF);
+ RS::get_singleton()->instance_set_layer_mask(scale_gizmo_instance[i], layer);
+
+ scale_plane_gizmo_instance[i] = RS::get_singleton()->instance_create();
+ RS::get_singleton()->instance_set_base(scale_plane_gizmo_instance[i], spatial_editor->get_scale_plane_gizmo(i)->get_rid());
+ RS::get_singleton()->instance_set_scenario(scale_plane_gizmo_instance[i], get_tree()->get_root()->get_world()->get_scenario());
+ RS::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], false);
+ RS::get_singleton()->instance_geometry_set_cast_shadows_setting(scale_plane_gizmo_instance[i], RS::SHADOW_CASTING_SETTING_OFF);
+ RS::get_singleton()->instance_set_layer_mask(scale_plane_gizmo_instance[i], layer);
}
}
void Node3DEditorViewport::_finish_gizmo_instances() {
for (int i = 0; i < 3; i++) {
- VS::get_singleton()->free(move_gizmo_instance[i]);
- VS::get_singleton()->free(move_plane_gizmo_instance[i]);
- VS::get_singleton()->free(rotate_gizmo_instance[i]);
- VS::get_singleton()->free(scale_gizmo_instance[i]);
- VS::get_singleton()->free(scale_plane_gizmo_instance[i]);
+ RS::get_singleton()->free(move_gizmo_instance[i]);
+ RS::get_singleton()->free(move_plane_gizmo_instance[i]);
+ RS::get_singleton()->free(rotate_gizmo_instance[i]);
+ RS::get_singleton()->free(scale_gizmo_instance[i]);
+ RS::get_singleton()->free(scale_plane_gizmo_instance[i]);
}
}
void Node3DEditorViewport::_toggle_camera_preview(bool p_activate) {
@@ -3138,7 +3138,7 @@ void Node3DEditorViewport::_toggle_camera_preview(bool p_activate) {
previewing->disconnect("tree_exiting", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
previewing = NULL;
- VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), camera->get_camera()); //restore
+ RS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), camera->get_camera()); //restore
if (!preview)
preview_camera->hide();
view_menu->set_disabled(false);
@@ -3148,7 +3148,7 @@ void Node3DEditorViewport::_toggle_camera_preview(bool p_activate) {
previewing = preview;
previewing->connect("tree_exiting", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
- VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), preview->get_camera()); //replace
+ RS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), preview->get_camera()); //replace
view_menu->set_disabled(true);
surface->update();
}
@@ -3161,7 +3161,7 @@ void Node3DEditorViewport::_toggle_cinema_preview(bool p_activate) {
previewing->disconnect("tree_exited", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
previewing = NULL;
- VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), camera->get_camera()); //restore
+ RS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), camera->get_camera()); //restore
preview_camera->set_pressed(false);
if (!preview) {
preview_camera->hide();
@@ -3212,11 +3212,11 @@ void Node3DEditorViewport::update_transform_gizmo_view() {
if (xform.origin.distance_squared_to(camera_xform.origin) < 0.01) {
for (int i = 0; i < 3; i++) {
- VisualServer::get_singleton()->instance_set_visible(move_gizmo_instance[i], false);
- VisualServer::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], false);
- VisualServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], false);
- VisualServer::get_singleton()->instance_set_visible(scale_gizmo_instance[i], false);
- VisualServer::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], false);
+ RenderingServer::get_singleton()->instance_set_visible(move_gizmo_instance[i], false);
+ RenderingServer::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], false);
+ RenderingServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], false);
+ RenderingServer::get_singleton()->instance_set_visible(scale_gizmo_instance[i], false);
+ RenderingServer::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], false);
}
return;
}
@@ -3244,16 +3244,16 @@ void Node3DEditorViewport::update_transform_gizmo_view() {
xform.basis.scale(scale);
for (int i = 0; i < 3; i++) {
- VisualServer::get_singleton()->instance_set_transform(move_gizmo_instance[i], xform);
- VisualServer::get_singleton()->instance_set_visible(move_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_MOVE));
- VisualServer::get_singleton()->instance_set_transform(move_plane_gizmo_instance[i], xform);
- VisualServer::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_MOVE));
- VisualServer::get_singleton()->instance_set_transform(rotate_gizmo_instance[i], xform);
- VisualServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_ROTATE));
- VisualServer::get_singleton()->instance_set_transform(scale_gizmo_instance[i], xform);
- VisualServer::get_singleton()->instance_set_visible(scale_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SCALE));
- VisualServer::get_singleton()->instance_set_transform(scale_plane_gizmo_instance[i], xform);
- VisualServer::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SCALE));
+ RenderingServer::get_singleton()->instance_set_transform(move_gizmo_instance[i], xform);
+ RenderingServer::get_singleton()->instance_set_visible(move_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_MOVE));
+ RenderingServer::get_singleton()->instance_set_transform(move_plane_gizmo_instance[i], xform);
+ RenderingServer::get_singleton()->instance_set_visible(move_plane_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_MOVE));
+ RenderingServer::get_singleton()->instance_set_transform(rotate_gizmo_instance[i], xform);
+ RenderingServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_ROTATE));
+ RenderingServer::get_singleton()->instance_set_transform(scale_gizmo_instance[i], xform);
+ RenderingServer::get_singleton()->instance_set_visible(scale_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SCALE));
+ RenderingServer::get_singleton()->instance_set_transform(scale_plane_gizmo_instance[i], xform);
+ RenderingServer::get_singleton()->instance_set_visible(scale_plane_gizmo_instance[i], spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode() == Node3DEditor::TOOL_MODE_SCALE));
}
}
@@ -3363,7 +3363,7 @@ void Node3DEditorViewport::set_state(const Dictionary &p_state) {
if (Object::cast_to<Camera3D>(pv)) {
previewing = Object::cast_to<Camera3D>(pv);
previewing->connect("tree_exiting", callable_mp(this, &Node3DEditorViewport::_preview_exited_scene));
- VS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), previewing->get_camera()); //replace
+ RS::get_singleton()->viewport_attach_camera(viewport->get_viewport_rid(), previewing->get_camera()); //replace
view_menu->set_disabled(true);
surface->update();
preview_camera->set_pressed(true);
@@ -3478,7 +3478,7 @@ Vector3 Node3DEditorViewport::_get_instance_position(const Point2 &p_pos) const
Vector3 world_ray = _get_ray(p_pos);
Vector3 world_pos = _get_ray_pos(p_pos);
- Vector<ObjectID> instances = VisualServer::get_singleton()->instances_cull_ray(world_pos, world_ray, get_tree()->get_root()->get_world()->get_scenario());
+ Vector<ObjectID> instances = RenderingServer::get_singleton()->instances_cull_ray(world_pos, world_ray, get_tree()->get_root()->get_world()->get_scenario());
Set<Ref<EditorNode3DGizmo>> found_gizmos;
float closest_dist = MAX_DISTANCE;
@@ -4398,7 +4398,7 @@ Node3DEditor *Node3DEditor::singleton = NULL;
Node3DEditorSelectedItem::~Node3DEditorSelectedItem() {
if (sbox_instance.is_valid())
- VisualServer::get_singleton()->free(sbox_instance);
+ RenderingServer::get_singleton()->free(sbox_instance);
}
void Node3DEditor::select_gizmo_highlight_axis(int p_axis) {
@@ -4484,8 +4484,8 @@ Object *Node3DEditor::_get_editor_data(Object *p_what) {
Node3DEditorSelectedItem *si = memnew(Node3DEditorSelectedItem);
si->sp = sp;
- si->sbox_instance = VisualServer::get_singleton()->instance_create2(selection_box->get_rid(), sp->get_world()->get_scenario());
- VS::get_singleton()->instance_geometry_set_cast_shadows_setting(si->sbox_instance, VS::SHADOW_CASTING_SETTING_OFF);
+ si->sbox_instance = RenderingServer::get_singleton()->instance_create2(selection_box->get_rid(), sp->get_world()->get_scenario());
+ RS::get_singleton()->instance_geometry_set_cast_shadows_setting(si->sbox_instance, RS::SHADOW_CASTING_SETTING_OFF);
return si;
}
@@ -4649,7 +4649,7 @@ void Node3DEditor::set_state(const Dictionary &p_state) {
if (use != view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN))) {
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN), use);
- VisualServer::get_singleton()->instance_set_visible(origin_instance, use);
+ RenderingServer::get_singleton()->instance_set_visible(origin_instance, use);
}
}
@@ -4954,7 +4954,7 @@ void Node3DEditor::_menu_item_pressed(int p_option) {
bool is_checked = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(p_option));
origin_enabled = !is_checked;
- VisualServer::get_singleton()->instance_set_visible(origin_instance, origin_enabled);
+ RenderingServer::get_singleton()->instance_set_visible(origin_instance, origin_enabled);
// Update the grid since its appearance depends on whether the origin is enabled
_finish_grid();
_init_grid();
@@ -4969,7 +4969,7 @@ void Node3DEditor::_menu_item_pressed(int p_option) {
for (int i = 0; i < 3; ++i) {
if (grid_enable[i]) {
- VisualServer::get_singleton()->instance_set_visible(grid_instance[i], grid_enabled);
+ RenderingServer::get_singleton()->instance_set_visible(grid_instance[i], grid_enabled);
grid_visible[i] = grid_enabled;
}
}
@@ -5129,19 +5129,19 @@ void Node3DEditor::_init_indicators() {
_init_grid();
- origin = VisualServer::get_singleton()->mesh_create();
+ origin = RenderingServer::get_singleton()->mesh_create();
Array d;
- d.resize(VS::ARRAY_MAX);
- d[VisualServer::ARRAY_VERTEX] = origin_points;
- d[VisualServer::ARRAY_COLOR] = origin_colors;
+ d.resize(RS::ARRAY_MAX);
+ d[RenderingServer::ARRAY_VERTEX] = origin_points;
+ d[RenderingServer::ARRAY_COLOR] = origin_colors;
- VisualServer::get_singleton()->mesh_add_surface_from_arrays(origin, VisualServer::PRIMITIVE_LINES, d);
- VisualServer::get_singleton()->mesh_surface_set_material(origin, 0, indicator_mat->get_rid());
+ RenderingServer::get_singleton()->mesh_add_surface_from_arrays(origin, RenderingServer::PRIMITIVE_LINES, d);
+ RenderingServer::get_singleton()->mesh_surface_set_material(origin, 0, indicator_mat->get_rid());
- origin_instance = VisualServer::get_singleton()->instance_create2(origin, get_tree()->get_root()->get_world()->get_scenario());
- VS::get_singleton()->instance_set_layer_mask(origin_instance, 1 << Node3DEditorViewport::GIZMO_GRID_LAYER);
+ origin_instance = RenderingServer::get_singleton()->instance_create2(origin, get_tree()->get_root()->get_world()->get_scenario());
+ RS::get_singleton()->instance_set_layer_mask(origin_instance, 1 << Node3DEditorViewport::GIZMO_GRID_LAYER);
- VisualServer::get_singleton()->instance_geometry_set_cast_shadows_setting(origin_instance, VS::SHADOW_CASTING_SETTING_OFF);
+ RenderingServer::get_singleton()->instance_geometry_set_cast_shadows_setting(origin_instance, RS::SHADOW_CASTING_SETTING_OFF);
}
{
@@ -5506,33 +5506,33 @@ void Node3DEditor::_init_grid() {
grid_colors[i].push_back(line_color);
}
- grid[i] = VisualServer::get_singleton()->mesh_create();
+ grid[i] = RenderingServer::get_singleton()->mesh_create();
Array d;
- d.resize(VS::ARRAY_MAX);
- d[VisualServer::ARRAY_VERTEX] = grid_points[i];
- d[VisualServer::ARRAY_COLOR] = grid_colors[i];
- VisualServer::get_singleton()->mesh_add_surface_from_arrays(grid[i], VisualServer::PRIMITIVE_LINES, d);
- VisualServer::get_singleton()->mesh_surface_set_material(grid[i], 0, indicator_mat->get_rid());
- grid_instance[i] = VisualServer::get_singleton()->instance_create2(grid[i], get_tree()->get_root()->get_world()->get_scenario());
+ d.resize(RS::ARRAY_MAX);
+ d[RenderingServer::ARRAY_VERTEX] = grid_points[i];
+ d[RenderingServer::ARRAY_COLOR] = grid_colors[i];
+ RenderingServer::get_singleton()->mesh_add_surface_from_arrays(grid[i], RenderingServer::PRIMITIVE_LINES, d);
+ RenderingServer::get_singleton()->mesh_surface_set_material(grid[i], 0, indicator_mat->get_rid());
+ grid_instance[i] = RenderingServer::get_singleton()->instance_create2(grid[i], get_tree()->get_root()->get_world()->get_scenario());
- VisualServer::get_singleton()->instance_set_visible(grid_instance[i], grid_visible[i]);
- VisualServer::get_singleton()->instance_geometry_set_cast_shadows_setting(grid_instance[i], VS::SHADOW_CASTING_SETTING_OFF);
- VS::get_singleton()->instance_set_layer_mask(grid_instance[i], 1 << Node3DEditorViewport::GIZMO_GRID_LAYER);
+ RenderingServer::get_singleton()->instance_set_visible(grid_instance[i], grid_visible[i]);
+ RenderingServer::get_singleton()->instance_geometry_set_cast_shadows_setting(grid_instance[i], RS::SHADOW_CASTING_SETTING_OFF);
+ RS::get_singleton()->instance_set_layer_mask(grid_instance[i], 1 << Node3DEditorViewport::GIZMO_GRID_LAYER);
}
}
void Node3DEditor::_finish_indicators() {
- VisualServer::get_singleton()->free(origin_instance);
- VisualServer::get_singleton()->free(origin);
+ RenderingServer::get_singleton()->free(origin_instance);
+ RenderingServer::get_singleton()->free(origin);
_finish_grid();
}
void Node3DEditor::_finish_grid() {
for (int i = 0; i < 3; i++) {
- VisualServer::get_singleton()->free(grid_instance[i]);
- VisualServer::get_singleton()->free(grid[i]);
+ RenderingServer::get_singleton()->free(grid_instance[i]);
+ RenderingServer::get_singleton()->free(grid[i]);
}
}
@@ -5658,8 +5658,8 @@ void Node3DEditor::snap_selected_nodes_to_floor() {
}
}
- PhysicsDirectSpaceState *ss = get_tree()->get_root()->get_world()->get_direct_space_state();
- PhysicsDirectSpaceState::RayResult result;
+ PhysicsDirectSpaceState3D *ss = get_tree()->get_root()->get_world()->get_direct_space_state();
+ PhysicsDirectSpaceState3D::RayResult result;
Array keys = snap_data.keys();
@@ -5952,11 +5952,11 @@ void Node3DEditor::clear() {
viewports[i]->reset();
}
- VisualServer::get_singleton()->instance_set_visible(origin_instance, true);
+ RenderingServer::get_singleton()->instance_set_visible(origin_instance, true);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN), true);
for (int i = 0; i < 3; ++i) {
if (grid_enable[i]) {
- VisualServer::get_singleton()->instance_set_visible(grid_instance[i], true);
+ RenderingServer::get_singleton()->instance_set_visible(grid_instance[i], true);
grid_visible[i] = true;
}
}
@@ -6313,7 +6313,7 @@ Node3DEditor::Node3DEditor(EditorNode *p_editor) {
xform_dialog->connect("confirmed", callable_mp(this, &Node3DEditor::_xform_dialog_action));
- scenario_debug = VisualServer::SCENARIO_DEBUG_DISABLED;
+ scenario_debug = RenderingServer::SCENARIO_DEBUG_DISABLED;
selected = NULL;
diff --git a/editor/plugins/node_3d_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h
index af6bc43b80..4b9f5a605b 100644
--- a/editor/plugins/node_3d_editor_plugin.h
+++ b/editor/plugins/node_3d_editor_plugin.h
@@ -578,7 +578,7 @@ private:
ToolMode tool_mode;
bool orthogonal;
- VisualServer::ScenarioDebugMode scenario_debug;
+ RenderingServer::ScenarioDebugMode scenario_debug;
RID origin;
RID origin_instance;
diff --git a/editor/plugins/polygon_2d_editor_plugin.cpp b/editor/plugins/polygon_2d_editor_plugin.cpp
index 5a94c95dd7..f570baa885 100644
--- a/editor/plugins/polygon_2d_editor_plugin.cpp
+++ b/editor/plugins/polygon_2d_editor_plugin.cpp
@@ -990,9 +990,9 @@ void Polygon2DEditor::_uv_draw() {
mtx.elements[2] = -uv_draw_ofs;
mtx.scale_basis(Vector2(uv_draw_zoom, uv_draw_zoom));
- VS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(), mtx);
+ RS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(), mtx);
uv_edit_draw->draw_texture(base_tex, Point2());
- VS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(), Transform2D());
+ RS::get_singleton()->canvas_item_add_set_transform(uv_edit_draw->get_canvas_item(), Transform2D());
if (snap_show_grid) {
Color grid_color = Color(1.0, 1.0, 1.0, 0.15);
diff --git a/editor/plugins/shader_editor_plugin.cpp b/editor/plugins/shader_editor_plugin.cpp
index c38bb09567..29ebfc8f7a 100644
--- a/editor/plugins/shader_editor_plugin.cpp
+++ b/editor/plugins/shader_editor_plugin.cpp
@@ -39,7 +39,7 @@
#include "editor/editor_settings.h"
#include "editor/property_editor.h"
#include "servers/display_server.h"
-#include "servers/visual/shader_types.h"
+#include "servers/rendering/shader_types.h"
/*** SHADER SCRIPT EDITOR ****/
@@ -150,16 +150,16 @@ void ShaderTextEditor::_load_theme_settings() {
if (shader.is_valid()) {
- for (const Map<StringName, ShaderLanguage::FunctionInfo>::Element *E = ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())).front(); E; E = E->next()) {
+ for (const Map<StringName, ShaderLanguage::FunctionInfo>::Element *E = ShaderTypes::get_singleton()->get_functions(RenderingServer::ShaderMode(shader->get_mode())).front(); E; E = E->next()) {
for (const Map<StringName, ShaderLanguage::BuiltInInfo>::Element *F = E->get().built_ins.front(); F; F = F->next()) {
keywords.push_back(F->key());
}
}
- for (int i = 0; i < ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())).size(); i++) {
+ for (int i = 0; i < ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader->get_mode())).size(); i++) {
- keywords.push_back(ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode()))[i]);
+ keywords.push_back(ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader->get_mode()))[i]);
}
}
@@ -200,7 +200,7 @@ void ShaderTextEditor::_code_complete_script(const String &p_code, List<ScriptCo
ShaderLanguage sl;
String calltip;
- sl.complete(p_code, ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_types(), r_options, calltip);
+ sl.complete(p_code, ShaderTypes::get_singleton()->get_functions(RenderingServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_types(), r_options, calltip);
get_text_edit()->set_code_hint(calltip);
}
@@ -215,7 +215,7 @@ void ShaderTextEditor::_validate_script() {
ShaderLanguage sl;
- Error err = sl.compile(code, ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_types());
+ Error err = sl.compile(code, ShaderTypes::get_singleton()->get_functions(RenderingServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(shader->get_mode())), ShaderTypes::get_singleton()->get_types());
if (err != OK) {
String error_text = "error(" + itos(sl.get_error_line()) + "): " + sl.get_error_text();
diff --git a/editor/plugins/shader_editor_plugin.h b/editor/plugins/shader_editor_plugin.h
index 900b40bd7a..f02ed590fc 100644
--- a/editor/plugins/shader_editor_plugin.h
+++ b/editor/plugins/shader_editor_plugin.h
@@ -39,7 +39,7 @@
#include "scene/gui/text_edit.h"
#include "scene/main/timer.h"
#include "scene/resources/shader.h"
-#include "servers/visual/shader_language.h"
+#include "servers/rendering/shader_language.h"
class ShaderTextEditor : public CodeTextEditor {
diff --git a/editor/plugins/texture_region_editor_plugin.cpp b/editor/plugins/texture_region_editor_plugin.cpp
index 029159180c..d453598e33 100644
--- a/editor/plugins/texture_region_editor_plugin.cpp
+++ b/editor/plugins/texture_region_editor_plugin.cpp
@@ -68,9 +68,9 @@ void TextureRegionEditor::_region_draw() {
mtx.elements[2] = -draw_ofs * draw_zoom;
mtx.scale_basis(Vector2(draw_zoom, draw_zoom));
- VS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(), mtx);
+ RS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(), mtx);
edit_draw->draw_texture(base_tex, Point2());
- VS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(), Transform2D());
+ RS::get_singleton()->canvas_item_add_set_transform(edit_draw->get_canvas_item(), Transform2D());
if (snap_mode == SNAP_GRID) {
Color grid_color = Color(1.0, 1.0, 1.0, 0.15);
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp
index f5ffcc1a28..f479139e4d 100644
--- a/editor/plugins/tile_set_editor_plugin.cpp
+++ b/editor/plugins/tile_set_editor_plugin.cpp
@@ -528,8 +528,8 @@ TileSetEditor::TileSetEditor(EditorNode *p_editor) {
toolbar->add_child(spin_priority);
spin_z_index = memnew(SpinBox);
- spin_z_index->set_min(VS::CANVAS_ITEM_Z_MIN);
- spin_z_index->set_max(VS::CANVAS_ITEM_Z_MAX);
+ spin_z_index->set_min(RS::CANVAS_ITEM_Z_MIN);
+ spin_z_index->set_max(RS::CANVAS_ITEM_Z_MAX);
spin_z_index->set_step(1);
spin_z_index->set_custom_minimum_size(Size2(100, 0));
spin_z_index->connect("value_changed", callable_mp(this, &TileSetEditor::_on_z_index_changed));
@@ -3485,7 +3485,7 @@ void TilesetEditorContext::_get_property_list(List<PropertyInfo> *p_list) const
p_list->push_back(PropertyInfo(Variant::VECTOR2, "tile_navigation_offset"));
p_list->push_back(PropertyInfo(Variant::VECTOR2, "tile_shape_offset", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR));
p_list->push_back(PropertyInfo(Variant::VECTOR2, "tile_shape_transform", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_EDITOR));
- p_list->push_back(PropertyInfo(Variant::INT, "tile_z_index", PROPERTY_HINT_RANGE, itos(VS::CANVAS_ITEM_Z_MIN) + "," + itos(VS::CANVAS_ITEM_Z_MAX) + ",1"));
+ p_list->push_back(PropertyInfo(Variant::INT, "tile_z_index", PROPERTY_HINT_RANGE, itos(RS::CANVAS_ITEM_Z_MIN) + "," + itos(RS::CANVAS_ITEM_Z_MAX) + ",1"));
}
if (tileset_editor->edit_mode == TileSetEditor::EDITMODE_COLLISION && tileset_editor->edited_collision_shape.is_valid()) {
p_list->push_back(PropertyInfo(Variant::OBJECT, "selected_collision", PROPERTY_HINT_RESOURCE_TYPE, tileset_editor->edited_collision_shape->get_class()));
diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp
index 36f81b21ba..594dc400ec 100644
--- a/editor/plugins/visual_shader_editor_plugin.cpp
+++ b/editor/plugins/visual_shader_editor_plugin.cpp
@@ -45,7 +45,7 @@
#include "scene/main/window.h"
#include "scene/resources/visual_shader_nodes.h"
#include "servers/display_server.h"
-#include "servers/visual/shader_types.h"
+#include "servers/rendering/shader_types.h"
Control *VisualShaderNodePlugin::create_editor(const Ref<Resource> &p_parent_resource, const Ref<VisualShaderNode> &p_node) {
@@ -2263,7 +2263,7 @@ void VisualShaderEditor::_update_preview() {
ShaderLanguage sl;
- Error err = sl.compile(code, ShaderTypes::get_singleton()->get_functions(VisualServer::ShaderMode(visual_shader->get_mode())), ShaderTypes::get_singleton()->get_modes(VisualServer::ShaderMode(visual_shader->get_mode())), ShaderTypes::get_singleton()->get_types());
+ Error err = sl.compile(code, ShaderTypes::get_singleton()->get_functions(RenderingServer::ShaderMode(visual_shader->get_mode())), ShaderTypes::get_singleton()->get_modes(RenderingServer::ShaderMode(visual_shader->get_mode())), ShaderTypes::get_singleton()->get_types());
for (int i = 0; i < preview_text->get_line_count(); i++) {
preview_text->set_line_as_marked(i, false);
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index 41e15f47cc..8c5b078de0 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -1500,7 +1500,7 @@ void CustomPropertyEditor::_draw_easing() {
iflp = 1.0 - iflp;
}
- VisualServer::get_singleton()->canvas_item_add_line(ci, Point2(iflp * s.width, prev * s.height), Point2(ifl * s.width, h * s.height), color);
+ RenderingServer::get_singleton()->canvas_item_add_line(ci, Point2(iflp * s.width, prev * s.height), Point2(ifl * s.width, h * s.height), color);
prev = h;
}
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index 7d429eb4b5..4b382f09f4 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -47,7 +47,7 @@
#include "scene/main/window.h"
#include "scene/resources/packed_scene.h"
#include "servers/display_server.h"
-#include "servers/visual_server.h"
+#include "servers/rendering_server.h"
void SceneTreeDock::_nodes_drag_begin() {