Jump to content

Dan

Members
  • Posts

    44
  • Joined

  • Last visited

Everything posted by Dan

  1. I am trying to streamline a function for making character labels. My old routine takes too long because it uses the NVidea tools to create dds files for each image as each entity is created. For a few players, that's fine, but for thousands it can take a long time. I found a way to create an image in Leadwerks using the copy buffer commands, but it is not working for text. I have attached an image that shows how I am currently making the labels and the new way which shows that the letters seem to be there but are not being drawn correctly. Any help would be greatly appreciated because it seems like this should be possible - I'm just not doing the buffers correctly or something. Here is my code: TTexture generateImage(string title, int width, int height) { TBuffer lastBuffer = CurrentBuffer(); static TBuffer buffer = CreateBuffer(width, height, BUFFER_COLOR|BUFFER_DEPTH); SetBuffer(buffer); SetColor(Vec4(1, 0, 0, 0)); // red ClearBuffer(); //SetBlend(BLEND_ALPHA); // when I uncomment this, the text is completely transparent. SetColor(1, 1, 1, 0); DrawText(0, 0, str(title.c_str())); SetBlend(0); // end image generation TTexture image = GetColorBuffer(buffer); SetBuffer(lastBuffer); return image; } In main I call the following: // make label TMesh label = CreatePlane(); TMaterial labelMat = LoadMaterial("media/Icons/Label/blank.mat"); SetFont(LoadFont("media/Fonts/Impact40")); string display1 = "Player 100"; int textWidth = TextWidth(str(display1.c_str())); int textHeight = FontHeight(); TTexture labeltex = generateImage(display1, textWidth, textHeight); SetMaterialTexture ( labelMat, labeltex, 0 ); PaintEntity(label, labelMat); ScaleEntity(label, Vec3(0.25f, 1.0f, 1.0f)); Here is the image in case the last one did not come across.
  2. Thanks. I am trying it now and will let you know if it works. If so, I should be able to just add a global variable to divide all incoming movement and scale info to make things work properly in the new scale. Josh helped out on this as well and pretty much told me it was impossible to have a map the size of mine and have the lighting work properly due to floating point limitations.
  3. Thanks for the advice, but I can't see how this would help. Can you explain a bit further what you mean? If I have the same terrain size and the object is in the same place in the world, how would scaling the object effect shadows on that object? Wouldn't they be worse?
  4. Has anyone came up with a solution to this? Nothing I do seems to change anything. I have a simulation on a large terrain 2048 @8m and so far when the entities on the map are beyond 1000 meters from origin I get the flickering and it looks really bad. Under 500 meters looks great. Between 500 and 1000 meters I start to see some minor flickering, but it's not bad. I've tried making my own directional light and parenting it to the camera with no luck. I've adjusted range, shadow distance and resolution with no luck. I've changed the camera range with no luck. I feel like I'm running out of options. Any help would be great because this is a serious problem for large terrain simulations. I do not want to "hack" it by moving the world around the camera.
  5. Dan

    Memory Usage

    Just to let everyone know, this was resolved. First I updated my engine.dll file and that fixed most of the issue. Then I found that commenting out my HUD completely fixed the rest and I was able to see the garbage collection process working properly. I haven't gone into debugging my HUD script yet, but if I find a specific call that is causing it, I'll post the results.
  6. I'm getting the same thing since upgrading. How did you get rid of it?
  7. Dan

    Memory Usage

    Do you have any ideas as to why the memory is growing even in the rotating cube tutorial? How do I prevent this?
  8. Dan

    Memory Usage

    collectgarbage(collect) does not compile. I don't have that method anywhere. Is there something I need to download?
  9. Dan

    Memory Usage

    I am using LUA on certain objects, but I'm not sure if that would solve anything because I see the memory growth in Leadwerks executables that are loading and texturing primitives. I'll try it though and let you know if it helps.
  10. Dan

    Memory Usage

    I have a simulation game that I've been developing for a while now and I'm at the point of "productizing" it for delivery to the customer. One of the tasks I have is to make sure there are no memory leaks in the software. What I'm currently seeing is that when I open the project in release mode with the latest engine.dll files, I see the Memory Usage static until I call an animate function on an entity. From then on, as long as something is animating, the memory usage continues to grow. When I minimize the application I see a huge amount of garbage collection being done, but it still continues to grow again. I have no errors and the growth is different on different machines. I've tested this on NVidia Quatro FX cards and GForce cards so far and I see growth differently on each system but all grow. I also tested this with the Leadwerks engine.exe spinning cube and it also grows forever. That indicates that it's something in common with all applications like the dll file or something. Got any ideas to why this is happening and what I can do to fix it?
  11. I am a 3D modeler and game developer. I have been using Leadwerks for R&D and production work since October, 2009. I have written code for and developed art pipeline content for a bunch of engines prior to that including Torque. In my opinion Leadwerks is a dream to work with. There are great export utilities for 3DS max and the in game rendering with shadows, lighting, normal and spec is excellent. great support for shaders and particle effects as well that can be tweaked to your heart's content. The sandbox is a must have and LUA scripting rules! Absolutely a dream for pre-vis, effects and entity attributing. Nothing beats the price of the engine and as you can see, the support forums are excellent as well. There is more and more being developed for this engine all the time and major releases come out frequently with no extra cost. They seem to be using CryEngine 3 as a benchmark and many new features closely resemble what you can achieve at a much lower cost. I pitch this engine every chance i get because I believe in what Josh and his team are doing. They really understand where game and simulation development is heading and have years of proven experience behind them. It is more than worth the cost just to explore what you can do with it.
  12. I am trying to make a simple proof of concept and I want to be able to use my modified FPS and Vehicle LUA scripts within a C++ project. Has anyone done this yet and if so what is the call to the LUA script and where does it go?
  13. Just to let you know... I solved this issue by starting a new project and copying in my files. I have no idea why the first project didn't work, but it's fixed now. Has anyone seen Visual Studio corrupt a project file before?
  14. Thanks for your suggestion. I have tried that, and it hangs inside LoadScene() which is hidden inside the .dll so the exact spot where it gets stuck is a mystery, but I do know that it's inside the LoadScene() call. The log only shows that it has loaded some items, but does not show any errors, just what it has loaded up to the point where it gets stuck.
  15. Yeah, sorry about the comment I left in the LoadScene call. That was just there so I wouldn't forget where my test directory was. As for the 2 calls to Graphics(), the first one is there because, as you mentioned I need to call it before any Framewerk commands. And the second is there so that the app title and resolution are set properly according to the XML. The duplicate Graphics() calls works flawlessly on other maps, so I didn't consider it an option here, especially since it's not a rendering issue, and just a loading issue at this point. But I will try to remove the second one and try it again and update you if it helped. Thanks for considering my issue. Does anything else strike you as a possibility?
  16. Hi all, I have a map that crashes when I load it in the following code: #include "Framewerk.h" #include "engine.h" #include <string> #include <map> #include <list> #include "globals.h" #include "RvtXmlDomParser.h" #include "RvtEntity.h" #include "ProcessScene.h" #include "CameraControl.h" #include "UDPSocket.h" int main( int argc, char* argv[] ) { string configFile; ConfigData configData; map<int, RvtEntity*> entities; TTerrain terrain; TCamera camera; TEntity scene; TController player; TBody spectator; Initialize() ; RegisterAbstractPath("externals/Leadwerks Engine SDK"); RegisterAbstractPath("./"); SetAppTitle("init"); Graphics(); leadwerks::Framewerk fw; #ifdef DEBUG fw.SetStats(2); #else fw.SetStats(false); #endif fw.Create(); // Setup Global Objects SetGlobalObject ("world_main", fw.GetMain().GetWorld()); SetGlobalObject ("world_transparency", fw.GetTransparency().GetWorld()); SetGlobalObject ("world_background", fw.GetBackground().GetWorld()); SetGlobalObject ("camera_main", fw.GetMain().GetCamera()); SetGlobalObject ("camera_transparency", fw.GetTransparency().GetCamera()); SetGlobalObject ("camera_background", fw.GetBackground().GetCamera()); TListener listener = CreateListener(fw.GetMain().GetCamera()); SetGlobalObject("listener", listener); // Setup Initial Post Processing FX fw.GetRenderer().SetGodRays(1); fw.GetRenderer().SetHDR(0); fw.GetRenderer().SetSSAO(0); fw.GetRenderer().SetBloom(0); fw.GetRenderer().SetAntialias(0); fw.GetRenderer().SetReflectionRenderComponents(ENTITY_RENDERABLE); fw.GetRenderer().SetNearDOF(0); fw.GetRenderer().SetFarDOF(1); fw.GetRenderer().SetDistanceFog(1); fw.GetRenderer().SetDistanceFogColor( Vec4( 1, 1, 1, .7f ) ); fw.GetRenderer().SetWater(1); fw.GetRenderer().SetCaustics(0); fw.GetRenderer().SetWaterHeight( 3 ); fw.GetRenderer().SetFarDOFRange(Vec2( 2500, 5000 ) ); fw.GetRenderer().SetContrast(1.2); fw.GetRenderer().SetBrightness(1.2); fw.GetRenderer().SetSaturation(1); // Load Skybox fw.GetRenderer().SetSkybox(LoadMaterial("abstract::FullskiesBlueClear0016_2_L.mat")); if (argc > 1) { configFile = argv[1]; } else { configFile = "test.xml"; } initRVT(configFile, configData, entities); SetAppTitle((str)configData.appTitle.c_str()); Graphics(configData.resX, configData.resY); // Setup Collisions Collisions(1, 1, 1); Collisions(1, 2, 1); Collisions(1, 3, 0); Collisions(2, 2, 1); Collisions(2, 3, 0); Collisions(3, 3, 1); scene = LoadScene((str)string("media/Scenes/"/*"externals/Leadwerks Engine SDK/Maps/"*/).append(configData.location).c_str()); But loads successfully in this code: #include "Framewerk.h" int main(int argc, char** argv) { Initialize(); RegisterAbstractPath("../externals/Leadwerks Engine SDK"); RegisterAbstractPath("./"); Graphics(1024,768); leadwerks::Framewerk fw; fw.Create(); // Setup Global Objects SetGlobalObject ("world_main", fw.GetMain ().GetWorld ()); SetGlobalObject ("world_transparency", fw.GetTransparency ().GetWorld ()); SetGlobalObject ("world_background", fw.GetBackground ().GetWorld ()); SetGlobalObject ("camera_main", fw.GetMain ().GetCamera ()); SetGlobalObject ("camera_transparency", fw.GetTransparency ().GetCamera ()); SetGlobalObject ("camera_background", fw.GetBackground ().GetCamera ()); TListener listener= CreateListener(fw.GetMain ().GetCamera ()); SetGlobalObject("listener", listener); // Setup Initial Post Processing FX fw.GetRenderer().SetGodRays(1); fw.GetRenderer().SetHDR(0); fw.GetRenderer().SetSSAO(0); fw.GetRenderer().SetBloom(0); fw.GetRenderer().SetAntialias(1); fw.GetRenderer().SetReflectionRenderComponents(ENTITY_RENDERABLE); fw.GetRenderer().SetNearDOF(0); fw.GetRenderer().SetFarDOF(1); fw.GetRenderer().SetDistanceFog(1); fw.GetRenderer().SetDistanceFogColor( Vec4( 1, 1, 1, .7f ) ); fw.GetRenderer().SetWater(0); //fw.GetRenderer().SetCaustics(0); //fw.GetRenderer().SetWaterHeight( 3 ); fw.GetRenderer().SetFarDOFRange(Vec2( 2500, 5000 ) ); fw.GetRenderer().SetContrast(1.2); fw.GetRenderer().SetBrightness(1.2); fw.GetRenderer().SetSaturation(1); // Load Skybox fw.GetRenderer().SetSkybox(LoadMaterial("abstract::FullskiesBlueClear0016_2_L.mat")); // Setup On Screen Stats Info fw.SetStats(2); // Setup Collisions Collisions(1, 1, 1); Collisions(1, 2, 1); Collisions(1, 3, 0); Collisions(2, 2, 1); Collisions(2, 3, 0); Collisions(3, 3, 1); LoadScene("media/Scenes/UAC_Range.sbx"); Both point to the same sbx, that's not the issue, it hangs during, or just after, having loaded some of the textures on the models. But like I said, it doesn't hang in the second code block. Any suggestions as to why it won't load in the first example? I'm out of ideas =/
  17. Dan

    Decals

    Thanks!!! That worked.
  18. Dan

    Decals

    I am trying to finalize my FPS shooter additions in the editor and I am having a problem with decals. The decals are being applied correctly, but as each additional decal appears on a model, the material starts get a rainbow-like sheen to it. It appears that it has something to to with the Modulate 2X setting, because when I change it, it goes away. But...I like the effect of the default bullet hole decal so I would like to use it. has anyone experiences this issue before? Is another shader causing this effect? Any help would be appreciated. Below is the script that I'm using and I'm applying the default decal from the editor. decal=CreateDecal(pick.surface,TFormPoint(pick.position,nil,pick.entity),1.0/32,64) if decal~=nil then decal:SetParent(pick.entity,0) decal:Paint(material_bulletDecal) decal:SetColorf(1.0,1.0,1.0,1) end
  19. Dan

    Vehicle Wheels

    I pretty much figured this out. I now have several vehicles working with wheels spinning nicely. Even an eight wheeled one and it's pretty cool. It was very easy to set up once I got the hang of the lua scripting. Eight wheel independent suspension and all wheel drive effect looks really good in game and feels very realistic. The trick was setting up the wheel file correctly and phy files. I am still confused why some of my wheels didn't work though. In fact, with one wheel, when I applied it to the body, it was invisible, but it acted like it was there. I could drag the wheel from the library to the scene and everything was perfect, it just didn't want to show up on the vehicle. As far as body collision, I don't think that is an issue. They seem to spin just fine even if they overlap the collision box of the body object - just in case though I did make sure that there was clearance between the body and wheels.
  20. Dan

    Vehicle Wheels

    Just to add some more clarification here... when I load in a sample vehicle such as the viperscout and load the driver script, all is well. When I change the model to one that I have created, it looks like the wheels want to move, but they are being blocked by something. Could this be a collision issue with the body object?
  21. Dan

    Vehicle Wheels

    I've been playing around with vehicles in the editor today. I made two new four wheel vehicles and made sure that the pivot points were centered on the wheel and the wheels at 0,0. I can get the new vehicles and wheels loaded in the editor and they look and work great, but the wheels do not spin. If I swap the wheels to use the monster truck wheels, they spin fine. If I use mine, they don't spin. I've tried using different .phy files ( cylinder, convex hull, collision tree) and no change. I can drop the wheels in the world by themselves and they will roll down a hill. Any ideas?
×
×
  • Create New...