2014-02-10 01:10:30 +00:00
|
|
|
/*************************************************************************/
|
|
|
|
/* register_server_types.cpp */
|
|
|
|
/*************************************************************************/
|
|
|
|
/* This file is part of: */
|
|
|
|
/* GODOT ENGINE */
|
2017-08-27 12:16:55 +00:00
|
|
|
/* https://godotengine.org */
|
2014-02-10 01:10:30 +00:00
|
|
|
/*************************************************************************/
|
2022-01-03 20:27:34 +00:00
|
|
|
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
|
|
|
|
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
|
2014-02-10 01:10:30 +00:00
|
|
|
/* */
|
|
|
|
/* Permission is hereby granted, free of charge, to any person obtaining */
|
|
|
|
/* a copy of this software and associated documentation files (the */
|
|
|
|
/* "Software"), to deal in the Software without restriction, including */
|
|
|
|
/* without limitation the rights to use, copy, modify, merge, publish, */
|
|
|
|
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
|
|
|
/* permit persons to whom the Software is furnished to do so, subject to */
|
|
|
|
/* the following conditions: */
|
|
|
|
/* */
|
|
|
|
/* The above copyright notice and this permission notice shall be */
|
|
|
|
/* included in all copies or substantial portions of the Software. */
|
|
|
|
/* */
|
|
|
|
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
|
|
|
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
|
|
|
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
|
|
|
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
|
|
|
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
|
|
|
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
|
|
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
|
|
/*************************************************************************/
|
2018-01-04 23:50:27 +00:00
|
|
|
|
2014-02-10 01:10:30 +00:00
|
|
|
#include "register_server_types.h"
|
2020-03-01 22:14:37 +00:00
|
|
|
|
2020-11-07 22:33:38 +00:00
|
|
|
#include "core/config/engine.h"
|
|
|
|
#include "core/config/project_settings.h"
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2017-01-21 22:00:25 +00:00
|
|
|
#include "audio/audio_effect.h"
|
2017-03-05 15:44:50 +00:00
|
|
|
#include "audio/audio_stream.h"
|
2017-01-21 22:00:25 +00:00
|
|
|
#include "audio/effects/audio_effect_amplify.h"
|
2021-01-28 19:47:50 +00:00
|
|
|
#include "audio/effects/audio_effect_capture.h"
|
2017-01-22 14:19:56 +00:00
|
|
|
#include "audio/effects/audio_effect_chorus.h"
|
2017-01-22 21:18:56 +00:00
|
|
|
#include "audio/effects/audio_effect_compressor.h"
|
2017-03-05 15:44:50 +00:00
|
|
|
#include "audio/effects/audio_effect_delay.h"
|
|
|
|
#include "audio/effects/audio_effect_distortion.h"
|
|
|
|
#include "audio/effects/audio_effect_eq.h"
|
|
|
|
#include "audio/effects/audio_effect_filter.h"
|
2017-01-22 23:39:53 +00:00
|
|
|
#include "audio/effects/audio_effect_limiter.h"
|
2017-03-05 15:44:50 +00:00
|
|
|
#include "audio/effects/audio_effect_panner.h"
|
2017-01-23 21:36:29 +00:00
|
|
|
#include "audio/effects/audio_effect_phaser.h"
|
2017-03-05 15:44:50 +00:00
|
|
|
#include "audio/effects/audio_effect_pitch_shift.h"
|
2018-01-18 15:03:53 +00:00
|
|
|
#include "audio/effects/audio_effect_record.h"
|
2017-03-05 15:44:50 +00:00
|
|
|
#include "audio/effects/audio_effect_reverb.h"
|
2019-04-10 15:57:03 +00:00
|
|
|
#include "audio/effects/audio_effect_spectrum_analyzer.h"
|
2017-03-05 15:44:50 +00:00
|
|
|
#include "audio/effects/audio_effect_stereo_enhance.h"
|
2019-04-10 15:57:03 +00:00
|
|
|
#include "audio/effects/audio_stream_generator.h"
|
2017-03-05 15:44:50 +00:00
|
|
|
#include "audio_server.h"
|
2017-08-20 14:17:24 +00:00
|
|
|
#include "camera/camera_feed.h"
|
|
|
|
#include "camera_server.h"
|
2022-02-06 01:29:08 +00:00
|
|
|
#include "debugger/servers_debugger.h"
|
2020-03-01 22:14:37 +00:00
|
|
|
#include "display_server.h"
|
Implement Running Godot as Movie Writer
* Allows running the game in "movie writer" mode.
* It ensures entirely stable framerate, so your run can be saved stable and with proper sound (which is impossible if your CPU/GPU can't sustain doing this in real-time).
* If disabling vsync, it can save movies faster than the game is run, but if you want to control the interaction it can get difficult.
* Implements a simple, default MJPEG writer.
This new features has two main use cases, which have high demand:
* Saving game videos in high quality and ensuring the frame rate is *completely* stable, always.
* Using Godot as a tool to make movies and animations (which is ideal if you want interaction, or creating them procedurally. No other software is as good for this).
**Note**: This feature **IS NOT** for capturing real-time footage. Use something like OBS, SimpleScreenRecorder or FRAPS to achieve that, as they do a much better job at intercepting the compositor than Godot can probably do using Vulkan or OpenGL natively. If your game runs near real-time when capturing, you can still use this feature but it will play no sound (sound will be saved directly).
Usage:
$ godot --write-movie movie.avi [scene_file.tscn]
Missing:
* Options for configuring video writing via GLOBAL_DEF
* UI Menu for launching with this mode from the editor.
* Add to list of command line options.
* Add a feature tag to override configurations when movie writing (fantastic for saving videos with highest quality settings).
2022-06-16 22:55:19 +00:00
|
|
|
#include "movie_writer/movie_writer.h"
|
|
|
|
#include "movie_writer/movie_writer_mjpeg.h"
|
2020-03-27 18:21:27 +00:00
|
|
|
#include "navigation_server_2d.h"
|
|
|
|
#include "navigation_server_3d.h"
|
2021-10-18 19:24:30 +00:00
|
|
|
#include "physics_2d/godot_physics_server_2d.h"
|
|
|
|
#include "physics_3d/godot_physics_server_3d.h"
|
2020-03-27 18:21:27 +00:00
|
|
|
#include "physics_server_2d.h"
|
2021-10-18 19:24:30 +00:00
|
|
|
#include "physics_server_2d_wrap_mt.h"
|
2020-03-27 18:21:27 +00:00
|
|
|
#include "physics_server_3d.h"
|
2021-10-18 19:24:30 +00:00
|
|
|
#include "physics_server_3d_wrap_mt.h"
|
2020-12-04 18:26:24 +00:00
|
|
|
#include "rendering/renderer_compositor.h"
|
2020-04-20 10:29:34 +00:00
|
|
|
#include "rendering/rendering_device.h"
|
2020-04-20 02:19:21 +00:00
|
|
|
#include "rendering/rendering_device_binds.h"
|
2020-03-27 18:21:27 +00:00
|
|
|
#include "rendering_server.h"
|
2022-03-14 14:52:03 +00:00
|
|
|
#include "servers/extensions/physics_server_3d_extension.h"
|
2020-03-27 18:21:27 +00:00
|
|
|
#include "servers/rendering/shader_types.h"
|
2022-02-13 12:41:29 +00:00
|
|
|
#include "text/text_server_dummy.h"
|
2021-08-27 21:19:51 +00:00
|
|
|
#include "text/text_server_extension.h"
|
2020-08-05 06:25:28 +00:00
|
|
|
#include "text_server.h"
|
2020-04-08 14:47:36 +00:00
|
|
|
#include "xr/xr_interface.h"
|
2021-08-23 05:23:16 +00:00
|
|
|
#include "xr/xr_interface_extension.h"
|
2020-04-08 14:47:36 +00:00
|
|
|
#include "xr/xr_positional_tracker.h"
|
|
|
|
#include "xr_server.h"
|
2017-01-15 19:06:14 +00:00
|
|
|
|
2020-04-01 23:20:12 +00:00
|
|
|
ShaderTypes *shader_types = nullptr;
|
2016-10-07 14:31:18 +00:00
|
|
|
|
2020-03-28 12:19:05 +00:00
|
|
|
PhysicsServer3D *_createGodotPhysics3DCallback() {
|
2022-01-29 16:35:50 +00:00
|
|
|
bool using_threads = GLOBAL_GET("physics/3d/run_on_separate_thread");
|
2021-02-09 16:19:03 +00:00
|
|
|
|
2022-04-27 03:52:53 +00:00
|
|
|
PhysicsServer3D *physics_server_3d = memnew(GodotPhysicsServer3D(using_threads));
|
2021-02-09 16:19:03 +00:00
|
|
|
|
2022-04-27 03:52:53 +00:00
|
|
|
return memnew(PhysicsServer3DWrapMT(physics_server_3d, using_threads));
|
2017-10-21 11:02:06 +00:00
|
|
|
}
|
|
|
|
|
2020-03-27 18:21:27 +00:00
|
|
|
PhysicsServer2D *_createGodotPhysics2DCallback() {
|
2022-01-29 16:35:50 +00:00
|
|
|
bool using_threads = GLOBAL_GET("physics/2d/run_on_separate_thread");
|
2021-02-09 16:19:03 +00:00
|
|
|
|
2022-04-27 03:52:53 +00:00
|
|
|
PhysicsServer2D *physics_server_2d = memnew(GodotPhysicsServer2D(using_threads));
|
2021-02-09 16:19:03 +00:00
|
|
|
|
2022-04-27 03:52:53 +00:00
|
|
|
return memnew(PhysicsServer2DWrapMT(physics_server_2d, using_threads));
|
2017-10-21 11:02:06 +00:00
|
|
|
}
|
|
|
|
|
2019-02-26 14:58:47 +00:00
|
|
|
static bool has_server_feature_callback(const String &p_feature) {
|
2020-03-27 18:21:27 +00:00
|
|
|
if (RenderingServer::get_singleton()) {
|
|
|
|
if (RenderingServer::get_singleton()->has_os_feature(p_feature)) {
|
2019-02-26 14:58:47 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
Implement Running Godot as Movie Writer
* Allows running the game in "movie writer" mode.
* It ensures entirely stable framerate, so your run can be saved stable and with proper sound (which is impossible if your CPU/GPU can't sustain doing this in real-time).
* If disabling vsync, it can save movies faster than the game is run, but if you want to control the interaction it can get difficult.
* Implements a simple, default MJPEG writer.
This new features has two main use cases, which have high demand:
* Saving game videos in high quality and ensuring the frame rate is *completely* stable, always.
* Using Godot as a tool to make movies and animations (which is ideal if you want interaction, or creating them procedurally. No other software is as good for this).
**Note**: This feature **IS NOT** for capturing real-time footage. Use something like OBS, SimpleScreenRecorder or FRAPS to achieve that, as they do a much better job at intercepting the compositor than Godot can probably do using Vulkan or OpenGL natively. If your game runs near real-time when capturing, you can still use this feature but it will play no sound (sound will be saved directly).
Usage:
$ godot --write-movie movie.avi [scene_file.tscn]
Missing:
* Options for configuring video writing via GLOBAL_DEF
* UI Menu for launching with this mode from the editor.
* Add to list of command line options.
* Add a feature tag to override configurations when movie writing (fantastic for saving videos with highest quality settings).
2022-06-16 22:55:19 +00:00
|
|
|
static MovieWriterMJPEG *writer_mjpeg = nullptr;
|
|
|
|
static MovieWriterPNGWAV *writer_pngwav = nullptr;
|
|
|
|
|
2022-05-26 12:51:42 +00:00
|
|
|
void register_server_types() {
|
2019-08-20 20:54:03 +00:00
|
|
|
shader_types = memnew(ShaderTypes);
|
2021-02-17 16:44:49 +00:00
|
|
|
|
2021-08-27 21:19:51 +00:00
|
|
|
GDREGISTER_CLASS(TextServerManager);
|
2022-03-10 07:17:38 +00:00
|
|
|
GDREGISTER_ABSTRACT_CLASS(TextServer);
|
2021-08-27 21:19:51 +00:00
|
|
|
GDREGISTER_CLASS(TextServerExtension);
|
2022-02-13 12:41:29 +00:00
|
|
|
GDREGISTER_CLASS(TextServerDummy);
|
2021-08-27 21:19:51 +00:00
|
|
|
|
2022-03-16 18:14:15 +00:00
|
|
|
GDREGISTER_NATIVE_STRUCT(Glyph, "int start = -1;int end = -1;uint8_t count = 0;uint8_t repeat = 1;uint16_t flags = 0;float x_off = 0.f;float y_off = 0.f;float advance = 0.f;RID font_rid;int font_size = 0;int32_t index = 0");
|
|
|
|
GDREGISTER_NATIVE_STRUCT(CaretInfo, "Rect2 leading_caret;Rect2 trailing_caret;TextServer::Direction leading_direction;TextServer::Direction trailing_direction");
|
2022-03-14 14:52:03 +00:00
|
|
|
|
2021-08-27 21:19:51 +00:00
|
|
|
Engine::get_singleton()->add_singleton(Engine::Singleton("TextServerManager", TextServerManager::get_singleton(), "TextServerManager"));
|
2019-08-20 20:54:03 +00:00
|
|
|
|
2019-02-26 14:58:47 +00:00
|
|
|
OS::get_singleton()->set_has_server_feature_callback(has_server_feature_callback);
|
|
|
|
|
2022-03-10 07:17:38 +00:00
|
|
|
GDREGISTER_ABSTRACT_CLASS(DisplayServer);
|
|
|
|
GDREGISTER_ABSTRACT_CLASS(RenderingServer);
|
2021-07-11 22:30:33 +00:00
|
|
|
GDREGISTER_CLASS(AudioServer);
|
2020-08-05 06:25:28 +00:00
|
|
|
|
2022-03-10 07:17:38 +00:00
|
|
|
GDREGISTER_ABSTRACT_CLASS(PhysicsServer2D);
|
|
|
|
GDREGISTER_ABSTRACT_CLASS(PhysicsServer3D);
|
2022-03-14 14:52:03 +00:00
|
|
|
GDREGISTER_VIRTUAL_CLASS(PhysicsServer3DExtension);
|
|
|
|
GDREGISTER_VIRTUAL_CLASS(PhysicsDirectBodyState3DExtension);
|
|
|
|
GDREGISTER_VIRTUAL_CLASS(PhysicsDirectSpaceState3DExtension)
|
|
|
|
GDREGISTER_VIRTUAL_CLASS(PhysicsServer3DRenderingServerHandler)
|
|
|
|
|
2022-03-16 18:14:15 +00:00
|
|
|
GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionRayResult, "Vector3 position;Vector3 normal;RID rid;ObjectID collider_id;Object *collider;int shape");
|
|
|
|
GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionShapeResult, "RID rid;ObjectID collider_id;Object *collider;int shape");
|
|
|
|
GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionShapeRestInfo, "Vector3 point;Vector3 normal;RID rid;ObjectID collider_id;int shape;Vector3 linear_velocity");
|
|
|
|
GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionMotionCollision, "Vector3 position;Vector3 normal;Vector3 collider_velocity;real_t depth;int local_shape;ObjectID collider_id;RID collider;int collider_shape");
|
|
|
|
GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionMotionResult, "Vector3 travel;Vector3 remainder;real_t collision_safe_fraction;real_t collision_unsafe_fraction;PhysicsServer3DExtensionMotionCollision collisions[32];int collision_count");
|
2022-03-14 14:52:03 +00:00
|
|
|
GDREGISTER_NATIVE_STRUCT(PhysicsServer3DExtensionStateCallback, "void *instance;void (*callback)(void *p_instance, PhysicsDirectBodyState3D *p_state)");
|
|
|
|
|
2022-03-10 07:17:38 +00:00
|
|
|
GDREGISTER_ABSTRACT_CLASS(NavigationServer2D);
|
|
|
|
GDREGISTER_ABSTRACT_CLASS(NavigationServer3D);
|
2021-07-11 22:30:33 +00:00
|
|
|
GDREGISTER_CLASS(XRServer);
|
|
|
|
GDREGISTER_CLASS(CameraServer);
|
2017-10-09 21:49:17 +00:00
|
|
|
|
2022-03-10 07:17:38 +00:00
|
|
|
GDREGISTER_ABSTRACT_CLASS(RenderingDevice);
|
2020-04-20 10:29:34 +00:00
|
|
|
|
2022-03-10 07:17:38 +00:00
|
|
|
GDREGISTER_ABSTRACT_CLASS(XRInterface);
|
2021-08-23 05:23:16 +00:00
|
|
|
GDREGISTER_CLASS(XRInterfaceExtension); // can't register this as virtual because we need a creation function for our extensions.
|
2021-08-29 06:05:11 +00:00
|
|
|
GDREGISTER_CLASS(XRPose);
|
2021-07-11 22:30:33 +00:00
|
|
|
GDREGISTER_CLASS(XRPositionalTracker);
|
2020-04-08 14:47:36 +00:00
|
|
|
|
2021-08-23 17:53:27 +00:00
|
|
|
GDREGISTER_CLASS(AudioStream);
|
|
|
|
GDREGISTER_CLASS(AudioStreamPlayback);
|
2021-07-11 22:30:33 +00:00
|
|
|
GDREGISTER_VIRTUAL_CLASS(AudioStreamPlaybackResampled);
|
|
|
|
GDREGISTER_CLASS(AudioStreamMicrophone);
|
2021-09-12 06:57:09 +00:00
|
|
|
GDREGISTER_CLASS(AudioStreamRandomizer);
|
2021-07-11 22:30:33 +00:00
|
|
|
GDREGISTER_VIRTUAL_CLASS(AudioEffect);
|
|
|
|
GDREGISTER_VIRTUAL_CLASS(AudioEffectInstance);
|
|
|
|
GDREGISTER_CLASS(AudioEffectEQ);
|
|
|
|
GDREGISTER_CLASS(AudioEffectFilter);
|
|
|
|
GDREGISTER_CLASS(AudioBusLayout);
|
2017-01-21 22:00:25 +00:00
|
|
|
|
2021-07-11 22:30:33 +00:00
|
|
|
GDREGISTER_CLASS(AudioStreamGenerator);
|
2022-03-10 07:17:38 +00:00
|
|
|
GDREGISTER_ABSTRACT_CLASS(AudioStreamGeneratorPlayback);
|
2019-04-10 15:57:03 +00:00
|
|
|
|
2017-01-22 14:19:56 +00:00
|
|
|
{
|
|
|
|
//audio effects
|
2021-07-11 22:30:33 +00:00
|
|
|
GDREGISTER_CLASS(AudioEffectAmplify);
|
2017-01-21 22:00:25 +00:00
|
|
|
|
2021-07-11 22:30:33 +00:00
|
|
|
GDREGISTER_CLASS(AudioEffectReverb);
|
2017-01-21 22:00:25 +00:00
|
|
|
|
2021-07-11 22:30:33 +00:00
|
|
|
GDREGISTER_CLASS(AudioEffectLowPassFilter);
|
|
|
|
GDREGISTER_CLASS(AudioEffectHighPassFilter);
|
|
|
|
GDREGISTER_CLASS(AudioEffectBandPassFilter);
|
|
|
|
GDREGISTER_CLASS(AudioEffectNotchFilter);
|
|
|
|
GDREGISTER_CLASS(AudioEffectBandLimitFilter);
|
|
|
|
GDREGISTER_CLASS(AudioEffectLowShelfFilter);
|
|
|
|
GDREGISTER_CLASS(AudioEffectHighShelfFilter);
|
2017-01-21 22:00:25 +00:00
|
|
|
|
2021-07-11 22:30:33 +00:00
|
|
|
GDREGISTER_CLASS(AudioEffectEQ6);
|
|
|
|
GDREGISTER_CLASS(AudioEffectEQ10);
|
|
|
|
GDREGISTER_CLASS(AudioEffectEQ21);
|
2017-01-21 22:00:25 +00:00
|
|
|
|
2021-07-11 22:30:33 +00:00
|
|
|
GDREGISTER_CLASS(AudioEffectDistortion);
|
2017-01-22 14:19:56 +00:00
|
|
|
|
2021-07-11 22:30:33 +00:00
|
|
|
GDREGISTER_CLASS(AudioEffectStereoEnhance);
|
2017-01-22 14:19:56 +00:00
|
|
|
|
2021-07-11 22:30:33 +00:00
|
|
|
GDREGISTER_CLASS(AudioEffectPanner);
|
|
|
|
GDREGISTER_CLASS(AudioEffectChorus);
|
|
|
|
GDREGISTER_CLASS(AudioEffectDelay);
|
|
|
|
GDREGISTER_CLASS(AudioEffectCompressor);
|
|
|
|
GDREGISTER_CLASS(AudioEffectLimiter);
|
|
|
|
GDREGISTER_CLASS(AudioEffectPitchShift);
|
|
|
|
GDREGISTER_CLASS(AudioEffectPhaser);
|
2019-04-10 15:57:03 +00:00
|
|
|
|
2021-07-11 22:30:33 +00:00
|
|
|
GDREGISTER_CLASS(AudioEffectRecord);
|
|
|
|
GDREGISTER_CLASS(AudioEffectSpectrumAnalyzer);
|
2022-03-10 07:17:38 +00:00
|
|
|
GDREGISTER_ABSTRACT_CLASS(AudioEffectSpectrumAnalyzerInstance);
|
2021-01-28 19:47:50 +00:00
|
|
|
|
2021-07-11 22:30:33 +00:00
|
|
|
GDREGISTER_CLASS(AudioEffectCapture);
|
2017-01-22 14:19:56 +00:00
|
|
|
}
|
2014-02-10 01:10:30 +00:00
|
|
|
|
2022-03-10 07:17:38 +00:00
|
|
|
GDREGISTER_ABSTRACT_CLASS(RenderingDevice);
|
2021-07-11 22:30:33 +00:00
|
|
|
GDREGISTER_CLASS(RDTextureFormat);
|
|
|
|
GDREGISTER_CLASS(RDTextureView);
|
|
|
|
GDREGISTER_CLASS(RDAttachmentFormat);
|
|
|
|
GDREGISTER_CLASS(RDFramebufferPass);
|
|
|
|
GDREGISTER_CLASS(RDSamplerState);
|
|
|
|
GDREGISTER_CLASS(RDVertexAttribute);
|
|
|
|
GDREGISTER_CLASS(RDUniform);
|
|
|
|
GDREGISTER_CLASS(RDPipelineRasterizationState);
|
|
|
|
GDREGISTER_CLASS(RDPipelineMultisampleState);
|
|
|
|
GDREGISTER_CLASS(RDPipelineDepthStencilState);
|
|
|
|
GDREGISTER_CLASS(RDPipelineColorBlendStateAttachment);
|
|
|
|
GDREGISTER_CLASS(RDPipelineColorBlendState);
|
|
|
|
GDREGISTER_CLASS(RDShaderSource);
|
Implement Binary Shader Compilation
* Added an extra stage before compiling shader, which is generating a binary blob.
* On Vulkan, this allows caching the SPIRV reflection information, which is expensive to parse.
* On other (future) RenderingDevices, it allows caching converted binary data, such as DXIL or MSL.
This PR makes the shader cache include the reflection information, hence editor startup times are significantly improved.
I tested this well and it appears to work, and I added a lot of consistency checks, but because it includes writing and reading binary information, rare bugs may pop up, so be aware.
There was not much of a choice for storing the reflection information, given shaders can be a lot, take a lot of space and take time to parse.
2021-07-25 14:22:55 +00:00
|
|
|
GDREGISTER_CLASS(RDShaderSPIRV);
|
2021-07-11 22:30:33 +00:00
|
|
|
GDREGISTER_CLASS(RDShaderFile);
|
|
|
|
GDREGISTER_CLASS(RDPipelineSpecializationConstant);
|
|
|
|
|
|
|
|
GDREGISTER_CLASS(CameraFeed);
|
|
|
|
|
2022-03-10 07:17:38 +00:00
|
|
|
GDREGISTER_ABSTRACT_CLASS(PhysicsDirectBodyState2D);
|
|
|
|
GDREGISTER_ABSTRACT_CLASS(PhysicsDirectSpaceState2D);
|
2021-11-02 01:00:58 +00:00
|
|
|
GDREGISTER_CLASS(PhysicsRayQueryParameters2D);
|
|
|
|
GDREGISTER_CLASS(PhysicsPointQueryParameters2D);
|
|
|
|
GDREGISTER_CLASS(PhysicsShapeQueryParameters2D);
|
2021-09-30 18:28:57 +00:00
|
|
|
GDREGISTER_CLASS(PhysicsTestMotionParameters2D);
|
2021-07-11 22:30:33 +00:00
|
|
|
GDREGISTER_CLASS(PhysicsTestMotionResult2D);
|
|
|
|
|
2022-03-10 07:17:38 +00:00
|
|
|
GDREGISTER_ABSTRACT_CLASS(PhysicsDirectBodyState3D);
|
|
|
|
GDREGISTER_ABSTRACT_CLASS(PhysicsDirectSpaceState3D);
|
2021-11-02 01:00:58 +00:00
|
|
|
GDREGISTER_CLASS(PhysicsRayQueryParameters3D);
|
|
|
|
GDREGISTER_CLASS(PhysicsPointQueryParameters3D);
|
|
|
|
GDREGISTER_CLASS(PhysicsShapeQueryParameters3D);
|
2021-09-30 18:28:57 +00:00
|
|
|
GDREGISTER_CLASS(PhysicsTestMotionParameters3D);
|
2021-07-11 22:30:33 +00:00
|
|
|
GDREGISTER_CLASS(PhysicsTestMotionResult3D);
|
2014-02-10 01:10:30 +00:00
|
|
|
|
Implement Running Godot as Movie Writer
* Allows running the game in "movie writer" mode.
* It ensures entirely stable framerate, so your run can be saved stable and with proper sound (which is impossible if your CPU/GPU can't sustain doing this in real-time).
* If disabling vsync, it can save movies faster than the game is run, but if you want to control the interaction it can get difficult.
* Implements a simple, default MJPEG writer.
This new features has two main use cases, which have high demand:
* Saving game videos in high quality and ensuring the frame rate is *completely* stable, always.
* Using Godot as a tool to make movies and animations (which is ideal if you want interaction, or creating them procedurally. No other software is as good for this).
**Note**: This feature **IS NOT** for capturing real-time footage. Use something like OBS, SimpleScreenRecorder or FRAPS to achieve that, as they do a much better job at intercepting the compositor than Godot can probably do using Vulkan or OpenGL natively. If your game runs near real-time when capturing, you can still use this feature but it will play no sound (sound will be saved directly).
Usage:
$ godot --write-movie movie.avi [scene_file.tscn]
Missing:
* Options for configuring video writing via GLOBAL_DEF
* UI Menu for launching with this mode from the editor.
* Add to list of command line options.
* Add a feature tag to override configurations when movie writing (fantastic for saving videos with highest quality settings).
2022-06-16 22:55:19 +00:00
|
|
|
GDREGISTER_VIRTUAL_CLASS(MovieWriter);
|
|
|
|
|
2022-02-06 01:29:08 +00:00
|
|
|
ServersDebugger::initialize();
|
|
|
|
|
2017-10-21 11:02:06 +00:00
|
|
|
// Physics 2D
|
2020-03-27 18:21:27 +00:00
|
|
|
GLOBAL_DEF(PhysicsServer2DManager::setting_property_name, "DEFAULT");
|
|
|
|
ProjectSettings::get_singleton()->set_custom_property_info(PhysicsServer2DManager::setting_property_name, PropertyInfo(Variant::STRING, PhysicsServer2DManager::setting_property_name, PROPERTY_HINT_ENUM, "DEFAULT"));
|
2017-10-21 11:02:06 +00:00
|
|
|
|
2020-03-28 12:33:24 +00:00
|
|
|
PhysicsServer2DManager::register_server("GodotPhysics2D", &_createGodotPhysics2DCallback);
|
|
|
|
PhysicsServer2DManager::set_default_server("GodotPhysics2D");
|
2017-10-21 11:02:06 +00:00
|
|
|
|
|
|
|
// Physics 3D
|
2020-03-27 18:21:27 +00:00
|
|
|
GLOBAL_DEF(PhysicsServer3DManager::setting_property_name, "DEFAULT");
|
|
|
|
ProjectSettings::get_singleton()->set_custom_property_info(PhysicsServer3DManager::setting_property_name, PropertyInfo(Variant::STRING, PhysicsServer3DManager::setting_property_name, PROPERTY_HINT_ENUM, "DEFAULT"));
|
2017-10-21 11:02:06 +00:00
|
|
|
|
2020-03-28 12:33:24 +00:00
|
|
|
PhysicsServer3DManager::register_server("GodotPhysics3D", &_createGodotPhysics3DCallback);
|
|
|
|
PhysicsServer3DManager::set_default_server("GodotPhysics3D");
|
Implement Running Godot as Movie Writer
* Allows running the game in "movie writer" mode.
* It ensures entirely stable framerate, so your run can be saved stable and with proper sound (which is impossible if your CPU/GPU can't sustain doing this in real-time).
* If disabling vsync, it can save movies faster than the game is run, but if you want to control the interaction it can get difficult.
* Implements a simple, default MJPEG writer.
This new features has two main use cases, which have high demand:
* Saving game videos in high quality and ensuring the frame rate is *completely* stable, always.
* Using Godot as a tool to make movies and animations (which is ideal if you want interaction, or creating them procedurally. No other software is as good for this).
**Note**: This feature **IS NOT** for capturing real-time footage. Use something like OBS, SimpleScreenRecorder or FRAPS to achieve that, as they do a much better job at intercepting the compositor than Godot can probably do using Vulkan or OpenGL natively. If your game runs near real-time when capturing, you can still use this feature but it will play no sound (sound will be saved directly).
Usage:
$ godot --write-movie movie.avi [scene_file.tscn]
Missing:
* Options for configuring video writing via GLOBAL_DEF
* UI Menu for launching with this mode from the editor.
* Add to list of command line options.
* Add a feature tag to override configurations when movie writing (fantastic for saving videos with highest quality settings).
2022-06-16 22:55:19 +00:00
|
|
|
|
|
|
|
writer_mjpeg = memnew(MovieWriterMJPEG);
|
|
|
|
MovieWriter::add_writer(writer_mjpeg);
|
|
|
|
|
|
|
|
writer_pngwav = memnew(MovieWriterPNGWAV);
|
|
|
|
MovieWriter::add_writer(writer_pngwav);
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
|
|
|
|
2017-03-05 15:44:50 +00:00
|
|
|
void unregister_server_types() {
|
2022-02-06 01:29:08 +00:00
|
|
|
ServersDebugger::deinitialize();
|
2017-03-05 15:44:50 +00:00
|
|
|
memdelete(shader_types);
|
Implement Running Godot as Movie Writer
* Allows running the game in "movie writer" mode.
* It ensures entirely stable framerate, so your run can be saved stable and with proper sound (which is impossible if your CPU/GPU can't sustain doing this in real-time).
* If disabling vsync, it can save movies faster than the game is run, but if you want to control the interaction it can get difficult.
* Implements a simple, default MJPEG writer.
This new features has two main use cases, which have high demand:
* Saving game videos in high quality and ensuring the frame rate is *completely* stable, always.
* Using Godot as a tool to make movies and animations (which is ideal if you want interaction, or creating them procedurally. No other software is as good for this).
**Note**: This feature **IS NOT** for capturing real-time footage. Use something like OBS, SimpleScreenRecorder or FRAPS to achieve that, as they do a much better job at intercepting the compositor than Godot can probably do using Vulkan or OpenGL natively. If your game runs near real-time when capturing, you can still use this feature but it will play no sound (sound will be saved directly).
Usage:
$ godot --write-movie movie.avi [scene_file.tscn]
Missing:
* Options for configuring video writing via GLOBAL_DEF
* UI Menu for launching with this mode from the editor.
* Add to list of command line options.
* Add a feature tag to override configurations when movie writing (fantastic for saving videos with highest quality settings).
2022-06-16 22:55:19 +00:00
|
|
|
memdelete(writer_mjpeg);
|
|
|
|
memdelete(writer_pngwav);
|
2014-02-10 01:10:30 +00:00
|
|
|
}
|
2017-10-21 11:02:06 +00:00
|
|
|
|
|
|
|
void register_server_singletons() {
|
2021-06-19 15:58:49 +00:00
|
|
|
Engine::get_singleton()->add_singleton(Engine::Singleton("DisplayServer", DisplayServer::get_singleton(), "DisplayServer"));
|
|
|
|
Engine::get_singleton()->add_singleton(Engine::Singleton("RenderingServer", RenderingServer::get_singleton(), "RenderingServer"));
|
|
|
|
Engine::get_singleton()->add_singleton(Engine::Singleton("AudioServer", AudioServer::get_singleton(), "AudioServer"));
|
|
|
|
Engine::get_singleton()->add_singleton(Engine::Singleton("PhysicsServer2D", PhysicsServer2D::get_singleton(), "PhysicsServer2D"));
|
|
|
|
Engine::get_singleton()->add_singleton(Engine::Singleton("PhysicsServer3D", PhysicsServer3D::get_singleton(), "PhysicsServer3D"));
|
|
|
|
Engine::get_singleton()->add_singleton(Engine::Singleton("NavigationServer2D", NavigationServer2D::get_singleton_mut(), "NavigationServer2D"));
|
|
|
|
Engine::get_singleton()->add_singleton(Engine::Singleton("NavigationServer3D", NavigationServer3D::get_singleton_mut(), "NavigationServer3D"));
|
|
|
|
Engine::get_singleton()->add_singleton(Engine::Singleton("XRServer", XRServer::get_singleton(), "XRServer"));
|
|
|
|
Engine::get_singleton()->add_singleton(Engine::Singleton("CameraServer", CameraServer::get_singleton(), "CameraServer"));
|
2017-10-21 11:02:06 +00:00
|
|
|
}
|