GLSL fixed function fragment program replacement
问题 When using the OpenGL fixed function pipeline for vertex setup, how a fragment program looks like that is compatible to the fixed function vertex setup? I guess that usually depends on the number of light sources and texture layers etc.. So for example how does a simple non-texture one-lightsource goraud shading fragment program look like that replaces GL\'s fixed function shader? 回答1: While Gouraud shading calculates the light in the the vertex shader, Phong shading calculates the light in