diff --git a/res/basicShader.fs b/res/basicShader.fs index 1a7154d..cefa2c7 100644 --- a/res/basicShader.fs +++ b/res/basicShader.fs @@ -1,4 +1,6 @@ -#version 120 +#version 330 + +out vec4 color; varying vec2 texCoord0; varying vec3 normal0; @@ -8,6 +10,6 @@ uniform vec3 lightDirection; void main() { - gl_FragColor = texture2D(sampler, texCoord0) * + color = texture2D(sampler, texCoord0) * clamp(dot(-lightDirection, normal0), 0.0, 1.0); } diff --git a/res/basicShader.vs b/res/basicShader.vs index e673548..1b23601 100644 --- a/res/basicShader.vs +++ b/res/basicShader.vs @@ -1,8 +1,8 @@ -#version 120 +#version 330 -attribute vec3 position; -attribute vec2 texCoord; -attribute vec3 normal; +layout(location = 0) in vec3 position; +layout(location = 1) in vec2 texCoord; +layout(location = 2) in vec3 normal; varying vec2 texCoord0; varying vec3 normal0;