
Ma-Shell
Members-
Posts
371 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Ma-Shell
-
Usually at the root of your project folder there is the windows-executable which has the ending ".exe" (e.g. if your project is called "test", this file should be "test.exe"). There should also be a file with the same name but without the extension (e.g. just "test"). This one is the Linux-executable, I guess. You only have to run this one instead of the ".exe".
-
In the Leadwerks-installation-folder there should be a copy of the MyGame-project. You can copy that one to your project-folder.
-
I guess, in step 6 you simply replaced the contents of the "Additional Dependencies"-field by "ws2_32.lib" instead of adding it to the entries that were already there? The field should say: lua51.lib;steam_api.lib;ws2_32.lib;Glu32.lib;OpenGL32.lib;winmm.lib;Psapi.lib;OpenAL32.lib;Leadwerks.lib;%(AdditionalDependencies)
-
I can remember, when in the very beginning of Leadwerks 3.0 everyone wanted GUI-features... I wonder, why nobody put this here. I think, this would be the root of all evil. You would have to check all strings from the code, because you can also load assets by code. Also what about assets that aren't even specified at compile-time? You can dynamically modify those strings, like e.g. in a LOD-system where you would e.g. name one level of a model barrel1.mdl and the other LOD-levels would just increase the number, like barrel2.mdl, barrel3.mdl etc. and the code would just take the model name and increase/decrease the number. This would not even be possible to be detectable.
-
Character Controller Walking on Terrain=Memory Leak
Ma-Shell replied to Haydenmango's topic in Programming
What is the difference between "collectgarbage(collect)" and just "collectgarbage()"? In C++ there is not even an overload of that function that takes a parameter and it isn't documented. You are right, it isn't documented. I found out about it because I usually use C++ for my projects and VisualStudio has the nice Intelli-Sense where it told me, there was a third parameter called "extra" that defaulted to "false".- 15 replies
-
- Character Controller
- Memory Leak
-
(and 2 more)
Tagged with:
-
Character Controller Walking on Terrain=Memory Leak
Ma-Shell replied to Haydenmango's topic in Programming
I just tested this and saw, it happened for me as well. Memory keeps increasing for terrain and for csg-box. I didn't wait to see, if there was a limit. I also noticed, this happens, if you just stand at one position and keep jumping (but not, if you don't do anything). Using self.context:DrawStats with the third parameter set to true, you also see the memory usage split into "script memory usage" and just "memory usage", where the latter one is the one, which keeps increasing, so it doesn't seem to be related to that particular script.- 15 replies
-
- Character Controller
- Memory Leak
-
(and 2 more)
Tagged with:
-
Character Controller Walking on Terrain=Memory Leak
Ma-Shell replied to Haydenmango's topic in Programming
I guess, this could be because, as you move, more parts of the terrain have to be loaded into memory, so maybe some parts that are not visible in the beginning might get into view and have to be loaded into memory (just guessing here, I have no idea, how the terrain is implemented) and maybe the parts don't get released afterwards since keeping them in memory is cheaper than extracting them all over again (still guessing ). I will test tomorrow, if I can confirm the memory-increase on my machine (with standalone version) as well, but if it is as I guessed, this would be a normal behaviour. P.S.: Did I mention, I was only guessing?^^- 15 replies
-
- 1
-
-
- Character Controller
- Memory Leak
-
(and 2 more)
Tagged with:
-
Cannot build, run or debug a level - help!
Ma-Shell replied to karmacomposer's topic in General Discussion
If you created your project as a C++-project, you need to do as tjheldna said (compile it from VS). If it is a LUA-project, it should work out of the box. -
Would it be possible to make objects explode into fragments?
Ma-Shell replied to karmacomposer's topic in Programming
Though this is a nice idea, it would be quite hard, getting it to look like the objects have a real volume (the video looks like it's only a thin sphere-surface). -
Try using the context instead of Buffer:GetCurrent(). As far, as I remember, Context is inherited from Buffer (at least in C++) and your current buffer should usually be the context (as far, as you don't change it). It might be, that the current buffer only gets set somewhere in between App:Start() und App:Loop().
-
I can't remember having trouble with the SDL-library. I guess, those are linker-problems? You have to add "SDL" to the linker-options and add the path to the header-files to the include-directories in the compiler-options. (I am currently not on Linux but if I find the time and you need help with this, I can post a more detailed guide for you)
-
Why do you think, the file has to be at that location? For me the file GLU.h is in the folder from the windows-sdk, so for linux it seems you are missing a package. Did you run the install-script (install.sh)? I think, the missing library should be libglu1-mesa-dev, which you have to install via sudo apt-get install libglu1-mesa-dev If you didn't run the install-script, you should try running that first and only if that doesn't fix it, try the above (as I think, the missing library is a dependency of one of the libraries installed). You can do so by cd-ing to the leadwerks-directory and typing sudo ./install.sh
-
The problem is that in the files Stream.h and BankStream.h (from Leadwerks), EOF is explicitly undefined via #undef EOF because they have a method using this name. Including fstream before leadwerks fixes the problem, since the compiler first has EOF defined, when he reaches fstream and then, when going through the Leadwerks-Includes, it can be undefined. Also because EOF is a compiler-variable, I would prefer this method to the one Michael_J proposed. If you want to use EOF in your own code you will have to define it yourself, though (so you could just do both).
-
Well, Visual Leak Detector is a tool for C++ and memory leaks are C++-only (no problem for LUA) . The problem is, that even in a new LW-C++ project (even if you don't use any LUA-scripts), the LUA-Virtual Machine is started and claims and releases memory. I don't think, there is a way to disable this.
-
Try this: http://www.leadwerks.com/werkspace/page/documentation/_/command-reference/entity/entityinstance-r173
- 5 replies
-
- 1
-
-
- lots of trees
- framerate drop
-
(and 1 more)
Tagged with:
-
Hi, Valgrind isn't available for windows (which I assume you are using because of visual studio ) Visual Leak Detector is a nice piece of software. Sadly you can't really debug for memory leaks with Leadwerks 3, since the LUA-VM will always allocate and free memory. So when trying to use VLD or similar stuff with LW3, you will end up with 1000+ Memory Leaks found anywhere inside the LW-Lib. See http://www.leadwerks.com/werkspace/topic/9505-tons-of-memory-leaks-in-leadwerks/page__hl__leak for details. Actually I figure the only way of really testing for memory leaks is using System::GetMemoryUsage() where you still have to do a lot of analysing . Or does anyone have a better idea?
-
@shadmar Yeah, but what actually is a surface? Just a group of vertices? If so, what separates the vertices from one surface from those in another one? Are those just user-defined groups of vertices? So why would a terrain have multiple surfaces ("surface" is defined as an array of 5 within the terrain-class, so this isn't something simply inherited)?
-
I believe, you have to use the surface. The following doesn't yield NULL: Material* mat = terrain->surface[0]->GetMaterial(); Though I have no idea, what the index is for, maybe this can give you a push to the right direction.
-
How can 3 (THREE) persons work on this project?
-
What exactly is the problem? I can create a Material, activate Z-Sort and switch the Blend mode to Alpha and use the fragment shader you provided above (I also used the vertex shader from the standard diffuse shader and made it fit to the fragment shader.) With this I can get a material which is transparent.
-
You can see, the shader uses fragData0, fragData1 and fragData2. So try adding fragData0.a = round(fragData0.a); fragData1.a = round(fragData1.a); fragData2.a = round(fragData2.a); in the end, just before the closing } @ScrotieFlapWack I don't know whether it is documented anywhere but I also only found the answer via googling, which led me to Rastar's Blog: http://www.leadwerks.com/werkspace/blog/117/entry-1167-up-part-2/ Edit: Also what you are editing is just the alpha value. The code I provided just says: If the alpha value is over 0.5 then set it to 1, else set it to 0.
-
Well, I am not really getting why the above one doesn't work for you but you can just include a threshold in your fragment shader. Just add (after fragData0 was set): if(fragData0.a > 0.5) fragData0.a = 1; else fragData0.a = 0; You can also use a threshold other than 0.5. Edit: What would be even easier: fragData0.a = round(fragData0.a); and if the shader also set fragData1 etc. just add the lines for them as well.
-
Make sure the texture you selected isn't set as being a cubemap, like bfn.tex or the skybox-texture. Try using the Blue/Green/Orange grids from the developer-folder and check whether it works with them. If so, your textures have some weird settings.
-
Thanks, got it working with your bloom.lua. In case anyone else is interested: //Render first image myBuffer->Enable(); world->Render(); myBuffer->Disable(); context->Enable(); context->SetShader(myShader); myBuffer->GetColorTexture()->Bind(1); myBuffer->GetDepthTexture()->Bind(2); context->DrawImage(myBuffer->GetColorTexture(),0,0); The shader will get those by uniform sampler2D texture1; uniform sampler2D texture2; Another question regarding this: The depth-texture will only use the red-channel. The green- and blue-channel will always be 0 and the alpha-channel will always be 1. Storing four values per pixel if actually only one is useful, seems to be kind of a waste of space. Especially on the GPU space is a valuable good. Is there anything I can do to help this?
-
Hi, is it possible to use the depthbuffer for postprocessing effects? I looked at all the existing postprocessing shaders and saw, all of them only use the color-texture, which is retrieved by uniform sampler2D texture1; I also found, that texture2 contains some kind of a cobblestone texture but all the other slots seem to be empty. Also I saw, it is possible to push a Vec4 Uniform to the shader by (C++): myShader->SetVec4("foo", Vec4(0,0, 1, 1)); (GLSL): uniform vec4 foo; but I didn't find any way of pushing an arbitrary texture as a uniform.