Haydenmango Posted October 18, 2014 Share Posted October 18, 2014 ClearPostEffects() doesn't seem to delete post effects from my memory but it does detach the current post effects from my camera. I made a video to show more - https://www.youtube.com/watch?v=YCPt3fP4A6M&feature=youtu.be Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
macklebee Posted October 19, 2014 Share Posted October 19, 2014 Ive noticed that with other things like just loading models then releasing them in older versions. i havent tried in more recent versions though. But I saw the same results in game as well as the editor - adding something raised the memory but removing them did not lower it. Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
tjheldna Posted October 19, 2014 Share Posted October 19, 2014 Just tested my project and like you can confirm memory usage does not go down when using ClearPostEffects(). Link to comment Share on other sites More sharing options...
Josh Posted October 19, 2014 Share Posted October 19, 2014 I don't see any reason it would. The code release the effect when effects are cleared. If the shader is loaded somewhere else, it won't get deleted, but otherwise there's no reason it would not. The log file will indicate when items are being deleted from memory and it should say something like "deleting shader "posteffects\FXAA,shader",,, Lua games are not that great at instant memory testing. You would have to be calling collect() continuously to get a more precise reading. If it's a scripted effect it is possible the script itself might not be cleaning up after itself. That would be my suispicion. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Haydenmango Posted October 19, 2014 Author Share Posted October 19, 2014 I found this bug by checking my log file after play testing Hunt For Food. The fog shader is loaded when it rains and it should delete when it stops raining but after I checked my log I noticed that it wasn't being deleted and I just had a bunch of fog shaders being loaded everytime it started raining. I checked over the shaders and the fog shader is loaded through a script but the fxaa and contrast shaders are not. Which means that this happens regardless of the shader being loaded through a script. Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
Josh Posted October 19, 2014 Share Posted October 19, 2014 No, I mean that some effects are shaders and some more complex effects are actually script files. Script effects can create extra buffers and stuff and it is possible the programmer did not free something in the detach function. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Haydenmango Posted October 19, 2014 Author Share Posted October 19, 2014 I see, that is a bummer because these shaders are to complicated for me to figure out what could be wrong. Guess I will have to disable them for now. Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
Josh Posted October 19, 2014 Share Posted October 19, 2014 Shaders cannot have that problem. My guess is it's just the Lua garbage collector not collecting yet. Honestly, even if it is leaking right now I wouldn't worry about it. I mean, 2 kb of memory lost each time the player changes settings isn't realistically going to hurt anything. If there is a bug it will get fixed, in the meantime it's not worth changing code over. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
tjheldna Posted October 19, 2014 Share Posted October 19, 2014 I'm using Shadmar's effect class where the shaders are created via a lua script. I'll take a look at it when I have a minute. Link to comment Share on other sites More sharing options...
Haydenmango Posted October 20, 2014 Author Share Posted October 20, 2014 My guess is it's just the Lua garbage collector not collecting yet. You were correct, I placed collectgarbage() in my App Loop and everything cleans up. Testing memory usage is tricky with Lua. Check out my game Rogue Snowboarding- https://haydenmango.itch.io/roguesnowboarding Link to comment Share on other sites More sharing options...
Josh Posted October 20, 2014 Share Posted October 20, 2014 Now just don't leave it there! 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts