Transition to Framebuffer#blit
This commit is contained in:
@@ -3,15 +3,12 @@ precision mediump float;
|
||||
precision mediump int;
|
||||
#endif
|
||||
|
||||
#define steprad 0.13
|
||||
|
||||
uniform sampler2D u_texture;
|
||||
uniform vec4 u_ambient;
|
||||
|
||||
varying vec4 v_color;
|
||||
varying vec2 v_texCoord;
|
||||
|
||||
void main(){
|
||||
vec4 color = texture2D(u_texture, v_texCoord.xy);
|
||||
vec4 color = texture2D(u_texture, v_texCoord);
|
||||
gl_FragColor = clamp(vec4(mix(u_ambient.rgb, color.rgb, color.a), u_ambient.a - color.a), 0.0, 1.0);
|
||||
}
|
||||
|
||||
9
core/assets/shaders/screenspace.vert
Normal file
9
core/assets/shaders/screenspace.vert
Normal file
@@ -0,0 +1,9 @@
|
||||
attribute vec4 a_position;
|
||||
attribute vec2 a_texCoord0;
|
||||
|
||||
varying vec2 v_texCoord;
|
||||
|
||||
void main(){
|
||||
v_texCoord = a_texCoord0;
|
||||
gl_Position = a_position;
|
||||
}
|
||||
@@ -14,8 +14,8 @@ uniform vec2 u_texsize;
|
||||
uniform float u_time;
|
||||
uniform float u_dp;
|
||||
uniform vec2 u_offset;
|
||||
uniform vec4 u_shieldcolor;
|
||||
|
||||
varying vec4 v_color;
|
||||
varying vec2 v_texCoord;
|
||||
|
||||
void main(){
|
||||
@@ -32,7 +32,7 @@ void main(){
|
||||
(texture2D(u_texture, T + vec2(0, step) * v).a > 0.0 || texture2D(u_texture, T + vec2(0, -step) * v).a > 0.0 ||
|
||||
texture2D(u_texture, T + vec2(step, 0) * v).a > 0.0 || texture2D(u_texture, T + vec2(-step, 0) * v).a > 0.0)){
|
||||
|
||||
gl_FragColor = mix(v_color, vec4(1.0), si);
|
||||
gl_FragColor = mix(u_shieldcolor, vec4(1.0), si);
|
||||
}else{
|
||||
|
||||
if(color.a > 0.0){
|
||||
|
||||
@@ -15,7 +15,6 @@ uniform vec2 u_campos;
|
||||
uniform vec2 u_resolution;
|
||||
uniform float u_time;
|
||||
|
||||
varying vec4 v_color;
|
||||
varying vec2 v_texCoord;
|
||||
|
||||
void main(){
|
||||
|
||||
@@ -12,7 +12,6 @@ uniform vec2 u_campos;
|
||||
uniform vec2 u_resolution;
|
||||
uniform float u_time;
|
||||
|
||||
varying vec4 v_color;
|
||||
varying vec2 v_texCoord;
|
||||
|
||||
void main(){
|
||||
|
||||
@@ -9,7 +9,6 @@ uniform vec2 u_campos;
|
||||
uniform vec2 u_resolution;
|
||||
uniform float u_time;
|
||||
|
||||
varying vec4 v_color;
|
||||
varying vec2 v_texCoord;
|
||||
|
||||
const float mscl = 40.0;
|
||||
|
||||
Reference in New Issue
Block a user