however ,if i change it like that,it won’t work,why???
I don’t know; do you think this question really needs eight question marks?
In any case, you didn’t say what about this doesn’t work. Is it a compiler error? A linker error?
Your shader examples do not seem to have a #version definition, which means that it will be compiled against GLSL version 1.10. And back then, they didn’t have “in” and “out”; only “varying”. If you want to use more up-to-date GLSL syntax, you need to have a #version definition for GLSL 1.30 or greater.
it does not work mean that in the Fragment shader
in float v;
main()
{
gl_FragColor = gl_Color*v;
}
in float v should affect gl_FragColor,but the result teapot is just white , so i think v does not receive any value from vertex shader,i use #version 140 ,but it does not work either.