Jump to content

elcoo

Members
  • Content Count

    31
  • Joined

  • Last visited

Community Reputation

3 Neutral

About elcoo

  • Rank
    Advanced Member

Profile Information

  • Gender
    Not Telling
  1. Unfortunately it doesn't help too much. When developing a game that uses larger worlds (For example: a Flight simulator/Spacesim etc.) than usual indoor scenarios, you will have to see shadows from much farther away. Of course one could simply scale the world down by factor 0.1 or 0.01, but this will result in a loss of precision. So what we need is a option to scale the shadow casting distance. I know this will result in more blurry shadows, but that doesn't matter, as you wouldn't be as close to the shadows as in a FPS.
  2. It's been almost a year since this issue has been reported now. Can we have an update on it?
  3. Yes, a soundmanager might be useful, and is used in many modern games to sort sounds by their importance to the player. Some call that HDR Audio. Still 16 channels seems to small for me. Games like Red Orchestra use up to 128 channels, Battlefield 4 uses 60.
  4. Yes, that's exactly the problem. Sounds that can not be played because of this limit seem to be queued and will be played when a channel gets free because another sound stopped playing.
  5. Hi, I recently discovered that I'm not able to play more than 16 sounds at once. Using SoundDriver::GetCurrent()->GetMaxChannels() Returns 16. I can't imagine that OpenAL or my soundcard (Asus Xonar DX) is limited to 16 channels. 16 sounds at once is insufficient for any moderatly advanced game in my opinion. Every shooter that has a little bit of action going on is going to play far more than 16 sounds at once. Any tips what's wrong here? Is it a fault on my side, is it a bug?
  6. Shadmar, thanks for your example! Unfortunately the problems I described still apply to it. As soon as you enable Multisampling, a visible edge appears arround the foreground objects. And the specular lighting changes with the camera rotation, which it obviously shouldn't do.
  7. I've gotten closer to a solution: //Header: #pragma once #include "Leadwerks.h" using namespace Leadwerks; class App { public: Leadwerks::Window* window; Context* context; World* world; Camera* camera; Camera* camera2; Buffer* mainbuffer; Buffer* foregroundbuffer1; World* world2; Texture* foregroundtexture1; App(); virtual ~App(); virtual bool Start(); virtual bool Loop(); }; //CPP: #include "App.h" using namespace Leadwerks; App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) {} App::~App() { delete world; delete window; } Vec3 camerarotation; #if defined (PLATFORM_WINDOWS) || defined (PLATFORM_MACOS) bool freelookmode=true; #else bool freelookmode=false; #endif bool App::Start() { //Initialize Steamworks (optional) /*if (!Steamworks::Initialize()) { System::Print("Error: Failed to initialize Steam."); return false; }*/ //Create a window window = Leadwerks::Window::Create("spectest"); //Create a context context = Context::Create(window); //Create a world world = World::Create(); //Create a camera camera = Camera::Create(); camera->Move(0,2,-5); camera->SetMultisampleMode(4); //Hide the mouse cursor window->HideMouse(); mainbuffer = Buffer::GetCurrent(); foregroundbuffer1 = Buffer::Create(context->GetWidth(), context->GetHeight(), 2, 0); foregroundtexture1 = Texture::Create(context->GetWidth(), context->GetHeight(), Texture::RGBA, 0, 1, 0); foregroundtexture1->SetFilter(Texture::Smooth); foregroundbuffer1->SetColorTexture(foregroundtexture1); foregroundbuffer1->Disable(); Model* b = Model::Box(); b->SetColor(Vec4(0, 0, 1, 1)); b->SetPosition(Vec3(2, 0, 2)); Light* l = DirectionalLight::Create(); l->SetRotation(Vec3(45, 45, 45)); //Move the mouse to the center of the screen window->SetMousePosition(context->GetWidth()/2,context->GetHeight()/2); world2 = World::Create(); World::SetCurrent(world2); Model::Box()->SetColor(Vec4(1,0,0,1)); camera2 = Camera::Create(); camera2->Move(0, 2, -5); camera2->SetClearColor(Vec4(0,1,0,0)); camera2->SetMultisampleMode(4); l = DirectionalLight::Create(); l->SetRotation(Vec3(45,45,45)); return true; } bool App::Loop() { //Close the window to end the program if (window->Closed()) return false; //Press escape to end freelook mode if (window->KeyHit(Key::Escape)) { if (!freelookmode) return false; freelookmode=false; window->ShowMouse(); } if (freelookmode) { //Keyboard movement float strafe = (window->KeyDown(Key:) - window->KeyDown(Key::A))*Leadwerks::Time::GetSpeed() * 0.05; float move = (window->KeyDown(Key::W) - window->KeyDown(Key::S))*Leadwerks::Time::GetSpeed() * 0.05; camera->Move(strafe,0,move); //Get the mouse movement float sx = context->GetWidth()/2; float sy = context->GetHeight()/2; Vec3 mouseposition = window->GetMousePosition(); float dx = mouseposition.x - sx; float dy = mouseposition.y - sy; //Adjust and set the camera rotation camerarotation.x += dy / 10.0; camerarotation.y += dx / 10.0; camera->SetRotation(camerarotation); //Move the mouse to the center of the screen window->SetMousePosition(sx,sy); } camera2->SetMatrix(camera->GetMatrix()); Leadwerks::Time::Update(); Buffer::SetCurrent(mainbuffer); world->Update(); world->Render(); foregroundbuffer1->Enable(); Buffer::SetCurrent(foregroundbuffer1); world2->Update(); world2->Render(); foregroundbuffer1->Disable(); Buffer::SetCurrent(mainbuffer); context->SetBlendMode(Blend::Alpha); context->DrawImage(foregroundtexture1, 0, 0); context->Sync(false); return true; } As you can see the red Box is always in the foreground now, as it's drawn after the blue box. However you'll notice the edge around the red box which appears when multisampling is enabled. I set the clear color to green so it's more visible. Also theres a problem with specular lighting. For the blue box, everything is ok, but if you take a closer look at the red box, you'll notice the specular light changing with the rotation of the camera. Any tips? Edit: In case it's unclear what I'm aiming for, this is exactly what I need: http://www.leadwerks.com/files/Tutorials/CPP/Rendering_Sky.pdf Unfortunately this Tutorial is LE2 only.
  8. Hi, I was trying to render a background like I was used to from LE 2.5. I basicly have 2 worlds: One main world and one background world. The Background would be rendered first, then the main world directly after it, like this: I set the main camera clear color to transparent, like this: But the clear color doesn't seem to be transparent. The background isn't visible at any point, even if there is not a single object in the main world. What am I doing wrong?
  9. Hi, is it possible to create leadwerks roads from within the game code? I am able to load the road_node.gmf via LoadModel, but I fail to see how to connect those nodes so that they form a surface. Or is it only possible to do so in the sandbox? Thanks in advance!
  10. I got on experimenting with some other stuff in the meantime, but now I'm stuck again with the same problem. Can it really be that there is no way to get the true current position of a body? I worked with physics engines before and I see multiple scenarios were it would be essential to get the real position of a body and not a interpolated one. For example networking, limited movement etc.
  11. Doing some further enquiries I saw that it's possible to use the newton game dynamics commands directly. But how do you get the pointer to the newton objects? As far as I know attributes of the type TBody only are references to the Leadwerks entities. I'm using C++ btw.
  12. Sorry for being so immodest, but no, no it doesn't help a bit
  13. Found a dirty fix for the problem: The force was indeed applied at wrong positions as the physics interpolation wouldn't let me know where the body really is, it just showed me the visualized position. So a friend of mine told me to try and put this line: PositionEntity(p->hullBody,EntityPosition(p->hullBody,1),1); Between UpdateFramework() and RenderFramework(). Even though this call seems redundant and it's dirtier than Woodstock '94, it fixed the problem and my plane flies just like I wanted it too. Might post a vid of it soon. If you got any cleaner fix for this though, let me know EDIT: As I already suspected, this fix causes some other major problems, especially if the Framerate drops or rises. So what I need is a way to get the exact position of the body. Not the position of the mesh, nor the interpolated position of the physical body. I need to get the raw position of the body, the one that is shown to me in wireframe when I activate debugphysics. How can I get this?
  14. Hi Andy, I already am calculating the forces for each important point of the aircraft at the specific positions. This works good for the ruders, but not for the main wings, which have to deal with bigger forces. I think the reason could be, that the point I apply the force at might be somewhat behind the actual position of the body. I have to figure that out with callbacks I guess. Cool video you got there btw.. The flight dynamics look very believable! I'm gonna read through some of your posts, maybe I'll find some useful tips
×
×
  • Create New...