Add a ball, use actual flat shading
This commit is contained in:
parent
bde3aa816c
commit
fa0cb2a5d8
BIN
demo/ball.glb
Normal file
BIN
demo/ball.glb
Normal file
Binary file not shown.
@ -31,7 +31,7 @@ function init()
|
|||||||
light.color = couch.Vector3(1.0, 1.0, 1.0)
|
light.color = couch.Vector3(1.0, 1.0, 1.0)
|
||||||
light.ambient = 0.2
|
light.ambient = 0.2
|
||||||
light.diffuse = 1.0
|
light.diffuse = 1.0
|
||||||
light.specular = 0.0001
|
light.specular = 0.01
|
||||||
couch.Node.GetRoot().children:Append(light)
|
couch.Node.GetRoot().children:Append(light)
|
||||||
|
|
||||||
ball = couch.Mesh.FromFile("cube.glb")
|
ball = couch.Mesh.FromFile("cube.glb")
|
||||||
@ -41,7 +41,7 @@ function init()
|
|||||||
ball:SetMaterial(0, material)
|
ball:SetMaterial(0, material)
|
||||||
couch.Node.GetRoot().children:Append(ball)
|
couch.Node.GetRoot().children:Append(ball)
|
||||||
|
|
||||||
ball1 = couch.Mesh.FromFile("cube.glb")
|
ball1 = couch.Mesh.FromFile("ball.glb")
|
||||||
material = couch.Material()
|
material = couch.Material()
|
||||||
material.tex = couch.Texture.FromFile("container.png")
|
material.tex = couch.Texture.FromFile("container.png")
|
||||||
material.usesTex = true
|
material.usesTex = true
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
in vec3 UV;
|
in vec3 UV;
|
||||||
in vec3 NORMAL;
|
in vec3 NORMAL;
|
||||||
in vec3 LIGHT;
|
flat in vec3 LIGHT;
|
||||||
|
|
||||||
out vec4 FragColor;
|
out vec4 FragColor;
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ uniform mat4 PROJECTION;
|
|||||||
|
|
||||||
out vec3 UV;
|
out vec3 UV;
|
||||||
out vec3 NORMAL;
|
out vec3 NORMAL;
|
||||||
out vec3 LIGHT;
|
flat out vec3 LIGHT;
|
||||||
|
|
||||||
struct DirectionalLight {
|
struct DirectionalLight {
|
||||||
vec3 direction;
|
vec3 direction;
|
||||||
|
Loading…
Reference in New Issue
Block a user