-
Notifications
You must be signed in to change notification settings - Fork 40
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
Add AudioReactiveBlendshapes.cs and related files #320
Conversation
A small utility script based off `AudioReactiveLight.cs` for blendshapes
if (audioLink.AudioDataIsAvailable()) | ||
{ | ||
// Convert to grayscale | ||
float amplitude = Vector3.Dot(audioLink.GetDataAtPixel(delay, band), new Vector3(0.299f, 0.587f, 0.114f)) * 100f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm this grayscale conversion looks sus to me. In the 4band section, each channel means a different thing (they are different levels of filtering, not chroma values). You should probably just select 1 single channel, and maybe put the channel select on a dropdown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set it to access the pixel's red value for now,
I like the idea of having an option to select which channel to read from a pixel, though that may be better as a enum in a different file
Thanks looks nice - check my comment |
|
||
public class AudioReactiveBlendshapes : UdonSharpBehaviour | ||
#else | ||
public class AudioReactiveBlendshapes : MonoBehaviour |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use [RequireComponent(typeof(SkinnedMeshRenderer))] ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SkinnedMeshRenderer is now required
Require SkinnedMeshRenderer, remove unused _dataIndex, skip Vector.Dot and instead access pixel's red channel
A small utility script based off
AudioReactiveLight.cs
for blendshapes, allowing a user to quickly drive blendshapes by specifying their index in an array.