Quote: "Means the shader requires, say, position, normals, and UV, and the object only has position and UV. It might work, but it might not look right."
my shader:
vertex
attribute vec3 position;
attribute vec3 normal;
attribute vec2 uv;
varying vec2 uvVarying;
varying vec3 normalVarying;
varying vec3 posVarying;
uniform vec4 uvBounds0;
uniform mat4 agk_World;
uniform mat4 agk_ViewProj;
uniform mat3 agk_WorldNormal;
void main()
{
vec4 pos = agk_World * vec4(position,1);
gl_Position = agk_ViewProj * pos;
vec3 norm = agk_WorldNormal * normal;
posVarying = pos.xyz;
normalVarying = norm;
uvVarying = uv * uvBounds0.xy + uvBounds0.zw;
}
pixel
varying vec3 normalVarying;
varying vec3 posVarying;
varying vec2 uvVarying;
uniform vec3 agk_DLightDir;
uniform vec4 agk_DLightColor;
uniform vec4 agk_ObjColor;
uniform sampler2D texture0;
void main()
{
vec3 norm = normalize(normalVarying);
vec3 color = clamp(dot(-agk_DLightDir,norm)*agk_DLightColor.rgb,0.2,1.0);
gl_FragColor = (texture2D(texture0, uvVarying)*vec4(color,1))*1.5;
}
in console:
Quote: "Shader "data/sdr_diff.vs" requires vertex attributes that object 10004 does not provide, this shader may fail to display the object"
What is wrong?