开发者

Dropdown UI widget for fx/hlsl shader

I've made a HLSL shader (fx format) and would like to add a enum/list paremeter to its UI - as a better alternative to the list of boolean flags.

So instead of :

  • [x] "Use custom map"
  • [x] "Use custom map alpha"
  • [x] "Use diffuse alpha"
  • [x] "Use specu开发者_如何学Clar alpha"
  • [x] "Use normal alpha"

have:

  • Source: [ "Use custom map" ]

with all 5 choices and the index to selected item on the code level.

"DirectX Standard Annotations and Semantics Reference" mentions about the ListPicker widget but I can't find any example or description how to use it.

The questions are:

  • Is it possible to have a custom dropdown-like widget in the shader's UI?
  • How to achieve it?


SAS allows you to set parameters like these but it is entirely ignore by the shader itself. It is purely meta-data for another system to use if/when it needs too ... it does NOT handle rendering of the UI. If you want a UI then you have to read this semantic & annotation data and use it to draw a UI. Either that or use an application that recognises the semantics/annotations structure ...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜