Implemented limited nearest-neighbor in GLSL
Getty Ritter
8 years ago
11 | 11 |
void main() {
|
12 | 12 |
float brightness = dot(normalize(o_nrm), normalize(u_light));
|
13 | 13 |
float factor = 0.5 + (brightness * 0.5);
|
14 | |
color = texture(tex, o_tex) * factor;
|
| 14 |
vec2 near_tex = (floor(o_tex * 32.0) + 0.5) / 32.0;
|
| 15 |
color = texture(tex, near_tex) * factor;
|
15 | 16 |
}
|