summaryrefslogtreecommitdiff
path: root/src/shaders/pbr.c
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-07-11 00:29:49 +0800
committerchai <chaifix@163.com>2020-07-11 00:29:49 +0800
commite849a07762a2feb3f124a08d50adeed52f085d5b (patch)
tree69207f80cf3372c6d5801d006966888f219e2a19 /src/shaders/pbr.c
parent44e6647ab365a9261c904be839e356c06a545907 (diff)
*加internal前缀
Diffstat (limited to 'src/shaders/pbr.c')
-rw-r--r--src/shaders/pbr.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/shaders/pbr.c b/src/shaders/pbr.c
index b6238f1..89556af 100644
--- a/src/shaders/pbr.c
+++ b/src/shaders/pbr.c
@@ -28,9 +28,9 @@ static void vert(UniformCollection* uniforms, VertexShaderIn* in, Vec4* clipcoor
in->vertex->normal.z,
1
};
- Vec4 worldnormal; mat4_mulvec4(_object2world, &normal, &worldnormal);
- vec3_normalize(_light, _light);
- //*rough = 1 - vec3_dot(&worldnormal, light);
+ Vec4 worldnormal; internal_mat4_mulvec4(_object2world, &normal, &worldnormal);
+ internal_vec3_normalize(_light, _light);
+ //*rough = 1 - internal_vec3_dot(&worldnormal, light);
//*vnormal = in->vertex->normal;
*_texcoord = in->vertex->texcoord;
_clip_pos->x = clipcoord->z;
@@ -38,24 +38,24 @@ static void vert(UniformCollection* uniforms, VertexShaderIn* in, Vec4* clipcoor
}
static bool frag(UniformCollection* uniforms, FragmentShaderIn* in, Color32* color) {
- //vec3_normalize(light, light);
- //vec3_normalize(vnormal, vnormal);
+ //internal_vec3_normalize(light, light);
+ //internal_vec3_normalize(vnormal, vnormal);
//float roughness = *rough;
//(*color).r = 1;
//(*color).g = 1;
//(*color).b = 1;
//(*color).a = 1;
//return 1;
- //float rough = 1- vec3_dot(&in->normal, light);
+ //float rough = 1- internal_vec3_dot(&in->normal, light);
float depth = _clip_pos->x / _clip_pos->y;
depth = (depth + 1) / 2;
depth = linear01depth(depth);
Color32 c = tex2d(_albedo_tex, _texcoord);
//Color32 nc = tex2d(noramltex, in->texcoord);
- //vec3_scale(&c, roughness, &c);
+ //internal_vec3_scale(&c, roughness, &c);
color32_saturate(&c);
*color = c;
- //vec3_scale(color, 1 - depth, color);
+ //internal_vec3_scale(color, 1 - depth, color);
return 1;
}