15 lines
515 B
GLSL
15 lines
515 B
GLSL
// RGB subpixel filter for Ammo LEDs
|
|
|
|
// GRIDSZ = how many subpixels are in the texture (for layouts where subpixel patterns alternate)
|
|
#ifndef GRIDSZ
|
|
#define GRIDSZ vec2(1.,1.)
|
|
#endif
|
|
|
|
void SetupMaterial( inout Material mat )
|
|
{
|
|
mat.Base = texture(scrtex,vec2(vTexCoord.s,1.-vTexCoord.t)); // canvas textures are upside-down when used by models
|
|
vec2 uv = (vTexCoord.st*vec2(textureSize(scrtex,0)))/GRIDSZ;
|
|
mat.Base *= 1.5*texture(pixtex,uv);
|
|
mat.Normal = ApplyNormalMap(vTexCoord.st);
|
|
mat.Bright = vec4(1.);
|
|
}
|