fx composer 的<> 尖括号

之前看了 cg和hlsl没听说过这种奇怪的东西
 
//////////////////////1
pass GlowPass <
       	string Script= "RenderColorTarget0=;"
			"RenderDepthStencilTarget=;"
			"Draw=Buffer;";        	
    >
////////////////////2
float Glowness <
    string UIName = "Glow Strength";
    string UIWidget = "slider";
    float UIMin = 0.0f;
    float UIMax = 2.0f;
    float UIStep = 0.05f;
> = 0.7f;
//////////////////////////////3
float3 Lamp0Color : Specular <   
 string UIName =  "Lamp 0";  
  string Object = "Pointlight0";  
  string UIWidget = "Color";> = {1.0f,1.0f,1.0f};
 就是这个尖括号里面的 
看起来像脚本 描述 之类的 
朋友给了份文档有详细介绍,昨晚理解了下
文档地址http://developer.stage.nvidia.com/content/using-sas-fx-and-cgfx-file-formats
这东西叫SAS 全称是 standard annotations 和semantic(Standard Annotations and Semantics)
据说之前是dx的 后来就成fx用了 那个dx那里的msdn都消掉了的(之前是DXSAS)
关于语义 那个gpu阳春白雪里有详细介绍 就是:positon这种
annotation是注解的意思 
上面引用的 第2种比较好理解 就是在fx里点了 effect注解里uiwidget的 就会在属性面板里按照定义显示 color slider 类型none的话是不显示的
3也好理解 obj类型的 就是给显示在属性面板里 不能修改值 只是告诉你 那是什么的
1是script类型的 还没理解完 似乎是能给pass technique 。。。。。并且和python有关

对了 这个 格式是很关键的 type identifier  :semantic<annotations_list>=value;
关于那个semantic本来 就几个 pos tex color这样的 
 上面的文档里说除了这些hardware 还有 估计有上百的 software semantic

有两个版本的SAS
SAS 1.0 是Dx9支持的
SAS0.86是fxcomposer和Dx9Dx10Opengl支持的
这两个版本 最大的不同在于0.86支持对technique和pass的scripting 
============================================
龙书上的一段 这东西叫注解 Annotations 
hlsl中并不使用 但是程序可以通过效果框架得到,用下面的方法
D3DXHANDLE ID3DXEffect::GetAnnotationByName(
  S3DXHANDLE hObject,
  LPCSTR pName
);
pName 注解的名字
hObject 注解所在父块句柄。
ID3DXEffect::GetParameterDesc得到注解句柄的相关信息。
posted on 2011-04-03 10:44  minggoddess  阅读(763)  评论(0编辑  收藏  举报