2020-10-09 01:06:07 +07:00
|
|
|
#define HIGHP
|
2020-10-09 06:11:20 +07:00
|
|
|
#define NSCALE 2700.0
|
2020-10-24 00:31:55 +07:00
|
|
|
#define CAMSCALE (NSCALE*10.0)
|
2020-10-09 01:06:07 +07:00
|
|
|
|
|
|
|
uniform sampler2D u_texture;
|
|
|
|
uniform sampler2D u_stars;
|
|
|
|
|
|
|
|
uniform vec2 u_campos;
|
|
|
|
uniform vec2 u_ccampos;
|
|
|
|
uniform vec2 u_resolution;
|
|
|
|
uniform float u_time;
|
|
|
|
|
|
|
|
varying vec2 v_texCoords;
|
|
|
|
|
|
|
|
void main(){
|
|
|
|
vec2 c = v_texCoords.xy;
|
2020-10-09 06:11:20 +07:00
|
|
|
vec2 coords = vec2(c.x * u_resolution.x, c.y * u_resolution.y);
|
2020-10-09 01:06:07 +07:00
|
|
|
|
|
|
|
vec4 color = texture2D(u_texture, c);
|
2020-10-09 06:11:20 +07:00
|
|
|
color.rgb = texture2D(u_stars, coords/NSCALE + vec2(-0.1, -0.1) + u_ccampos / CAMSCALE).rgb;
|
2020-10-09 01:06:07 +07:00
|
|
|
|
|
|
|
gl_FragColor = color;
|
2020-10-28 02:08:53 +07:00
|
|
|
}
|