Skip to main content
GameDev.net gamedev.net
🔒 Locked

fx semantics question??

Started by gatisk Jun 29, 2004 at 9:03 AM 1 replies 1.5k views
Original Post
gatisk
gatisk
Few days ago I downloaded Nvidas FX Composer (very nice app for fx creation in my opinion). The question is about semantics - FX Composer uses a set of known semantics from Microsoft specification (it automatically binds known semantic to color values, light positions and matrices..), but the problem is that it uses the same semantic for different things - in example it uses semantic "Diffuse" for diffuse texture, material color and light color. (That's how it is suposed to be according to MS specification).. so I wanted to know how to use such fx in my program - how can I know which variable is which if they have the same semantics (i.e. how can I know if variable is light color or material color if they use the same semantics) ??? I know that I can use my own semantics, but then FX composer gives some warnings and there is not possible automatic binding , and also I wanted to have my app compatible with MS specification..
Gatis
poly-gone
poly-gone
To identify each parameter, use the "GetParamterByName" function instead of the "GetParameterBySemantic". But obviously with this method automatic binding won't be possible.

For automatic binding, you'll need to specify your own semantics that are recognizable by your engine. One way to abstract this would be to make your shader system responsible for "interacting" with the shader constants right from the scene export phase to the rendering phase. That way, you can use arbitrary shaders and still have automatci binding without trouble with semantics.
EvilDecl81
EvilDecl81
Quote:
Original post by gatisk
Few days ago I downloaded Nvidas FX Composer (very nice app for fx creation in my opinion).
The question is about semantics - FX Composer uses a set of known semantics from Microsoft specification (it automatically binds known semantic to color values, light positions and matrices..), but the problem is that it uses the same semantic for different things - in example it uses semantic "Diffuse" for diffuse texture, material color and light color. (That's how it is suposed to be according to MS specification).. so I wanted to know how to use such fx in my program - how can I know which variable is which if they have the same semantics (i.e. how can I know if variable is light color or material color if they use the same semantics) ???
I know that I can use my own semantics, but then FX composer gives some warnings and there is not possible automatic binding , and also I wanted to have my app compatible with MS specification..


A semantic is not a tag which uniquely idenitifies an item - it describes what information it contains. When you are compiling to shaders, for instance, the set of valid semantics. Annocations are used for more precise information - so I'd suggest using them


EvilDecl81

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.