23 lines
433 B
GLSL
23 lines
433 B
GLSL
#version 330
|
|
|
|
// Input vertex attributes (from vertex shader)
|
|
in vec3 fragPosition;
|
|
in vec2 fragTexCoord;
|
|
in vec4 fragColor;
|
|
in vec3 fragNormal;
|
|
|
|
// Input uniform values
|
|
uniform sampler2D texture0;
|
|
uniform vec4 colDiffuse;
|
|
|
|
#define POSTERIZE 5.0
|
|
|
|
out vec4 finalColor;
|
|
|
|
void main() {
|
|
vec4 texelColor = texture(texture0, fragTexCoord);
|
|
|
|
finalColor.a = 1.0;
|
|
finalColor.rgb = floor(texelColor.rgb * POSTERIZE) / POSTERIZE;
|
|
}
|