Blink vs Fade
I have a blinking plugin, which i want to fade over time.
the blinking one just alternates between max and min value at the given interval. the simple code doing the blink is this: Code:
//Find which value to use period = interval ( lets say we can make it the last frame in scene) fPer1 = min value fPer2 = max value is there a simple way to make it fade ? :) |
Code:
fFactor = (defInst->fPer2-defInst->fPer1) / defInst->period; |
*crazy* stuff - thanks alot.
we now have envelope on surface attributes. :D |
i've extended the version above, to do the animation only in a given interval,
defining start and end frame. somehow it does work, but it looks a bit odd, not sure where i made a mistake: Code:
XCALL_(void) evaluate(LWInstance inst, ShaderAccess *sa) frame is the current frame. #1) i've added the whole fucntion, since i think it must be of importance, where it checks, if we are in the range (start -> end). but it does still some weird blinking at some point, instead of fading all the time. does it look right, is the math with period1/period2 and start/end correct? or is there something wrong? |
1 Attachment(s)
i replaced all (defInst->period1) with (defInst->period2 - defInst->period1)
it's looking better now, but not yet perfect :) #1) removing the range check made it work as i want it to do :cool needs some more tests with the desired range, but looking good for now. |
All times are GMT +2. The time now is 04:33. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.