godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.12k stars 69 forks source link

Add a feature to bake more precise audio based on room-setting, materials . . . #3387

Closed charlesmlamb closed 1 year ago

charlesmlamb commented 2 years ago

Describe the project you are working on

A barbarian game, 2.5D, atm . . .

Describe the problem or limitation you are having in your project

Well, I've been looking at Alien : Isolation, on the PS3 and, it's quite good, any-way I like it, so on . . .

It has a sort-of to me, next - gen effects, graphics, at least, to me, it has good graphics, so on, got to wondering, could one for audio, bake some like a GIProbe, but an AcousticProbe, and then bake static sound - effects, to get a more accurate stereo - system, say for changing in sound, running down a corridor, or so, from a room, after say, an explosion . . . I know this sounds crazy, after trying Godot, and seeing there are GIProbes, that to me are super - advanced tech, also reflection - probes, I got to thinking, could one bake a sort of acoustics, maybe echo map, or something, from static geometry . . . It'd require stuff like setting acoustic parameters, for objects, but to begin with, a simple everything is a 0.5 rough, 0.5 metal would sort-of work . . . I think, one could estimate acoustic, almost accurately based on material properties, ie. how metallic, rough, etc . . One has the data, to make a 'reverberation' map, or acoustics map, at least for static sound effects, to get a better, or accurate sound, when running around a corner, so on . . . .

Well, after seeing how GIProbes to crazy things, calculate super - complex lighting stuff, for an entire scene, could one bake some sort - of acoustics, or sound - reverberation / reflection map, to get HI-FI sound, or at least improve the sound effect, prob. a very advanced feature, if one could sort-of just ' bake ' it, it might work well . . . Was just thinking, that might be the improvement, to Godot 4 sound engine, that sort of made sound more accurately simulated, esp. if it could take into account, the material properties, roughness, metal, it might be close, to normal reality, and give a really nice experience, even on a stereo system, or say head-set, to give an almost ' roomy ' feel, or echoes, sound fading, based on distance, acoustics, and surroundings . . . It's just an idea, don't know if it's possible, just thinking, if Godot can bake GI, or reflections, it might just be a small step, to create an acoustics map, or a voxel map, and use approximations between the voxel, to create, sort-of more physically based sound stuff, one might even be able to simulate a few dynamic, or moving sound-sources, in real-time, prob. enough for making almost any sound effect, well, it's an idea <3 . . .

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Well, in some games, Dead Space, also Alien : Isolation, there are these narrows rooms, corridors, filled with boxes, junk, metal, etc . . . And, to really capture that, get the right stereo sound, at some point, it might be difficult in real - time, but what about baking the information, to at least improve audio fidelity, that's all . . . .

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Been quite amazed, that one can simply bake GI, and it works so well, select a volume, boom, it works . . . Maybe it's possible to bake a voxel map, and use approximations to get better acoustics, even if one just baked a simple 2D map, for a flat-level, full of rooms, corridors, it might sound really good, if it used simple laws of acoustics, echoes, and wave - bounces, and I'm not sure how GI works, but that also seems to be about calculating bounces, or light sources, similar to an audio - burst, so it might be possible, to use GPU acceleration, to get at least better, or more accurate stereo sound, for instance, with a SSD it might be possible to stream a low-res voxel acoustics map, to get good acoustics, so on . . . .

If this enhancement will not be used often, can it be worked around with a few lines of script?

I can't do this, it's something for tech - experts, might be the ' sound ' system Godot needs, simply to get better stereo, so if one runs from a room, into a corridor, with say a speaker, it bakes if sound is more left ear, right ear, based on rotation, location, of a listener node, ideally placed sort-of where, the ears are, on kinematicbody, maybe it's possible, thanks . . . <3 <3

Is there a reason why this should be core and not an add-on in the asset library?

Well, getting HI-FI, accurate sound is a problem, one might be able to bake something amazing, just from the collisionshapes, but if one included stuff like roughness, metalness, so on, other stuff, one might be able for instance to get a more accurate simulation, of say listening to some sound, through a window, or sort-of grill, etc . . .

Is this even possible, and would it require to be stored in a voxel map, or could one use say TWO normal maps, one that stores the NORMAL, of the audio source, in left ear, and right ear, not sure . . . . <3

atirut-w commented 2 years ago

I think what you are looking for here is:

  1. Bake the information about a certain area(size, physical sound properties, etc) into something that can be used for audio processing and
  2. use the baked information to effect audios playing in that specific area.

Your solution is a little overcomplicated IMO and I think a reverb zone should be enough.

charlesmlamb commented 2 years ago

Ok, don't know audio THAT well, just would be nice if one could sort-of ' bake ' the audio info, based on surroundings, to get 100 % accurate, this is how it sounds, for a given location, maybe it's easier to just do it another way . . . :OO . .

atirut-w commented 2 years ago

If you want 100% physical accuracy then you could use the voxel stuff you proposed, sacrificing some performance, but I think using reverb zones would be good enough.

charlesmlamb commented 2 years ago

Well, was thinking maybe one could bake it for a local volume, or store the information in probes, or so . . Don't know if it's possible, but I didn't think GI probes, or even reflection probes were possible, bef. I saw them . . . Computer stuff is constantly getting better, been wondering, given the tons of improvements, in other areas, for Godot 4, is there some audio upgrade, that's also possible . . .

For instance, this is from console, PS5, they this crazy new stuff, with 3D audio, and head-sets that can use a scan, of inner structure, of your ear, to well ' fake ' 3D audio, and 100 audio sources, at same time . . . That's obviously NOT possible, in Godot, prob. requires specific hardware, not sure, also a special headset . . .

I asked for Dolby support earlier, and it was said, NO, bec. that is proprietary . . . Was just thinking, COULD there be some new tech, for the audio stuff, in Godot 4, had the idea, of maybe baking an audio probe, or some way, of getting more or, perhaps 100 % accurate sound, at least in small areas, to begin with, my idea was, if it's possible, to somehow store the correct audio data, in some format, and instead of calculating it live, at run-time, pre-bake acoustics / echo / reverb data, for some audio sources, perhaps just 1, or 2, so if there was a screaming siren, in a room, and one ran past it, in a corridor, the sound sort of increased, as one moved closer, to the door, anyway, been hoping to get some improved audio features, this was my suggestion, to get more accurate, physically based sound, based on acoustics, reflections, and room structures, to get that spot - on, ' real ' vibe, in a game with corridors, rooms, explosions, and sirens, so on . . . Godot 4 is getting so much nice stuff, haven't heard any improvements, to audio, was hoping this, or just something, might be possible <3 . .

Just hoping to get SOME feature, that might be 100 % physically accurate, if that's not possible, real - time, then somehow to bake an approximation, that could be used, or so . . . Also, it'd have to say, what audio sources to bake, unless it's possible to just have everything, but also for instance, to know if a room has each, or not, so if a character is walking, and step into a room with reverb, acoustics, the foot-steps change, based on the acoustics . . .

Was thinking, one could bake it from either collisionshapes, of the level, or use the actual geometry, or have some simplified audio data, for each shape, or use rougness, metallic, to approximate acoustics, or, for each objects, to have an average roughness, average metalness, and, use that . . . I think having a physically based, even if it's baked, feature to get 100 %, or close, acoustic data, would make many games more immersive, at least for more realistic games, it'll make sense, and it'll just ' work ', or so <3

atirut-w commented 2 years ago

Was thinking, one could bake it from either collisionshapes, of the level, or use the actual geometry, or have some simplified audio data, for each shape, or use rougness, metallic, to approximate acoustics, or, for each objects, to have an average roughness, average metalness, and, use that . . . I think having a physically based, even if it's baked, feature to get 100 %, or close, acoustic data, would make many games more immersive, at least for more realistic games, it'll make sense, and it'll just ' work ', or so <3

That's one hell of an overcomplicated solution. IMO, it's too specific to be implemented in Godot.

Here's my take: reverb zones that estimate the audiophysical properties of the area using it's extents and other settings. This ought to be enough for most games.

charlesmlamb commented 2 years ago

Ok, that might be what I was ACTUALLY thinking, thanks . . .

Be so nice, to make some say area, and audio just well works, same as RTX will, at least theoretically be, make some area, click on, the light just WORKS, accurately . . . I'm thinking, in the audio world, that is next level, maybe it's possible right now, that was the idea, bake an area, but your suggestion, might give same result, and be much faster, I don't know, just asking for a close to, click a button, and you have 100 % accurate audio, like RTX is, for light, maybe it's possible, with some good code, or new algorhithms, anyway, that's sort-of what I'm looking for, maybe, don't know audio at scientific level, the above will do the trick, 100 % . . . Simple question is, can audio in Godot 4.0 be improved, to allow for more physically accurate sound - sims <3

My suggestion, was to somehow bake it, like a GI probe bakes a TON, of light information, accurately . . . It's not possible at run - time, but one can bake it, don't know audio well enough, to know what is really needed, to get ' PBR ' sound / acoustics, thanks . . .

Having something like reverb zones, echo or, 'acoustics' zones might be nice, esp. if one could set bounds, even if was based, on collisionshapes, it'd be nice . . . :OO

charlesmlamb commented 2 years ago

Here's sort of, where I'm thinking well, some sort-of better audio system, might be better . . .

https://www.youtube.com/watch?v=0HPeNPOOamw

2 minutes in that clip, a bucket is dropped down a deep well, it sort-of echoes, in a way, I was thinking, is there a way to get something like, perhaps not real - time, but baked then, I think that's perhaps next level, in PBS ( physically based sound / audio ) . . .

It's from the Hobbit, maybe some have seen it, it'd be cool if one could drop a collisionshape, into a well, where each collisionshape has some audio parameters, maybe a new node, ' AudioCollider ', or ' AcousticCollider ', this is prob. so advanced, it's very difficult, after seeing the GI probe, it calculates an amazing amount of data, then stores it in some simple textures, on UV2, I think lightmap textures, is there any way to sort-of bake, or approximate that, sort-of something similar, to RTX, but for audio . . . Maybe it's simply not possible, or one has to use some big approximation, I guess that's something that currently has not been made, atm. we have this stuff, for light calculations . . . I'm just asking, if it's possible, might be rather difficult, but Godot has some amazing stuff, GI probes, was thinking, make same thing, for audio . . . .

Just asking, if you could make some improvements, to the audio - part, of the engine <3 . . .

Calinou commented 1 year ago

Closing in favor of https://github.com/godotengine/godot-proposals/issues/1721, https://github.com/godotengine/godot-proposals/issues/4377 and https://github.com/godotengine/godot-proposals/issues/4435.