# Weird constant names in HLSL?

This topic is 4853 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, I stumbled upon something weird when using HLSL shaders. I compile them with the D3DX compiler, and get a constant table (among other stuff). Now, I can get a handle for the constant "worldviewprojection", for example. There is one slight problem though: If the constant is outside a function, like
float4x4 worldviewprojection; void main( ......

Then the constant is called "worldviewprojection" in the table. So far so good. However, if the constant is in a function's parameter list, like
void main( ... uniform float4x4 wvp; ...)

Then the constant in the table is called "$worldviewprojection" instead of just "worldviewprojection", which is really annoying. Any way how I can get rid of the "$"? I mean, I can easily remove it, but I don't know if this is a good idea (other special characters could appear, more than one \$ etc., thus I would have to hack around and try to catch up with the table's weirdness).

1. 1
Rutin
67
2. 2
3. 3
4. 4
5. 5

• 11
• 11
• 21
• 10
• 33
• ### Forum Statistics

• Total Topics
633438
• Total Posts
3011882
• ### Who's Online (See full list)

There are no registered users currently online

×