microsoft / ProjectAcoustics

Microsoft Project Acoustics
https://aka.ms/acoustics
Creative Commons Attribution 4.0 International
137 stars 21 forks source link

Unity-Acoustics dont get applied? #111

Open arazrm opened 2 years ago

arazrm commented 2 years ago

Hello. I have two scenes that I am trying to bake acoustics to, you can see the pictures of it down here:

image image

image

as you can see scene is ready to be baked. I choose local bake and select a folder for it and I run the runlocalbake.bat by double clicking on it. after waiting for several minutes the terminal window closes automatically and Acoustics_[scenename].ace gets saved in the same local bake folder -not the probes (AcousticsData) folder. I add the .bytes to the end of it and drop it into MicrosoftAcoustics prefabs Ace file but instead of hearing an expected result, I hear the source from everywhere equally (not even with default unity spatialize effect which is active and i can hear the effect before bake.) I am using version 3 of the plugin and the docker image is also version 3.0. my rig is i7-6700k CPU 16GB ddr4 2400mhz RAM

thanks in advance.

NoelCross commented 2 years ago

@arazrm Thanks for trying out the Project Acoustics release for Unity. There's a couple of things to try to narrow down why you are not getting the desired experience.

  1. When you play in editor and you select the "Scene" view rather than the default "Game" view and you have the AcousticsManager gizmo enabled, you should see debug data that gives information about the acoustics parameters being queried from the ACE file for a given listener and source combination. This should give you some insight into whether or not the ACE file is being queried correctly.

    image
  2. Another possibility is that the audio DSP is not properly configured. Please ensure that both the Project Acoustics spatializer plugin and the Project Acoustics mixer plugin are properly configured. Also, check that the sound source is being outputted to the Mixer bus where the PA mixer plugin is installed, and the Spatial Blend value is set to 3D. https://docs.microsoft.com/en-us/gaming/acoustics/unity-integration#set-up-audio-dsp

arazrm commented 2 years ago

Hi NoelCross thank you for your Reply & Sorry for late Answering. After many attempts on fixing the issue I decided to make a simulation on a simpler Project made out of Cubes only and Realized that the issue is the Size of the Scene. I Scaled the Scene to much bigger Size (it was 15 probes before now it is 140 probes ) and the problem was fixed. tho I am having another issue with one of the Scenes and because of this I am going to bake the scene again over night to see if problem gets fixed. let me explain it:

image

the Source that I have circled with the red line is the Unmuted and currently playing source. but its not having an accurate spatialization and acoustics effects and also that yellow line Does not seem right? (i tried reaching end of that yellow line but it goes forever) Can the issue caused by the size of the scene again? (maybe its too big this time?) are 230 probes too much for calculation? can it cause this bug?

MikeChemi commented 2 years ago

The size of the scene has no effect on the issues you're seeing. Any relation you've discovered is just coincidence.

The problem here is your acoustic queries are all failing. The indicator is the values for the Dry / Reverb parameters being displayed. That-3.4E38 number is our failure code. My first guess is that the sources may be placed inside geometry. Can you show where the sources lines up with the voxels?

arazrm commented 2 years ago

thank you for the information MikeChemi I am going to attach pictures of my Audio Sources:

this is the source which is currently active and unmuted: image

and pictures below are the muted sources: Source1: image image

source2: image image

Source3: image image

Source4: image image

# # I want to add that this bug happens when player (listener) is at some specific locations of the level, and it works fine when its at other points (listener also never goes inside acoustics geometry):

image image image

image image image image

# # in the next photos, I moved muted sources completely away from acoustics geometry towards inside and their minimum distance is not even colliding with the acoustics geometry now but we still have the error:

image image image

MikeChemi commented 2 years ago

Thanks for the pictures, this is helpful. You've proven that the sound source locations are fine. If the sources were the problem, they would always fail. Since they succeed sometimes but fail other times depending on where the listener is, we can focus on the listener.

Is the Audio Listener component directly attached to your main camera object, or is it applied on some child object? It would be great to rule out any extra transform issues.

Would you mind posting some 3D views of where the listener is in the scene when the queries are failing? I'm curious about the exact positions of the listener in relation to the probe points. When it is failing, how far do you have to move (in any direction) before queries start succeeding again?

arazrm commented 2 years ago

Thank you MikeChemi. I have increased the size of scene a little bit more & removed speaker meshes from acoustic geometry & calculated again. it fixed the bug in some places but we still have that bug at some other locations. also my listener is directly attached to camera and my camera is child to an empty with Character controller. I am going to attach the pictures of some of these points below and the first picture for each point is orthographic top view of the point and the second one is a 3d view of the point and camera:

First point: Screenshot 2022-08-12 122326 Screenshot 2022-08-12 122254

Second point: Screenshot 2022-08-12 122404 Screenshot 2022-08-12 122427

Third point: image Screenshot 2022-08-12 122557

# # There are many other locations that contains this bug I can provide more pictures if needed.

NoelCross commented 2 years ago

@arazrm It appears that you have reached the limits of our ability to debug this issue remotely. Is there any chance that you could share this project with the PA team so that we can debug this in more detail?

If you can share, please send email to noelc@microsoft.com with a link to the cloud share where the project is located. We'll get this project loaded on our end and attempt to figure out why you are seeing this unexpected behavior and get back to you as soon as possible.

Thanks, Noel

arazrm commented 2 years ago

Hi @NoelCross I will Send the Project and description to your email as soon as possible