Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernized the shaders #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions res/basicShader.fs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#version 120
#version 330

out vec4 color;

varying vec2 texCoord0;
varying vec3 normal0;
Expand All @@ -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);
}
8 changes: 4 additions & 4 deletions res/basicShader.vs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down