When I loaded the game into the love2d android app I get this error
Error
Error validating pixel shader code:
Line 37: ERROR: 'max' : no matching overloaded function found
Line 37: ERROR: '' : missing #endif
Line 37: ERROR: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.
Traceback
[C]: in function 'newShader'
GameState/Components/SS3D/Scripts/NewScene.lua:60: in function 'NewScene'
GameState/Components/SS3D/SS3D.lua:76: in function 'Load'
main.lua:75: in function 'LoadModule'
main.lua:101: in function 'load'
[C]: in function 'xpcall'
[C]: in function 'xpcall'
Here is my shader code:
Code: Select all
love.graphics.setDepthMode("lequal", true)
-- define the shaders used in rendering the SS3D.Scene
SS3D.Scene.threeShader = love.graphics.newShader[[
uniform mat4 view;
uniform mat4 model_matrix;
uniform mat4 model_matrix_inverse;
uniform float ambientLight;
uniform vec3 ambientVector;
varying mat4 modelView;
varying mat4 modelViewProjection;
varying vec3 normal;
varying vec3 vposition;
#ifdef VERTEX
attribute vec4 VertexNormal;
vec4 position(mat4 transform_projection, vec4 vertex_position) {
modelView = view * model_matrix;
modelViewProjection = view * model_matrix * transform_projection;
normal = vec3(model_matrix_inverse * vec4(VertexNormal));
vposition = vec3(model_matrix * vertex_position);
return view * model_matrix * vertex_position;
}
#endif
#ifdef PIXEL
vec4 effect(vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords) {
vec4 texturecolor = Texel(texture, texture_coords);
// if the alpha here is zero just don't draw anything here
// otherwise alpha values of zero will render as black pixels
if (texturecolor.a == 0.0)
{
discard;
}
float light = max(dot(normalize(ambientVector), normal), 0);
texturecolor.rgb *= max(light, ambientLight);
return color*texturecolor;
}
#endif
]]
" float light = max(dot(normalize(ambientVector), normal), 0); "
Anyone know whats up here?? Thanks