Skip to content

Commit

Permalink
Optimised Sampler windowing for small grain sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
ludzeller committed Sep 2, 2022
1 parent 5d86967 commit 0374f41
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Assets/Materials/coreMaterials/coreColorGlow.mat
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Material:
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 10
- _EmissionGain: 0.1723334
- _EmissionGain: 0.18732806
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 0
Expand All @@ -78,5 +78,5 @@ Material:
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 0.40392157}
- _EmissionColor: {r: 34.08462, g: 34.08462, b: 34.08462, a: 1}
- _TintColor: {r: 0.03446668, g: 0.08961335, b: 0.1723334, a: 0.3446668}
- _TintColor: {r: 0.03746561, g: 0.09741056, b: 0.18732806, a: 0.3746561}
m_BuildTextureStacks: []
Binary file modified Assets/SoundStageNative/arm64/Release/libSoundStageNative.so
Binary file not shown.
Binary file modified Assets/SoundStageNative/x64/Release/SoundStageNative.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion Assets/Text/Materials/3DUItext.mat
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ Material:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _DiffuseColor: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _TintColor: {r: 0.45342794, g: 0.45342794, b: 0.45342794, a: 0.9798655}
- _TintColor: {r: 0.4497704, g: 0.4497704, b: 0.4497704, a: 0.97196144}
m_BuildTextureStacks: []
6 changes: 3 additions & 3 deletions ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ PlayerSettings:
metroSplashScreenUseBackgroundColor: 1
platformCapabilities:
WindowsStoreApps:
EnterpriseAuthentication: False
CodeGeneration: False
VideosLibrary: False
HumanInterfaceDevice: False
Location: False
Expand Down Expand Up @@ -828,10 +828,10 @@ PlayerSettings:
PointOfService: False
RecordedCallsFolder: False
Contacts: False
InternetClient: False
Proximity: False
CodeGeneration: False
BackgroundMediaPlayback: False
InternetClient: False
EnterpriseAuthentication: False
metroTargetDeviceFamilies:
Desktop: False
Holographic: False
Expand Down
3 changes: 2 additions & 1 deletion SoundStageNative/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,7 @@ extern "C" {
{

float* clipdata = reinterpret_cast<float*>(clip);
float sampleBoundsCenter = (sampleBounds[0] + sampleBounds[1]) * 0.5f;

for (int i = 0; i < length; i += channels)
{
Expand Down Expand Up @@ -456,7 +457,7 @@ extern "C" {

float windowing = 1.f;
if(windowLength != 0){
if (floatingBufferCount < sampleBounds[0] + windowLength) { // 480 samples = 10ms
if (floatingBufferCount < sampleBounds[0] + windowLength && floatingBufferCount <= sampleBoundsCenter) {
windowing = _map(floatingBufferCount, sampleBounds[0], sampleBounds[0] + windowLength, 0.f, 1.f, 0.5f);
} else if (floatingBufferCount > sampleBounds[1] - windowLength) {
windowing = _map(floatingBufferCount, sampleBounds[1] - windowLength, sampleBounds[1], 1.f, 0.f, 0.5f);
Expand Down

0 comments on commit 0374f41

Please sign in to comment.