CVR Audio Material Parser
Feeds spectrum or output data from an AudioSource into shader material properties. Useful for building objects that react to music or video player audio.
Properties
Section titled “Properties”Use Separate Audio Sources
Section titled “Use Separate Audio Sources”When checked, uses the two Audio Sources defined in Source Audio L and Source Audio R. Otherwise the single Source Audio is used.
Source Audio
Section titled “Source Audio”Audio Source the data comes from.
Source Audio L
Section titled “Source Audio L”Left Audio Source channel.
Source Audio R
Section titled “Source Audio R”Right Audio Source channel.
Audio Data Type
Section titled “Audio Data Type”Method used to pull data from the source. Output format depends on the method chosen.
- Output Data Uses
GetOutputData. - Spectrum Data Uses
GetSpectrumData.
Processing Material
Section titled “Processing Material”Material used to process the data. The shader receives the values via the names defined below.
Fragment Size
Section titled “Fragment Size”Size of the array sent to the shader.
Fragment Parameter Name R/L 1-4
Section titled “Fragment Parameter Name R/L 1-4”Names of the individual float-array parameters exposed to the shader.
Volume Parameter Name
Section titled “Volume Parameter Name”Current volume of the audio source (float).
Distance Parameter Name
Section titled “Distance Parameter Name”Distance from the player to the audio source (float).
Pitch Parameter Name
Section titled “Pitch Parameter Name”Pitch of the audio source (float).
Doppler Parameter Name
Section titled “Doppler Parameter Name”Doppler value of the audio source (float).
Spatial Parameter Name
Section titled “Spatial Parameter Name”Spatial blend of the audio source (float).
The component streams fragmentSize samples per buffer into each of the four L/R shader parameters, giving the shader fragmentSize * 4 consecutive samples per channel. Any parameter name left blank is skipped.
Distance is measured from the active player camera (the character controller’s rotation pivot) to the audio source transform.
Source
Section titled “Source”CVR-GameFiles/ABI.CCK.Components/CVRAudioMaterialParser.cs