Managing effect shader visuals

Post » Fri May 27, 2011 2:25 pm

Hi folks,

I'm trying to shift between several membrane Effect Shaders playing on an NPC via scripts, but doing this smoothly is very tough because of the "fade" that happens when an indefinite-duration effect shader is stopped. What happens is that the shader I stop appears on the mesh, fades, and then the new shader pops back into place. What I would like is for the new shader to seamlessly replace the old one. Getting new shaders to start instantly hasn't been a problem, but handling the old ones fading out has been. I'm hoping the community knows some kind of workaround.

For instance, if I have:

target.PMS level1

and then some frames later have:

target.PMS level2

... the shader "order" doesn't seem to always be maintained. It appears to work at first: level1 is instantly replaced with level2. But at some point (I think it may be when another unrelated shader plays) the level1 shader eventually replaces the level2 shader. It's like the "stack" of shaders gets messed up. If more than one shader is playing on a mesh, and neither have a duration, shouldn't the last-played shader always be the one that shows up, or is this just an engine issue?

If instead I try for the second block:

target.SMS level1
target.PMS level2

I get the fading issue I discussed above, where level1 has to finish fading out before level2 displays.

Each level of shader is only applied one time--the blocks above only run one time, so I don't think it's an issue with shaders being reapplied out of order.

I'm trying to get at weird or unintuitive behavior that these shaders might have: ways, basically, to avoid or get around the fade-out of a stopped shader, or to not have to stop the level1 shader at all. As I said, I'm unsure if this is something I'll just have to tolerate. I've seen other plugins doing similar things, and it looks like they're more or less doing what I am doing scriptwise. I don't think any of the effect shader settings control the membrane shader fade out duration, either.

(Ideally, I'd have multiple separate shaders blending, but I realize that's not going to happen.)
User avatar
LijLuva
 
Posts: 3347
Joined: Wed Sep 20, 2006 1:59 am

Post » Fri May 27, 2011 6:12 pm

The fade-out should be instantaneous if you set the fade-out time attributes of your target EFSH to 0.
User avatar
Karine laverre
 
Posts: 3439
Joined: Tue Mar 20, 2007 7:50 am


Return to IV - Oblivion