Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Doppler tracking in Camera3D by default #52770

Closed

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Sep 17, 2021

This makes setting up AudioStreamPlayer3D with Doppler effect easier.

  • Enable doppler preview in the 3D editor viewport by default.
  • Move AudioStreamPlayer3D's Doppler Tracking property outside a group since the group only had 1 property, which resulted in unnecessary folding in the inspector.
  • Put the AudioStreamPlayer3D Playing and Autoplay properties higher up in the inspector since these are likely to be modified often.

@Calinou Calinou requested review from a team as code owners September 17, 2021 07:48
@Calinou Calinou added this to the 4.0 milestone Sep 17, 2021
@Calinou Calinou force-pushed the camera3d-default-enable-doppler branch from b564f9f to 1ace8c6 Compare September 17, 2021 07:49
@Calinou Calinou force-pushed the camera3d-default-enable-doppler branch 2 times, most recently from f284fbb to 8983b3d Compare September 17, 2021 08:24
@akien-mga akien-mga requested a review from a team September 17, 2021 10:55
@reduz
Copy link
Member

reduz commented Sep 17, 2021

As it is my usual comment on this, enabling it has a base performance cost. Not very expensive though , but if for some reason you instantiate a lot of cameras and dont use them, it can cost significantly.

I generally prefer worse defaults, but a more predictable performance impact.

@Calinou
Copy link
Member Author

Calinou commented Sep 17, 2021

As it is my usual comment on this, enabling it has a base performance cost. Not very expensive though , but if for some reason you instantiate a lot of cameras and dont use them, it can cost significantly.

Could we disable doppler tracking for non-current cameras? The current code doesn't seem to take the current state into account.

@ellenhp
Copy link
Contributor

ellenhp commented Sep 17, 2021

Could we disable doppler tracking for non-current cameras? The current code doesn't seem to take the current state into account.

I don't think this makes sense either. I'd want the doppler tracking information to be ready to go in a camera I'm switching to before I switch to it. The audio code is entirely willing to switch cameras/listeners without waiting a frame first.

Instantiating a lot of cameras is a weird case (plus, an advanced user can simply disable doppler tracking manually on inactive cameras), and I'd be shocked if this is actually a measurable performance issue.

Additionally, I don't think it makes sense to unconditionally enable doppler on current cameras, because a user might wish to have a camera fly over a scene at high speed without having doppler effects. See: #38143 We don't simulate sonic booms, so it will sound weird at extremely high speed.

My preference is to accept this PR.

This makes setting up AudioStreamPlayer3D with Doppler effect easier.

- Enable doppler preview in the 3D editor viewport by default.
- Move AudioStreamPlayer3D's Doppler Tracking property outside
  a group since the group only had 1 property, which resulted in
  unnecessary folding in the inspector.
- Put the AudioStreamPlayer3D Playing and Autoplay properties
  higher up in the inspector since these are likely to be modified
  often.
@Calinou Calinou force-pushed the camera3d-default-enable-doppler branch from 8983b3d to 35c62e0 Compare June 17, 2022 01:39
@Calinou Calinou closed this Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants