Add a ball, use actual flat shading

This commit is contained in:
Dane Johnson 2021-01-21 18:29:49 -06:00
parent bde3aa816c
commit fa0cb2a5d8
4 changed files with 4 additions and 4 deletions

BIN
demo/ball.glb Normal file

Binary file not shown.

View File

@ -31,7 +31,7 @@ function init()
light.color = couch.Vector3(1.0, 1.0, 1.0)
light.ambient = 0.2
light.diffuse = 1.0
light.specular = 0.0001
light.specular = 0.01
couch.Node.GetRoot().children:Append(light)
ball = couch.Mesh.FromFile("cube.glb")
@ -41,7 +41,7 @@ function init()
ball:SetMaterial(0, material)
couch.Node.GetRoot().children:Append(ball)
ball1 = couch.Mesh.FromFile("cube.glb")
ball1 = couch.Mesh.FromFile("ball.glb")
material = couch.Material()
material.tex = couch.Texture.FromFile("container.png")
material.usesTex = true

View File

@ -2,7 +2,7 @@
in vec3 UV;
in vec3 NORMAL;
in vec3 LIGHT;
flat in vec3 LIGHT;
out vec4 FragColor;

View File

@ -10,7 +10,7 @@ uniform mat4 PROJECTION;
out vec3 UV;
out vec3 NORMAL;
out vec3 LIGHT;
flat out vec3 LIGHT;
struct DirectionalLight {
vec3 direction;