Question

If i use opengl 3.2+ with compatibility context and have a fragment shader, is it necessary to have a vertex shader? I would like to know if per vertex lighting calculation and other per vertex calculations can be done by the fixed function pipeline and i can just use the fragment shader.

Also what implications would this have for per-vertex attribute binding locations?

Était-ce utile?

La solution

if per vertex lighting calculation and other per vertex calculations can be done by the fixed function pipeline

They can be done if you use fixed pipeline lights.Otherwise, part of it (like transformed normals,uv's and positions) must be computed elsewhere before being passed to the fragment shader.This "elsewhere" is called vertex shader.So yes,if you don't use fixed pipeline lightning system you must use vertex and fragment shader to process it.

Also,if you use fixed pipeline lightning you can still use shaders where you can access fixed light and material properties.But I see no point doing so unless you wish to break the defaul behavior.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top