Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

171 Neutral

About Knight52

  • Rank
  1. https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcRMWXOg2UVZAWt2o_JkN4mCMY6j2CyszDm8Qhp1cEP4Hvue2G3n">https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcRMWXOg2UVZAWt2o_JkN4mCMY6j2CyszDm8Qhp1cEP4Hvue2G3n The trail of the wisp. What is it called, and how do I implement it with DirectX 9?
  2. Right now I load all model with their hierarchies kept. But it begins to have a performance issue, and I wondering if not keeping the hierarchy will give any obvious performance boost.   also, is there any way to find out if the .X file contains animation or not, before calling D3DXLoadMeshHierarchyFromX?
  3. Knight52

    using a line to pick objects

    Just to be sure, is trapezoid considered a plane? And D3DXPlaneFromPoints which create plane from 3 vectors can be used to create trapezoid?
  4. I have a line on 2d screen. I want to know which 3d objects the line is on. It's a straight line. Anyone knows how to do it?   I'm trying to create a plane out of it and use it to detect the collision. I have calculated 4 points for the plane's corner, but I don't know what should I do next.
  5. Have you tried non-blocking or asynchronous I/O? [/quote] I've created a mutex lock, still doesn't fix the leaks. I've tried WM_TIMER which I understand it's one of asyn io processes, doesn't fix the leak either. So I don't think it's multi-threading resource issue. Here's the some sort of algorithm. Hope this will help. Retrieve info if player is initialized. { separate the player and equipments from resource pool. } Flush the resource pool. This includes Skybox primitives and texture, object's model and animation, terrain, and lights' shadow maps. Open the file if(file == null) { Messagebox ("cannot open file") exit } Load new resources by reading info from the file. if player is initialized { add the player and equipments back to resource pool } else { initialize player and add it to the resource pool } delete file. hide loading screen. release mutex close mutex
  6. I know how bad it is to go multi-threading, but I don't know how else I will load stuff behind the loading screen. No memory leaks when I do single thread, but when I create another thread to handle that same function, I got memory leaks. That function handles some Direct3D loading too. Do I have to release something before exiting the thread?
  7. so that's the problem. Should I create another texture for this swapping?
  8. I swap default render target to shadow map's surface before rendering the map, then swap back when finished, if that's what you mean. you ask why does screen have 4:3 ratio? Isn't it still standard resolution ratio nowaday? I mean I will, at least, try to make this game go public, so shouldn't it at least have 4:3 ratio?
  9. HRESULT result = effect->ValidateTechnique(ShadowTechnique); if(FAILED(result)) {// will generate error -2005530591 D3DERR_CONFLICTINGRENDERSTATE MessageBox(cq->handler(), "Failed validating Shadow Mapping technique", "ERROR", MB_OK); }
  10. say the shadow map is 1024x1024 pixel. If the display window is larger than that (1280x1024), it's fine. If it isn't (800x600), it'll fail the technique validation. Did I miss something?
  11. Is there any way better than flush the instance buffer, per-instance data, and recreate them? I haven't tried this brute force approach yet, so I don't know how much fps it'll reduce.
  12. You mean DrawIndexedPrimitive() or DrawPrimitive(), right? Is there any way I can still draw additional texture specific to each quad? If the performance boost is that good, I'll consider removing that feature anyway. Can you describe what is caching you're talking about?
  13. 1. Terrain. Right now I'm using multiple quad primitives connected to each other. This way I can divide terrain into blocks and each block can have additional texture specific for that block. But I see in some tutorial that they use one indexed primitives to create terrain. How much performance boost should I expect if I choose to change from multiple quad primitives to single primitive? 2. .X model importer. I have the code from this example and modify a bit. It might not be the best, but it does the job. Recently I notice significant fps drop when many models is on the screen (I'm using View Frustum Cull) and I begin to think I need some change. Is there .X model importer I should use instead? 3. Updating the game state. If I choose to create a thread to specifically handle the "main loop update", will that increase some fps? Is there any problem I should expect? 4. Should I call sin/cos/tan/etc function once and store the result instead of calling those functions every time I need to use the result?
  14. Ah never mind. I've fixed that. It had something to do with "ItemSlot slot = *itemslot[j];" or passing 2 or 3 levels pointer. Sorry.
  15. This is a part of the code of character's inventory system. This part will swap two inventory slots (itemslot[j] and highlight). They will swap array of item pointer, number of item in that slot(stack), default slot background and current slot background. It's fine when they swap for the first time, but when trying to swap back, that error occured, right after break; command. I've googled a bit and found out this error has something to do with segment fault or memory leaks, but I have no idea which part of the code that cause this. Can anyone point out? None of these function leads to delete or delete[], btw; for(int i = 0; i< 5; i++) for(int j = 0; j< 5; j++) { if(itemslot[j]->button->Intersects(base)) { ItemSlot slot = *itemslot[j]; itemslot[j]->stack = highlight->stack; itemslot[j]->item = highlight->item; stringstream s, s2; s << itemslot[j]->stack; itemslot[j]->button->SetText(s.str()); itemslot[j]->buttondefaultimage = highlight->buttondefaultimage; highlight->stack = slot.stack; highlight->item = slot.item; s2 << slot.stack; highlight->button->SetText((slot.stack > 0)? s2.str() : ""); highlight->buttondefaultimage = slot.buttondefaultimage; for(int k = 0; k< 3; k++) { Image *img = itemslot[j]->button->GetImage(k); itemslot[j]->button->SetImage(k, highlight->button->GetImage(k)); highlight->button->SetImage(k, img); } highlight = null; break; } }
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!