did more
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://dtccwj1qujhxp"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://djvqisfxi1l0b" path="res://Scenes/Characters/Player.tscn" id="1_ebmjs"]
|
||||
[ext_resource type="Texture2D" uid="uid://bj23bn0s4mt0d" path="res://icon.svg" id="1_qxrlw"]
|
||||
[ext_resource type="Texture2D" uid="uid://ch0aljsxfwrd6" path="res://icon.svg" id="1_qxrlw"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_wrm1d"]
|
||||
albedo_texture = ExtResource("1_qxrlw")
|
||||
@@ -45,8 +45,7 @@ shape = SubResource("WorldBoundaryShape3D_ebmjs")
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.039711, 1, -0.146652)
|
||||
|
||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.703544, 0.710652, 0, -0.710652, 0.703544, 0, 7.28685, 0)
|
||||
|
||||
[node name="SteamAudioManager" type="SteamAudioManager" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.70354384, 0.7106518, 0, -0.7106518, 0.70354384, -1.0560093, 9.826818, -1.0042496)
|
||||
|
||||
[node name="SteamAudioSource" type="SteamAudioSource" parent="."]
|
||||
attenuation_model = 0
|
||||
|
||||
@@ -3,19 +3,20 @@
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://ch0aljsxfwrd6"
|
||||
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
|
||||
path.s3tc="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.s3tc.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
"imported_formats": ["s3tc_bptc"],
|
||||
"vram_texture": true
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://icon.svg"
|
||||
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
|
||||
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.s3tc.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/mode=2
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
@@ -23,7 +24,7 @@ compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
@@ -37,7 +38,7 @@ process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
detect_3d/compress_to=0
|
||||
svg/scale=1.0
|
||||
editor/scale_with_editor_scale=false
|
||||
editor/convert_colors_with_editor_theme=false
|
||||
|
||||
@@ -13,3 +13,11 @@ config_version=5
|
||||
config/name="demo"
|
||||
config/features=PackedStringArray("4.5", "Forward Plus")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
[steam_audio]
|
||||
|
||||
ray_tracer/RayTracer=0
|
||||
spatializer/spatializer=0
|
||||
spatializer/HRTF/Sofa_File=0.0
|
||||
sampling_rate=0
|
||||
buffer_size=0
|
||||
|
||||
2
extern/godot-cpp
vendored
2
extern/godot-cpp
vendored
Submodule extern/godot-cpp updated: e4b7c25e72...449e37fa21
2
extern/steam-audio
vendored
2
extern/steam-audio
vendored
Submodule extern/steam-audio updated: eba1798c11...f398d69fa5
@@ -8,14 +8,15 @@ void initialize_steam_audio(ModuleInitializationLevel p_level) {
|
||||
if (p_level!=MODULE_INITIALIZATION_LEVEL_SCENE && p_level != MODULE_INITIALIZATION_LEVEL_SERVERS) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_level == MODULE_INITIALIZATION_LEVEL_SERVERS) {
|
||||
GDREGISTER_CLASS(SteamAudioServer);
|
||||
srv = memnew(SteamAudioServer);
|
||||
}
|
||||
|
||||
if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE) {
|
||||
register_steam_audio_settings();
|
||||
GDREGISTER_RUNTIME_CLASS(SteamAudio);
|
||||
GDREGISTER_RUNTIME_CLASS(SteamAudioServer)
|
||||
GDREGISTER_RUNTIME_CLASS(SteamAudioMaterial);
|
||||
GDREGISTER_RUNTIME_CLASS(SteamAudioListener);
|
||||
GDREGISTER_RUNTIME_CLASS(SteamAudioSource);
|
||||
@@ -28,6 +29,7 @@ void uninitialize_steam_audio(ModuleInitializationLevel p_level) {
|
||||
if (p_level == MODULE_INITIALIZATION_LEVEL_SERVERS) {
|
||||
memdelete(srv);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void register_steam_audio_settings() {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
using namespace godot;
|
||||
|
||||
SteamAudioServer::SteamAudioServer() {
|
||||
initialize();
|
||||
|
||||
}
|
||||
|
||||
SteamAudioServer::~SteamAudioServer() {
|
||||
@@ -15,6 +15,8 @@ void SteamAudioServer::_bind_methods() {
|
||||
}
|
||||
|
||||
void SteamAudioServer::initialize() {
|
||||
if (Engine::get_singleton()->is_editor_hint())
|
||||
return;
|
||||
IPLerror err = iplContextCreate(&ctxSettings,&ctx);
|
||||
if (err!=IPL_STATUS_SUCCESS) {
|
||||
ERR_PRINT("Failed to create IPL context");
|
||||
@@ -50,8 +52,12 @@ void SteamAudioServer::shutdown() {
|
||||
void SteamAudioServer::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_POSTINITIALIZE:
|
||||
|
||||
initialize();
|
||||
|
||||
directThread.instantiate();
|
||||
indirectThread.instantiate();
|
||||
|
||||
directThread->start(callable_mp(this,&SteamAudioServer::start_direct_thread),Thread::PRIORITY_NORMAL);
|
||||
indirectThread->start(callable_mp(this,&SteamAudioServer::start_indirect_thread),Thread::PRIORITY_NORMAL);
|
||||
}
|
||||
@@ -61,4 +67,8 @@ void SteamAudioServer::start_direct_thread() {
|
||||
}
|
||||
void SteamAudioServer::start_indirect_thread() {
|
||||
iplSimulatorRunReflections(simulator);
|
||||
}
|
||||
}
|
||||
|
||||
void SteamAudioServer::register_audio_source(SteamAudioSource *source) {
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,16 @@ using namespace godot;
|
||||
class SteamAudioServer : public Object {
|
||||
GDCLASS(SteamAudioServer, Object) // Godot class declaration macro
|
||||
private:
|
||||
struct AudioSourceData {
|
||||
Vector<AudioFrame> input_buffer;
|
||||
Vector<AudioFrame> output_buffer;
|
||||
IPLSource source;
|
||||
Transform3D transform;
|
||||
bool needs_processing = false;
|
||||
};
|
||||
|
||||
std::unordered_map<SteamAudioSource*,AudioSourceData> audio_sources;
|
||||
Ref<Mutex> audio_mutex;
|
||||
IPLContext ctx=nullptr;
|
||||
IPLContextSettings ctxSettings;
|
||||
IPLAudioSettings audioSettings;
|
||||
@@ -40,6 +50,10 @@ public:
|
||||
SteamAudioServer(); // Constructor
|
||||
~SteamAudioServer() override; // Destructor
|
||||
void _notification(int p_what);
|
||||
void register_audio_source(SteamAudioSource *source);
|
||||
void unregister_audio_source(SteamAudioSource *source);
|
||||
void process_audio_source(SteamAudioSource *source, const Vector<AudioFrame> &input_buffer);
|
||||
Vector<AudioFrame> get_processed_audio_buffer(SteamAudioSource *source);
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
Reference in New Issue
Block a user