diff options
author | chai <chaifix@163.com> | 2020-07-28 00:30:33 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-07-28 00:30:33 +0800 |
commit | 5dfdb6b58b2dc7bbd3348004c1fcd17e23fea48b (patch) | |
tree | a03f1a01382595ed50cc4780a728b22013f6d5a0 /src/shaders/common/core.c | |
parent | 690f20cdbe8dad3fce7a547934a5a8322303342d (diff) |
Diffstat (limited to 'src/shaders/common/core.c')
-rw-r--r-- | src/shaders/common/core.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/shaders/common/core.c b/src/shaders/common/core.c index ffaa649..91bb6c0 100644 --- a/src/shaders/common/core.c +++ b/src/shaders/common/core.c @@ -4,7 +4,7 @@ Vec4 _proj_params; Vec2 _time; Vec4 _screen_params; -Vec3 unpacknormal(Color32 c32) { +Vec3 decode_normal(Color32 c32) { Vec3 normal = { c32.r * 2 - 1, c32.g * 2 - 1, @@ -15,16 +15,16 @@ Vec3 unpacknormal(Color32 c32) { Mat4 mat4(Vec4* c1, Vec4* c2, Vec4* c3, Vec4* c4); -Vec2 texsize(Texture* texture) { +Vec2 texture_size(Texture* texture) { Vec2 size = {texture->width, texture->height}; return size; } -float linear01Depth(float depth) { +float linear_01_depth(float depth) { float n = _proj_params.x, f = _proj_params.y; return n / ((n-f)*depth + f); } -float linearEyeDepth(float depth) { - return _proj_params.y * linear01Depth(depth); +float linear_eye_depth(float depth) { + return _proj_params.y * linear_01_depth(depth); }
\ No newline at end of file |