added Normal.glsl BlinnPhongPureColor.mtl

This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2023-10-10 19:14:10 +08:00
parent 8a5711154f
commit 737438aaed
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,9 @@
mat3 GetNormalMatrix()
{
return mat3(camera.view*GetLocalToWorld());
}
vec3 GetNormal(mat3 normal_matrix,vec3 normal)
{
return normalize(normal_matrix*normal);
}

View File

@ -0,0 +1,32 @@
#Material
Name Blinn-phong shading model only color
Base Std3D
Require LocalToWorld,Camera,Sun
#MaterialInstance
Code
{
float Diffuse;
float Intensity;
}
#VertexInput
vec3 Normal
#Vertex
Output
{
vec3 Normal;
}
Code
{
gl_Position=GetPosition3D();
}
#Fragment