Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / evolved water laggy

Author
Message
Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 3rd Oct 2014 09:37
There is a way to make the evolved water shader not laggy?

I mean, it seems like it update the refraction of the surface like 5 times per second which is not good looking.

To see what i mean open his example WaterTerrain here:

http://www.evolved-software.com/shaders/refractionreflection
Mr Bigglesworth
18
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 4th Oct 2014 17:19
It runs fine for me. What are your computer specs?
wattywatts
17
Years of Service
User Offline
Joined: 25th May 2009
Location: Michigan
Posted: 4th Oct 2014 20:58
Quote: " There is a way to make the evolved water shader not laggy?"

Upgrade your PC?
Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 6th Oct 2014 02:32
You did not understood the problem, is the water that updates the refraction 5 times per second NOT the game running that slow!!!

I have almost a Whole game level loaded (complex one) and goes over 100 fps in some points so its not my pc to upgrade!!!
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 6th Oct 2014 02:44 Edited at: 6th Oct 2014 02:46
it should only really update on a call to sync. I think the only way to slow it down is to slow down your calls to sync, this will of course slow down the program as a whole however.

if you are syncing more than once per loop, you may want to try to syncmask the water out of those it is not needed on

Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 6th Oct 2014 03:56
slow it down? what i requested is that it will be updated more often not less!

As you can see on the evolved code, it calls a fastsync at the end of the refraction & reflection function, plus obviously i have a sync at the end of my main loop.

What i can t understand is why the water movement is updated like 3-4 times per second regardless my framerate? i can have 10 fps like i can have 1000 fps on my game and he water updates like 3-4 times per second.

So the sync part its not the problem as if was connected to it it should update every sync but it isnt, i dont know if is something that the shader takes care or what
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 6th Oct 2014 11:31
It might be that it updates several maps and swaps these like "back" and "front" resources. The swap only takes place once all maps have been updated and to increase overall frame rate only a single (or some other set number) map is updated per frame.

I've noticed some modern, commercial AAA games actually use a system like this for cascaded shadow maps; it looks quite ok as the shadow movement is rather slow anyway but if you pay close attention to it they don't update on each frame.


"Why do programmers get Halloween and Christmas mixed up?"
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 6th Oct 2014 18:58
If you say you can run the program at 1000 FPS and the water still looks 'laggy', then you may be mistaking the jagged wave animation algorithm for lag.

The shader mearly needs more attention; this example is just a starting point. Consider using one of his latest examples if you do not want to learn how to program shaders.

Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 7th Oct 2014 03:30
I didnt wrote the shader, and the latest example of evolved is too big and complex to add to my code, his example alone has so many shaders all together that probably will makes my game to lag (did you seen how many code lines are all the files together?), i actually just need the water shader, maybe a depth of view shader and a shadow shader, but i dont know how to \"blend\" these 3 shaders all together as they all use camera 1 so adding a 2nd shader will f*ck up the 1st shader and so on, i made different attemps adding more shaders to my game but i can only let the water to work (which is a bit laggy to update if you pay attention).

By the way, do you know how to fix this laggy water? if you need to look at the shader file you can take it from evolved website looking on WaterTerrain project
Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 7th Oct 2014 17:15 Edited at: 7th Oct 2014 17:16
Quote: "I didnt wrote the shader"


I most certainly know you did not write it; you just need to learn how to adjust it, to make it look the way you want it to look; otherwise find someone to do it for you. I do not have the time unfortunately, looks like it could take hours just to figure out where the problem is.

Try asking Evolved himself; go to his forum; he will know more than anyone else since he wrote the thing.

Meanwhile I hope you get the help you are asking for.

As far as depth of field and shadows, it does not get any easier than what is the case now with water example.

It is possible to make shaders work together, or combine them; but it takes hard work. You'd have to learn how to write one first.

Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 9th Oct 2014 03:42
I dont know for what reason, but today i tryed my game on my girlfriend notebook and the water wasn t laggy, very weird
Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 9th Oct 2014 04:48
Probably i figured out the problem, compiling the code with the editor i found on the dvd i bought (editor updated 2008) it makes the water laggy, so its clearly a bug of the new editor, when i try to compile and make the exe with the old editor (updated 2003) the water is perfect without any "lag updates"
Rudolpho
20
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 10th Oct 2014 12:45
Probably not; the compiler haven't been changed (to my knowledge at least) and all the editor basically does is piece together your source files into one large source file and then feed that along with some settings to the compiler. (I guess it might also handle #constant replacements and obviously #include statements).
Also what you are talking about is most likely achieved through a shader and not the DBPro code itself.


"Why do programmers get Halloween and Christmas mixed up?"
Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 10th Oct 2014 18:44
yeah i know i dont know if i wrote it on another post but even with the latest editor the water works fine now, i don t understand what i changed to fix it
Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 3rd Feb 2015 18:58
And here we are again, my water is "laggy" again, this happens even if I do not touch at all the water code part, I think there must be something wrong on my pc?

(for who didn't read the previous post, the fps of the game are fine, it runs fast as I have optimized it well, the problem is just the "water update", it updates like 2-3 times per second only regardless the fps of the game)
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 4th Feb 2015 00:18
I do get similar lag in evolved ocean shader sometimes if I haven't rebooted in a while, it also gets very pixelated when this happens, restarting always fixes it for me.

Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 4th Feb 2015 03:08 Edited at: 4th Feb 2015 07:21
Exactly it get pixelated as well, what do you mean about restarting? I don't thing is the PC because I have this problem back again since about 1 month.


Edit: Yes you were right! restarting the pc did fix the problem!
Who knows why it only get fixed by restarting and not switching off and on again

Login to post a reply

Server time is: 2026-07-05 05:54:37
Your offset time is: 2026-07-05 05:54:37