would this work in Love2D?
Posted: Thu Oct 09, 2014 7:07 pm
with a bit of change of course. This is a basic fragment shader using GLSL
Code: Select all
#version 330
in vec2 texCoord0;
out vec4 fragColor;
uniform vec3 baseColor;
uniform sampler2D sampler;
uniform vec3 ambientLight;
struct BaseLight
{
vec3 color;
float intensity;
};
struct DirectionalLight
{
BaseLight base;
vec3 direction;
};
vec4 calcLight(BaseLight base, vec3 direction, vec3 normal)
{
}
void main()
{
vec4 totalLight = vec4(ambientLight,1);
vec4 color = vec4(baseColor, 1);
vec4 textureColor = texture(sampler, texCoord0.xy);
if(textureColor != vec4(0,0,0,0))
color *= textureColor;
fragColor = color * totalLight;
}