Gravity Games
Newbie
Hello, as you may or may not know, I've been working on an android gaming engine, and I've finally started implementing lighting (which I'm going ahead and doing, even though I primarily make 2-d games), but my game keeps crashing. After experimenting a little, I found out that the problem lies somewhere in these vec4 functions:
Any help as to what I did wrong? I'm still REALLY new to glsl.
Code:
vec4 calcLight(BaseLight base, vec3 direction, vec3 normal){
float diffuseFactor = dot(-direction, normal);
vec4 diffuseColor = vec4(0, 0, 0, 0);
if(diffuseFactor > 0){
diffuseColor = vec4(base.color, 1.0) * base.intensity * diffuseFactor;
}
return diffuseFactor;
}
vec4 calcDirectionalLight(DirectionalLight directionalLight, vec3 normal){
vec4 result = calcLight(directionalLight.base, directionalLight.direction, normal);
return result;
}
Any help as to what I did wrong? I'm still REALLY new to glsl.