zoukankan      html  css  js  c++  java
  • 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得到注解句柄的相关信息。
  • 相关阅读:
    Windows各个文件夹介绍
    Zabbix使用外部命令fping处理ICMP ping的请求
    QT 样式表实例
    QT 样式表基础知识
    cocos2d-js入门一
    try throw catch typeid
    cocos2d-x入门三 分层设计框架
    cocos2d-x入门二 helloworld实例运行与创建
    cocos2d-x入门一
    批量操作QT UI中的控件
  • 原文地址:https://www.cnblogs.com/minggoddess/p/2004243.html
Copyright © 2011-2022 走看看