feat(all): 迁移扩展相关功能
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
precision highp float;
|
||||
precision highp int;
|
||||
|
||||
#include <utils>
|
||||
#include <cylinder_utils>
|
||||
|
||||
in vec3 oldPos;
|
||||
in vec3 newPos;
|
||||
in vec3 ray;
|
||||
|
||||
out vec4 fragColor;
|
||||
|
||||
void main() {
|
||||
float oldArea = length(dFdx(oldPos)) * length(dFdy(oldPos));
|
||||
float newArea = length(dFdx(newPos)) * length(dFdy(newPos));
|
||||
fragColor = vec4(oldArea / newArea * 0.2, 1.0, 0.0, 0.0);
|
||||
|
||||
vec3 refractedLight = refract(-light, vec3(0.0, 1.0, 0.0), IOR_AIR / IOR_WATER);
|
||||
|
||||
vec2 t = intersectCylinder(newPos, -refractedLight, poolRadius, -poolHeight, poolHeight * 2.0);
|
||||
fragColor.r *= 1.0 / (1.0 + exp(-200.0 / (1.0 + 10.0 * (t.y - t.x)) * (newPos.y - refractedLight.y * t.y - poolHeight * 2.0 / 12.0)));
|
||||
}
|
||||
Reference in New Issue
Block a user