Jump to content

Ma-Shell

Members
  • Posts

    371
  • Joined

  • Last visited

Everything posted by Ma-Shell

  1. To get you started: use a blue material (mode alpha) and some simple fragment-shader like this: #version 400 //Uniforms uniform sampler2D texture0; uniform vec4 materialcolordiffuse; uniform float currenttime; //Inputs in vec4 ex_color; in vec2 texcoords0; in float clipdistance0; //Outputs out vec4 fragData0; void main() { //Clip plane discard if (clipdistance0>0.0) discard; fragData0 = ex_color * materialcolordiffuse; fragData0.rgb += .2*sin(tan(texcoords0.y-currenttime*.008)*10)+.25; fragData0.a = .5; } This does in fact look horrible. You will need some (maybe even a lot of) fine-tuning of the parameters, but it should give you an impression, how to create that flickering look.
  2. [App.h]: Buffer* mybuffer; Buffer* mainbuffer; Texture* mytexture; Texture* mydepthtexture; [App.cpp, App::Start after context = Context::Create(window);] mainbuffer = Buffer::GetCurrent(); mybuffer = Buffer::Create(context->GetWidth(), context->GetHeight(), 2, 0); mytexture = Texture::Create(context->GetWidth(), context->GetHeight(),Texture::RGBA,0,1,0); mydepthtexture = Texture::Create(context->GetWidth(), context->GetHeight(), Texture::Depth, 0, 1, 0); mytexture->SetFilter(Texture::Smooth); mybuffer->SetColorTexture(foregroundtexture1); mybuffer->SetDepthTexture(foregrounddepthtexture1); mybuffer->Disable(); [when rendering (normally in App::Loop())] world->Update(); Buffer::SetCurrent(mybuffer); mybuffer->Enable(); world->Render(); mybuffer->Disable(); Buffer::SetCurrent(mainbuffer);
  3. I assume, what you want is the following (where s is the source): ALint i; alGetSourcei(((Leadwerks::OpenALChannel*)s->channel)->source, AL_SAMPLE_OFFSET, &i); printf("%i\n", i);
  4. Which OpenAL-function are you talking about? If Leadwerks doesn't provide it, you can directly call it. See the following example: Sound* snd = Sound::Load("Sound\\Footsteps\\concrete1.wav"); Source * s = Source::Create(); s->SetSound(snd); s->SetLoopMode(true); s->Play(); if (alIsSource(((Leadwerks::OpenALChannel*)s->channel)->source) == AL_TRUE) printf("Source TRUE\n\n"); if (alIsBuffer(((Leadwerks::OpenALSound*)s->sound)->buffer) == AL_TRUE) printf("Buffer TRUE\n\n"); alSourceStop(((Leadwerks::OpenALChannel*)s->channel)->source); As you can see, you can get the OpenAL-source and OpenAL-buffer as demonstrated. If you need any other OpenAL-ids, I would be glad to show you, how you can retrieve them.
  5. Also for the record, here you can see, what happened to the option you are missing: http://www.leadwerks.com/werkspace/blog/1/entry-1439-cleaning-up-physics-shapes/
  6. Just get a script that does copies and formats your disk at system boot... Have you tried creating a new user on your pc and executing leadwerks from this new user? Also, when executing tasklist with the parameter "/V", does it say, the state of the processes is "Running"? EDIT: Bonus: get the parent process of the leadwerks-processes by issuing: wmic process where (processid=7276) get parentprocessid (change the pid with your current values and find the result in tasklist)
  7. You are missing context->Sync(false) right between the render call and the return of the loop. This call is important, as everything is only rendered to the backbuffer and the buffer is never switched to become front-buffer
  8. For me this works: function Script:UpdateWorld() if window:KeyHit(Key.Space) then System:Print("foobar") end end So the space-key is working...
  9. Hi, are the missing models imported meshes or are they brushes (i.e. simple forms created in the editor, like boxes, spheres, etc)? In the latter case, it is important to know, that they get collapsed, so that they are only one model, which has several advantages with respect to performance. You can prevent them from being collapsed by either giving them a mass =/= 0 or by assigning a script (just a dummy one is enough).
  10. Or you right-click and choose "properties" -> "local data" -> "check game-data for errors" (the actual texts might differ from those I wrote here, because I had to translate them from my native language). By doing this, you don't have to download everything all over again.
  11. Hi, for the window, "window->whnd" should do the trick. For the context you will need a typecast: "((OpenGL4Context*) context)->hrc"
  12. Actually, it's not only the physics, since I get a lot more fps, if I don't create them at all (~80), but disabling the simulation for these bodies increases the fps from like 1 frame every 30 seconds to like 30 FPS, which is still massive. Also, I noticed, if I delete the phy-file, I also have to wait ~20 seconds after the scene has loaded, before the fps stabilize. The whole code I inserted into App::Start(): Model* m; for (int n = 0; n < 20000; n++) { m = Model::Load("Models/Trees/pine01.mdl"); m->SetPosition(n, 0, 0); NewtonBodyDisableSimulation(((NewtonDynamicsBody*)m->body)->body); m->Hide(); } (You can re-enable physics by calling "NewtonBodyEnableSimulation" with the same parameter.) Is something like this possible in LUA?
  13. In C++ you can get access to a few more functions for manipulating physics by casting m->body (best look at the definition of NewtonDynmaicsBody in Newton.h): ((NewtonDynamicsBody*)m->body) Furthermore, you can access the NewtonBody-structure which is used internally for all the Newton-functions by doing: ((NewtonDynamicsBody*)m->body)->body You can then proceed to call any function from the Newton by using this body. Sadly, I have no idea, whether you can do something like this on LUA. However, I don't think that the problem lies in the physics, since if I remove the file "pine01.phy", there is no physics-model, as can be seen by issuing camera->SetDebugPhysicsMode(true); in App::Start(). The FPS are bad in that case, nevertheless... EDIT: By "all the Newton-functions", I meant those: http://newtondynamics.com/wiki/index.php5?title=API_Database Also notice, that you won't see an effect for some, as they get overwritten by Leadwerks in the world-update (I guess). EDIT2: It IS in fact the physics. You can call NewtonBodyDisableSimulation(((NewtonDynamicsBody*)m->body)->body); Doing this with 20000 trees will give me a solid 30 fps on my i5 2500 and gtx970. Withouth that line, I get like no frames at all... However, even after the scene has loaded, it takes a few seconds (~20) before the fps stabilize.
  14. Thx, shadmar, for this example. For this to run, you will nevertheless have to modify some parts of your vertex-shader, so that the "in"s and "out"s match. That's not true. You just have to set the same shader in the Material-Settings in the Shaders-tab as the Shadow-shader, then it will have a shadow. This is the advantage of shadow maps: The shadows are generated from the depth-buffers of the generated fragments, so that is after the fragment-shader (and since the fragment-shader is run for the newly generated gemoetry, as well, they can cast shadows as well).
  15. For placing the turrets, you should multiply their positions with their widths. This means, you should differentiate between grid-coordinates and world-coordinates. So, say your turrets are 10 leadwerks-units wide, then your grid-point (0,1) would correspond to world-coordinates (0,10). The grid-point (9,8) would correspond to the world-coordinates (90,80), etc. This also means, when you are in the process of placing the turret, you should derive their grid-coordinates from world-coordinates by dividing the world-coordinate by the width, while rounding down, i.e., the world-point (94,83) would belong to the grid-point (9,8) and therefore the turret would be placed at (90,80). I hope, you can see, what I'm trying to say.
  16. Hi, as far, as I remember, the downloader for the standalone version remembered the key (which was written to a log/config file in the same folder), so if you still have the downloader on your main pc, it should be there. However, I don't know, if the servers are still online, because Leadwerks moved to Steam and the standalone is not getting any updates anymore (see http://www.leadwerks.com/werkspace/blog/1/entry-1379-full-steam-ahead/). The Blogpost also says, you should send an email to support. Did you use the email-address shown on the link? Don't worry, you will get the Standard-DLC as well.
  17. You should note, however, that the hardcoded ids are found in the compiled assembly-code and won't stop someone who is slightly experienced in binary editing.
  18. This is most likely due to one of the Macros in that line not being defined. You would have to search the headers for the definitions of those macros (most likely WINMAPI, MMRESULT, or WINAPI) and include those files and hope that they do not have additional requirements. Since this is a part of DirectX (DirectInput), you will most likely have problems with this, nevertheless.
  19. This is really amazing. How does this scale with lighting and physics? I would assume that there is not much overhead involved in the lighting calculations, which should be basically independent from the number of objects. However, the physics for all the trees at once would be a major problem. Do you have any tests or thoughts on this subject?
  20. Woah, that's impressive! On what hardware do you get the 130 fps?
  21. I tried that but this doesn't work. As soon as leadwerks.h is included, you can't prevent the LUA-Interpreter to be started. Even if you exit right in the first line of the main-function the tools for detecting memory leaks will tell you that there are allocated chunks everywhere. There seems to be something statically initialized. In the template code, there is no line which starts the interpreter (only one that connects it) and you can only disconnect it but never destroy it.
  22. I don't think, this is possible... I tried to get rid of LUA a few times, since it is driving me nuts that I can't really check my games for memory leaks because the LUA-interpreter allocates and disallocates memory randomly (see e.g. this thread: http://www.leadwerks.com/werkspace/topic/9505-tons-of-memory-leaks-in-leadwerks/). Also, if you don't use LUA, this is only wasting performance and memory, so I would absolutely love to see the possibility to turn off LUA (/ to not turn it on in first place).
  23. Just follow the link "API Reference" above... (direct link: http://www.leadwerks.com/werkspace/page/documentation/_/api-reference/)
  24. That's a real shame. Blender's user interface is very well thought through. (Also, this statement makes me wonder, why you wanted this Blender plugin, if you seem to despise Blender.)
×
×
  • Create New...