remove bound effect textures

Started by
3 comments, last by edwinnie 19 years, 7 months ago
hihi! i set a texture to the effects-based shader. but how do i remove it, if i do not need it for the next pass?? thx! Edwinz
Advertisement
There's no need to remove a texture once it is set. You can overwrite it with a new one, but removing it doesn't help anything.
Beginning/Ending effects may actually save the previous state and restore it, unless you specifically pass flags to make it not save state. However, as not saving state is faster, that's what you should do.

The next effect will set up all the state it needs. Thus, if you use effects for everything, you'll be fine no matter what.

If you don't, then I suggest creating an effect that assigns all textures and shaders to NULL and all other states to whatever defaults you want. When you're done rendering using an effect, and want to render using manual states, apply the first pass of this effect to "clear out" the system; then set the states you want manually.
enum Bool { True, False, FileNotFound };
Quote:Original post by hplus0603
If you don't, then I suggest creating an effect that assigns all textures and shaders to NULL and all other states to whatever defaults you want. When you're done rendering using an effect, and want to render using manual states, apply the first pass of this effect to "clear out" the system; then set the states you want manually.

For that I'd suggest modifying the already-existing defaults.fx file by InFramez.

hihi!
thx alot fer replies!

jus one other qn:
I know float texture formats (16bit & above) usually give a performance hit when used in RTTs.

I wanna ask if textures not used for RTTs but used as a lookup will incur any similar performance hits like those used in RTTs.

I understand figuring out the texture sizes & formats are a way to minimize such problems, but dunno if non-RTT based textures would incur the same problems...

thx!
Edwinz

This topic is closed to new replies.

Advertisement