Simplify vertex snow shaders
This commit is contained in:
parent
1e10abd7f2
commit
2be4ca1755
|
@ -3,23 +3,6 @@
|
||||||
static const char *stock_vertex_xmb_snow_legacy = GLSL(
|
static const char *stock_vertex_xmb_snow_legacy = GLSL(
|
||||||
attribute vec3 VertexCoord;
|
attribute vec3 VertexCoord;
|
||||||
uniform float time;
|
uniform float time;
|
||||||
float iqhash( float n )
|
|
||||||
{
|
|
||||||
return fract(sin(n)*43758.5453);
|
|
||||||
}
|
|
||||||
|
|
||||||
float noise( vec3 x )
|
|
||||||
{
|
|
||||||
vec3 p = floor(x);
|
|
||||||
vec3 f = fract(x);
|
|
||||||
f = f*f*(3.0-2.0*f);
|
|
||||||
float n = p.x + p.y*57.0 + 113.0*p.z;
|
|
||||||
|
|
||||||
return mix(mix(mix( iqhash(n+0.0 ), iqhash(n+1.0 ),f.x),
|
|
||||||
mix( iqhash(n+57.0 ), iqhash(n+58.0 ),f.x),f.y),
|
|
||||||
mix(mix( iqhash(n+113.0), iqhash(n+114.0),f.x),
|
|
||||||
mix( iqhash(n+170.0), iqhash(n+171.0),f.x),f.y),f.z);
|
|
||||||
}
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,23 +4,6 @@ static const char *stock_vertex_xmb_snow = GLSL(
|
||||||
in vec3 VertexCoord;
|
in vec3 VertexCoord;
|
||||||
uniform float time;
|
uniform float time;
|
||||||
|
|
||||||
float iqhash( float n )
|
|
||||||
{
|
|
||||||
return fract(sin(n)*43758.5453);
|
|
||||||
}
|
|
||||||
|
|
||||||
float noise( vec3 x )
|
|
||||||
{
|
|
||||||
vec3 p = floor(x);
|
|
||||||
vec3 f = fract(x);
|
|
||||||
f = f*f*(3.0-2.0*f);
|
|
||||||
float n = p.x + p.y*57.0 + 113.0*p.z;
|
|
||||||
return mix(mix(mix( iqhash(n+0.0 ), iqhash(n+1.0 ),f.x),
|
|
||||||
mix( iqhash(n+57.0 ), iqhash(n+58.0 ),f.x),f.y),
|
|
||||||
mix(mix( iqhash(n+113.0), iqhash(n+114.0),f.x),
|
|
||||||
mix( iqhash(n+170.0), iqhash(n+171.0),f.x),f.y),f.z);
|
|
||||||
}
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec3 v = vec3(VertexCoord.x, 0.0, VertexCoord.y);
|
vec3 v = vec3(VertexCoord.x, 0.0, VertexCoord.y);
|
||||||
|
|
Loading…
Reference in New Issue