• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# FX files and fixed-function parameters

## Recommended Posts

It seems to me as if the fixed-function parameters (such as light direction) get baked when you first load the effect, whereas the same parameter for shaders gets updated correctly. If I have
float3 CamPos : CAMPOS = { 0, 0, 0 };

technique t0 {
pass p0 {
LightPosition[0]  = (CamPos);
...
}
}

technique t1 {
pass p0 {
}
}

and VS() references CamPos, then the t1 technique will do the right thing as I update the CAMPOS semantic, but the t0 will "bake" the light position at whatever the camera position was when I started. What is the appropriate fix for this? Could I tag the LightPosition[0] argument using : CAMPOS semantic? Is this a known bug or limitation? Something I could be doing wrong that I could change?

##### Share on other sites
quote:
and VS() references CamPos, then the t 1technique will do the right thing as I update the CAMPOS semantic, but the t 0will "bake" the light position at whatever the camera position was when I started.

What is the appropriate fix for this? Could I tag the LightPosition[0] argument using : CAMPOS semantic? Is this a known bug or limitation? Something I could be doing wrong that I could change?

- Are you sure? This seems like an app bug to me, because I've used FX files with the FPP and it always correctly used my updated constants.

- I don't think you can define custom semantics, there's no CAMPOS semantic.

- Could you show the whole FX file? (or the VShader and the FFP setup, at least)

[edited by - Coder on January 7, 2004 4:04:21 AM]

##### Share on other sites
In 9.0, you can absolutely define your own semantics, and query for them in the effect, and then set values on them. In fact, I don''t use the fixed-function way of specifying parameters at all (i e, world, view and projection matrices arrive through semantics; I never assign to Device.Transforms at all)

However, I found the problem in my effect; it was a typo. Thanks for the offer of a second set of eyes; I''ll definitely need that sometime in the future :-)

• ## Partner Spotlight

• ### Forum Statistics

• Total Topics
627653
• Total Posts
2978440

• 10
• 12
• 22
• 13
• 33