Compare commits

..

17 Commits

Author SHA1 Message Date
Dan Balasescu
f6d3057dcc Merge pull request #66 from nyquillerium/highp-flashlight
Fix loss of precision for flashlight smoothing distance calculations
2019-07-31 13:22:35 +09:00
David Zhao
fb90b1a668 specify for method as well 2019-07-25 11:24:15 +09:00
David Zhao
6448d6051f Remove compiler definitions 2019-07-24 17:20:14 +09:00
David Zhao
8bc6f5a986 specify precision for rectangular flashlight too 2019-07-23 18:58:49 +09:00
David Zhao
c12541bb28 remove unnecessary pre-processor directives 2019-07-23 15:44:15 +09:00
David Zhao
96286f8c6f Explicitly define precision for all variables, fall back to medium precision 2019-07-22 20:02:18 +09:00
David Zhao
d58ad077c8 Add comment 2019-07-19 15:22:38 +09:00
David Zhao
751ded4dd9 define highp and lowp for non GL_ES platforms 2019-07-19 15:20:26 +09:00
David Zhao
7675deb816 Update precisions 2019-07-19 14:58:33 +09:00
David Zhao
9ba9ae77b9 Only mark diff parameter as high precision 2019-07-18 21:02:47 +09:00
David Zhao
f36e765845 Change flashlight float precision to highp 2019-07-18 17:36:03 +09:00
Dean Herbert
3a3d0c1984 Remove grade textures (#65)
Remove grade textures
2019-07-03 13:49:28 +09:00
iiSaLMaN
b7f01508a0 Remove unused textures 2019-07-03 04:32:11 +03:00
Dean Herbert
3ade4a856c Add new menu backgrounds (#64)
Add new menu backgrounds
2019-07-02 17:55:41 +09:00
Dean Herbert
d79c12f663 Trim audio samples that were excessively long (#63)
Trim audio samples that were excessively long
2019-07-02 17:55:07 +09:00
Dean Herbert
f5a3de1e89 Add new menu backgrounds 2019-07-02 17:52:16 +09:00
Dean Herbert
34448428fe Trim audio samples that were excessively long 2019-07-02 16:19:26 +09:00
40 changed files with 14 additions and 17 deletions

View File

@@ -1,9 +1,10 @@
#include "sh_Flashlight.h"
vec4 getColourAt(vec2 diff, vec2 size, vec4 originalColour)
// highp precision is necessary for vertex positions to prevent catastrophic failure on GL_ES platforms
lowp vec4 getColourAt(highp vec2 diff, highp vec2 size, lowp vec4 originalColour)
{
float dist = length(diff);
float flashlightRadius = length(size);
highp float dist = length(diff);
highp float flashlightRadius = length(size);
return originalColour * vec4(1.0, 1.0, 1.0, smoothstep(flashlightRadius, flashlightRadius * smoothness, dist));
}

View File

@@ -1,20 +1,16 @@
#ifdef GL_ES
precision mediump float;
#endif
varying highp vec2 v_Position;
varying lowp vec4 v_Colour;
varying vec2 v_Position;
varying vec4 v_Colour;
uniform highp vec2 flashlightPos;
uniform highp vec2 flashlightSize;
uniform vec2 flashlightPos;
uniform vec2 flashlightSize;
uniform float flashlightDim;
uniform lowp float flashlightDim;
const float smoothness = 1.1;
vec4 getColourAt(vec2, vec2, vec4);
lowp vec4 getColourAt(vec2, vec2, vec4);
void main(void)
{
gl_FragColor = mix(getColourAt(flashlightPos - v_Position, flashlightSize, v_Colour), vec4(0.0, 0.0, 0.0, 1.0), flashlightDim);
}
}

View File

@@ -1,10 +1,10 @@
#include "sh_Flashlight.h"
vec4 getColourAt(vec2 diff, vec2 size, vec4 originalColour)
lowp vec4 getColourAt(highp vec2 diff, highp vec2 size, lowp vec4 originalColour)
{
diff = abs(diff);
float alpha = length(smoothstep(size, size * smoothness, diff));
lowp float alpha = length(smoothstep(size, size * smoothness, diff));
return originalColour * vec4(1.0, 1.0, 1.0, alpha);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

BIN
osu.Game.Resources/Textures/Menu/menu-background-1.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 600 KiB

After

Width:  |  Height:  |  Size: 717 KiB

BIN
osu.Game.Resources/Textures/Menu/menu-background-2.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 644 KiB

After

Width:  |  Height:  |  Size: 724 KiB

BIN
osu.Game.Resources/Textures/Menu/menu-background-3.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 KiB

After

Width:  |  Height:  |  Size: 837 KiB

BIN
osu.Game.Resources/Textures/Menu/menu-background-4.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 487 KiB

After

Width:  |  Height:  |  Size: 739 KiB

BIN
osu.Game.Resources/Textures/Menu/menu-background-5.jpg Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 586 KiB

After

Width:  |  Height:  |  Size: 745 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 832 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 KiB