Help with Timer

share shaders here
Post Reply
  • Author
  • Message
Offline
User avatar
*blah-blah-blah maniac*
Posts: 1498
Joined: 31 Mar 2012, 15:06
Location: France

Help with Timer

Well, don't know what's the right section to post this, so here we go : (Boris tell me if I have to move the topic... ?)

When using Timer to make a value increase in intensity / amount, etc... for example :

" value " + frac(Timer.x * 2000.0 + Timer.x)

how can I avoid this value coming back straight to min before starting raising again ?
Is it possible to have Increase >>>> Decrease >>>>> Increase again smooth cycles and how ?

Sorry for being such a rookie ... :(
_________________
Lian Li PC011 Dynamic, Corsair AX 1500i PSU, i9 10850K @5.0 Ghz, Aorus Z490 Ultra, RTX3090 MSI Gaming X Trio, 32GB Corsair Vengeance Pro RGB RAM@3600, Corsair MP600 1TB NVME System Drive, 10 TB Storage, W10 Pro 64, Custom Hard Tubing Watercooling Loop

Offline
User avatar
*blah-blah-blah maniac*
Posts: 17447
Joined: 27 Dec 2011, 08:53
Location: Rather not to say

Re: Help with Timer

First of all, cycle repeat after 4 hours, so one frame per 4 hours will change result. Not much chances to see thing for lens flares. Anyway, if you want to make smooth changes, here is an example:

Code: Select all

float timepassed=Timer.x*2000.0;//2000 is time speed multiplier
timepassed=frac(timepassed) * 2.0 - 1.0;
timepassed=abs(timepassed);
Hope i didn't make mistake. Btw, you can use changes depending from screen uv and intensity of rays read from texture line shifted in time. May be i'll do examples for modders like you.
_________________
i9-9900k, 64Gb RAM, RTX 3060 12Gb, Win7

Offline
User avatar
*blah-blah-blah maniac*
Posts: 1498
Joined: 31 Mar 2012, 15:06
Location: France

Re: Help with Timer

ENBSeries wrote:First of all, cycle repeat after 4 hours, so one frame per 4 hours will change result. Not much chances to see thing for lens flares. Anyway, if you want to make smooth changes, here is an example:

Code: Select all

float timepassed=Timer.x*2000.0;//2000 is time speed multiplier
timepassed=frac(timepassed) * 2.0 - 1.0;
timepassed=abs(timepassed);
Hope i didn't make mistake. Btw, you can use changes depending from screen uv and intensity of rays read from texture line shifted in time. May be i'll do examples for modders like you.

Thanx Boris ! Once again... ;)

If time multipliers high enough, changes on flares are very visible. Indeed, I managed to make EVERYTHING (even colors ! :lol: ) variable in time. This is pretty simple, even if the maths are everywhere :lol: I need to CLEAN the files.

Will try that piece of code RIGHT AWAY !!
JawZ' s involving in very realistic lenzes and flares, we're on something right now ;)

Didn't choose what's the right method for blurring right now... maybe I have something with gaussians offsets in mind, don't know yet....


EDIT : Boris, you' re ABSOLUTE GENIUS !! And yep, forgive the ass licking ! This WORKS to perfection ! Now entire lines of flares go to Sun, then from sun to eye and back. And it's SMOOTH ! Setting time multipliers (I created vars for these, such as fDepthDisplacementVelocityDraw1, ect... then defines) up to 1000 is more than enough to clearly get the effect.
It's gorgeous ! 100 are good enough values.
I can also set it sprite per sprite in the same line... possibilities are endless !!
_________________
Lian Li PC011 Dynamic, Corsair AX 1500i PSU, i9 10850K @5.0 Ghz, Aorus Z490 Ultra, RTX3090 MSI Gaming X Trio, 32GB Corsair Vengeance Pro RGB RAM@3600, Corsair MP600 1TB NVME System Drive, 10 TB Storage, W10 Pro 64, Custom Hard Tubing Watercooling Loop
Post Reply