What are the semantics in CG programming?

拟墨画扇 提交于 2020-01-16 12:09:33

问题


msdn stated A semantic is a string attached to a shader input or output that conveys information about the intended use of a parameter

unity stated Semantics is a special clause of Cg to define the default input values of a fragment/vertex Shader

What are the actually semantics? why do we use it? It is necessary?


回答1:


Basically it tells what kind of data stored in certain field - position, normal, texture coordinates et cetera.

It was useful to describe vertex format in fixed-function pipeline but in programmable pipeline semantics is described by shader, so its definition in vertex format may have no sense (for example, shader may use TEXCOORD0 as normals) yet it still required by compiler.



来源:https://stackoverflow.com/questions/30640607/what-are-the-semantics-in-cg-programming

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!