更真实的3D方块

This commit is contained in:
MrZ626
2021-02-09 16:13:19 +08:00
parent 5fea32203a
commit cab826ba34
11 changed files with 117 additions and 77 deletions

View File

@@ -1,4 +1,4 @@
extern float a;
vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
return vec4(1.,1.,1.,sign(Texel(text,pos).a)*a);
vec4 effect(vec4 color,Image tex,vec2 tex_coords,vec2 scr_coords){
return vec4(1.,1.,1.,sign(Texel(tex,tex_coords).a)*a);
}

View File

@@ -1,9 +1,9 @@
#define PI 3.1415926535897932384626
extern float w,h;
extern float t;
vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
float x=scr_pos.x/w;
float y=scr_pos.y/h;
vec4 effect(vec4 color,Image tex,vec2 tex_coords,vec2 scr_coords){
float x=scr_coords.x/w;
float y=scr_coords.y/h;
float dx,dy;
vec3 V=vec3(0.);

View File

@@ -1,6 +1,6 @@
extern float t,w;
vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
float x=scr_pos.x/w;
vec4 effect(vec4 color,Image tex,vec2 tex_coords,vec2 scr_coords){
float x=scr_coords.x/w;
return vec4(
.8-x*.6,
.3+.2*sin(t),

View File

@@ -1,6 +1,6 @@
extern float t,h;
vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
float y=scr_pos.y/h;
vec4 effect(vec4 color,Image tex,vec2 tex_coords,vec2 scr_coords){
float y=scr_coords.y/h;
return vec4(
.8-y*.6,
.2+y*.4,

View File

@@ -0,0 +1,9 @@
vec4 effect(vec4 color,Image tex,vec2 tex_coords,vec2 scr_coords){
vec4 texcolor=Texel(tex,tex_coords);
return vec4(
pow(texcolor.r+.26,.7023),
pow(texcolor.g+.26,.7023),
pow(texcolor.b+.26,.7023),
texcolor.a
);
}

View File

@@ -1,7 +1,7 @@
extern float t,w,h;
vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
float x=scr_pos.x/w;
float y=scr_pos.y/h;
vec4 effect(vec4 color,Image tex,vec2 tex_coords,vec2 scr_coords){
float x=scr_coords.x/w;
float y=scr_coords.y/h;
return vec4(
.8-y*.7+.2*sin(t/6.26),
.2+y*.5+.15*sin(t/4.),

View File

@@ -1,7 +1,7 @@
extern float t,w,h;
vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
float x=scr_pos.x/w;
float y=scr_pos.y/h;
vec4 effect(vec4 color,Image tex,vec2 tex_coords,vec2 scr_coords){
float x=scr_coords.x/w;
float y=scr_coords.y/h;
return vec4(
.8-y*.8-.1*sin(t/6.26),
.4+.1*sin(t/4.)*(y+2.)/(y+5.),

View File

@@ -1,8 +1,8 @@
extern float w,h;
extern float level;
vec4 effect(vec4 color,Image text,vec2 pos,vec2 scr_pos){
float dx=abs(scr_pos.x/w-0.5);
float dy=abs(scr_pos.y/h-0.5);
vec4 effect(vec4 color,Image tex,vec2 tex_coords,vec2 scr_coords){
float dx=abs(scr_coords.x/w-0.5);
float dy=abs(scr_coords.y/h-0.5);
float a=(max(dx*2.6,dy*1.8)-.626)*level;
return vec4(1.,0.,0.,a);
}