forked from libretro/RetroArch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04b26fe
commit bada13a
Showing
9 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/* credits to: TheTimJames | ||
https://www.shadertoy.com/view/Md2GRw | ||
*/ | ||
|
||
#include "shaders_common.h" | ||
|
||
static const char* stock_fragment_xmb_snowflake = GLSL( | ||
uniform float time; | ||
uniform float atime; | ||
uniform vec2 OutputSize; | ||
vec2 uv; | ||
|
||
float rand(vec2 co) | ||
{ | ||
return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453); | ||
} | ||
|
||
float snow(vec3 pos, vec2 uv, float o) | ||
{ | ||
vec2 d = (pos.xy - uv); | ||
float a = atan(d.y,d.x)+sin(atime*1.+o)*10.; | ||
|
||
float dist = d.x*d.x + d.y*d.y; | ||
|
||
if(dist < pos.z/400.){ | ||
float col = 0.0; | ||
if(sin(a*8.) < 0.0){col=1.0;} | ||
if(dist<pos.z/800.0){col+=1.0;} | ||
return col*pos.z; | ||
} | ||
|
||
return 0.0; | ||
} | ||
|
||
float col(vec2 c) | ||
{ | ||
float color = 0.0; | ||
for (int i = 1; i < 15; i++) | ||
{ | ||
float o = rand(float(i) / 3.) * 15 * 2.0; | ||
float z = rand(float(i) + 13.0); | ||
float x = 1.8 - (3.6) * (rand(floor((time*((z+1.0)/2.0)+o)/2.0)) + sin(time*o/1000.0)/10.0); | ||
float y = 1.0-mod((time*((z+1.0)/2.0))+o, 2.0); | ||
|
||
color += snow(vec3(x,y,z),c,o); | ||
} | ||
|
||
|
||
|
||
return color; | ||
} | ||
|
||
void main(void) | ||
{ | ||
uv = gl_FragCoord.xy / OutputSize.xy; | ||
uv = uv * 2.0 - 1.0; | ||
vec2 p = uv; | ||
p.x *= OutputSize.x / OutputSize.y; | ||
|
||
atime = (time + 1)/4.0; | ||
|
||
gl_FragColor = vec4(col(p)); | ||
} | ||
|
||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters