Skip to content
This repository has been archived by the owner on Dec 19, 2022. It is now read-only.

Custom SurfaceMaterials #66

Open
therusln opened this issue Apr 2, 2020 · 3 comments
Open

Custom SurfaceMaterials #66

therusln opened this issue Apr 2, 2020 · 3 comments

Comments

@therusln
Copy link

therusln commented Apr 2, 2020

How can I access SurfaceMaterials to create my own and add properties? I'm aware that the enum with materials are on RoomManager, but couldn't find anything about their properties.

@PatrickFSLin
Copy link

I have the same issue

@amilo
Copy link

amilo commented Oct 12, 2020

I also would like to know if there is a way to change them from Unity (maybe an overriding/writing script ?)
It would be nice if rather than recompiling the source code we could add our own to the list.
Maybe it can be helpful for you to know that their definition is here:
https://github.com/resonance-audio/resonance-audio/blob/master/platforms/common/room_effects_utils.cc

@jkammerl
Copy link
Member

Correct, the reflection coefficients for the different materials are defined here:
https://github.com/resonance-audio/resonance-audio/blob/2fbf9c3b77de42aef5570b08243965226b48fdf4/platforms/common/room_effects_utils.cc#L34

See also comment:
// Air absorption coefficients at 20 degrees Celsius and 50% relative humidity, according to:
http://www.music.mcgill.ca/~gary/courses/papers/Moorer-Reverb-CMJ-1979.pdf

The Resonance Audio API can be configured with an individual set of RT60s via SetRoomProperties, see here:
https://github.com/resonance-audio/resonance-audio/blob/f71b9d0ee508af724a46c87e894500eba4e23913/platforms/unity/UnityIntegration/Assets/ResonanceAudio/Scripts/ResonanceAudio.cs#L105

void SetRoomProperties(RoomProperties* room_properties, float* rt60s)
If room_properties==null, then the second argument, the set of RT60s is used to configure the reverb. You need to provide 9 RT60's for the reverberation tail at the following octave band centres: 31.25 62.5 125 250 500 1000 2000 4000 8000 Hz.

I hope this helps!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants