Skip to main content
gamedev.net
🔒 Locked

Using SetSamplerState with Effects

Started by 360GAMZ Jul 2, 2007 at 12:13 AM 0 replies 650+ views
Original Post
360GAMZ
360GAMZ
I'm using DX9 Effect files by creating them with D3DXCreateEffect(). For effects that use a standard 2D texture, I would like for the application to have dynamic control over whether the texture sampler performs texture coordinate wrapping or clamping. Correct me if I'm wrong, but it seems like the only way for the app to have control over wrapping/clamping is by using SetSamplerState(). However, this function requires the sampler index, and there appears to be no way to query the Effects framework to find out which sampler number has been assigned to a specific texture. ID3DXConstantTable isn't an option because there doesn't seem to be a way to get the ID3DXConstantTable for an effect that has been created with D3DXCreateEffect(). I could explicitly assign a sampler register in my .fx file, but I'd rather not - it just seems like there should be a way to have the Effect compiler auto-assign the sampler number and for the app to find out what the assignment was. If you know of a way to do this, I'd love to hear it! Thanks!

Topic Locked

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

Sign in to reply to this topic.