Jump to content
  • Advertisement

i24021

Member
  • Content Count

    15
  • Joined

  • Last visited

Community Reputation

100 Neutral

About i24021

  • Rank
    Banned
  1. Hi ! I've implemented the geomipmapping algorithm in managed directx but now i need to handle the cracks resulting from adjacent sections with diferent levels of detail. My current implementation relies on a vertex buffer per section and a global array of index buffers representing the different levels of detail. There is 4 possible situations that i need to cope to solve the cracks: - Blend Left - Blend Right - Blend Up - Blend Down * - And some mixed situations beetwen two cases, like for example Up and Left 0--1--2 | /| /| |/ |/ | 3--4--5 | /| /| |/ |/ | 6--7--8 IB = 0, 3, 1, 4, 2, 5, |5|, |3|, 3, 6, 4, 7, 5, 8 I'm using one single triangle strip to draw the sections as illustrated... The index buffer connects the two strips in the figure above using degenerate triangles, created by the addition of |5| and |3|. My problem is how do i build my index buffer for all the blending situations mencioned. I don't even know if this is possible since there is some strange cases like blending down and right that i'm not totally sure... =========LEFT========= 0-----2 0--1--2 0-----2 0-----1--2 | /| | /| /| | /| | /| /| | / | |/ |/ | | / | | / |/ | | / | blend 3--4--5 = | / | | / 4--5 | / | left | /| /| | / | | / / | /| |/ | |/ |/ | |/ | |// |/ | 6-----8 6--7--8 6-----8 6-----7--8 IB = 0, 6, 1, 4, 2, 5, |5|, |4|, 4, 7, 5, 8 Is this right ? ======================= =========RIGHT========= 0--1--2 0-----2 0--1-----2 0-----2 | /| /| | /| | /| /| | /| |/ |/ | | / | |/ | // | | / | 3--4--5 blend | / | = 3--4/ / | | / | | /| /| right | / | | /| / | | / | |/ |/ | |/ | |/ |/ | |/ | 6--7--8 6-----8 6--7-----8 6-----8 IB = ? ====================== =========TOP========== 0-----2 | /| 0-----2 | / | | /| | / | | / | | / | | / | |/ | | / | 6-----8 |/ | 6-----8 blend = top 0-----2 | / | 0--1--2 | // | | /| /| | / / | |/ |/ | |/ / | 3--4--5 3--4--5 | /| /| | /| /| |/ |/ | |/ |/ | 6--7--8 6--7--8 IB = ? ====================== =========DOWN========= 0--1--2 0--1--2 | /| /| | /| /| |/ |/ | |/ |/ | 3--4--5 3--4--5 | / /| | /| /| | / / | |/ |/ | |/ / | 6--7--8 |/ | 6-----8 blend = down 0-----2 | /| 0-----2 | / | | /| | / | | / | | / | | / | |/ | | / | 6-----8 |/ | 6-----8 IB = ? ====================== Tnks for any help [Edited by - i24021 on July 26, 2005 4:18:56 AM]
  2. Quote:Original post by i24021 Quote:Original post by sirob This could be one of 3 problems I think: 1) The texture doesn't tile. If the texture isn't made to fit to itself on the other side, you shouldn't tile it like you are. Make sure the texture tiles correctly - copy it in paintbrush and place a copy on each of the side, make sure you get a smooth fit. 2) Texture coords are not correct. Recheck these, if they are off, your texture won't tile at the correct place, and it won't look good. 3) (this is the most likely)Your normals/lighting isn't smooth. I'm guessing you're using per face normals/lighting. This means, that between two faces, the lighting shifts immediately, causing a visible line, as though the terrain was two surfaces with an angle between them. Either look into vertex normals (recommended) or tone down the lighting contrast to make the differences less visible. Good luck :). Tnks a lot i will check the normals... I've found the bug and as you have said it was in the normals. Many tnks...
  3. i24021

    terrain rendering question

    Well recently i've implemented geomipmapping in C# with managed directx, and what i'm doing is cuting the terrain in sectors and using a vertex buffer per section and one global array of index buffer's each corresponding to a level of detail. I can recommend to you this site http://homepage.mac.com/jhuwaldt/java/3DStuff/GeoMMap/GeoMMap.html with an implementation of geomipmapping in Java and this book : Real-Time 3D Terrain Engines Using C++ and DirectX 9 and Trent's book : Focus On 3D Terrain Programming I plan to post my implementation of geomipmapping to codeproject, but first i need to get rid of the nasty t-junctions in the terrain. Meanwhile i have uploaded a version nearly finished to this location : http://s39.yousendit.com/d.aspx?id=1GK9O2QFF5JQG0OGDAZ1MPL7LS Fell free to grab it :-) It uses quadtree based frustum culling and a version of the geomipmapping algorithm. The code is based on the engine implemented in Realtime Terrain Engines using c++ I have to warn you the t-junctions problem is not resolved... Good Luck ! [Edited by - i24021 on July 20, 2005 8:34:26 AM]
  4. Quote:Original post by sirob This could be one of 3 problems I think: 1) The texture doesn't tile. If the texture isn't made to fit to itself on the other side, you shouldn't tile it like you are. Make sure the texture tiles correctly - copy it in paintbrush and place a copy on each of the side, make sure you get a smooth fit. 2) Texture coords are not correct. Recheck these, if they are off, your texture won't tile at the correct place, and it won't look good. 3) (this is the most likely)Your normals/lighting isn't smooth. I'm guessing you're using per face normals/lighting. This means, that between two faces, the lighting shifts immediately, causing a visible line, as though the terrain was two surfaces with an angle between them. Either look into vertex normals (recommended) or tone down the lighting contrast to make the differences less visible. Good luck :). Tnks a lot i will check the normals...
  5. Hi ! I'm building a terrain engine in C# and managed directx. Recently I have came across a problem that is driving me nuts. When i apply a texture to the terrain it's cleary visible the separation between the sections. How can i avoid this ? It's floating point errors ? I need some kind of blending ? I'm using one indexbuffer, one vertex buffer and triangle strip's in each sector. I have posted an image of the problem to this location : http://img270.imageshack.us/img270/7665/terrain3dt.jpg Tnks for any help
  6. i24021

    DirectX 9 Game books...?

    Quote:Original post by Specchum Introduction to Game Programming With Directx 9 by Frank D. Luna is simply an amazing book to start off with. Very well written and good examples to boot. Highly recommended by me! :) I can only agree with that, for me it's the best one
  7. i24021

    Terrain problem

    Ok i have discovered the problem. I was something related to an older video card that i'm using in my laptop. In my desktop this problem doesn't happen. But know i have a different problem. I can clearly see the separation between sectors, witch is natural when the geomipmapping is turned on (because i have not resolved the T-Junction problem) but not normal when i turn it off. So i have converted the project to VS .NET 2003, stripping some features (mainly a form that permits the configuration of the terrain) and i have uploaded it to this location : http://s50.yousendit.com/d.aspx?id=2PAZK3YO8CBIE1U36PRGO7H2PH A image of the problem can be seen here : http://img350.imageshack.us/img350/9346/terrain2be.jpg I have some controls in the screen to enable or disable geomipmapping and to control frustum culling. The rawfile is loaded and the configuration is done in the EngineHost class in this piece of code : #region Creation /// <summary>Create a new instance of the class</summary> public EngineHost(Framework f) { // Store framework sampleFramework = f; // Create dialogs hud = new Dialog(sampleFramework); ui = new Dialog(sampleFramework); heightMap = new RawHeightmap(@"..\..\curvy256.raw"); worldExtents = new Rect3d(0.0f, 6000.0f, 0.0f, 1500.0f, 0.0f, 6000.0f); shift = 4; } #endregion Tnks for any help. [Edited by - i24021 on July 18, 2005 8:07:28 AM]
  8. Hi ! I'm having a strange problem in my implementation of geomipmapping in managed directx. I'm breaking the terrain in sections, and using quadtree based frustum culling. I have one vertex buffer and multiple index buffer's per section (for the diferent levels of detail). For some reason when diferent colors are applied to diferent sections, a lot of popping is ocurring, my "moutains" even disapeear when i move the camera in certain directions. This only happens when i use different colors for each of the sections, and when i apply lighting. If i use only one color for the grid this doesn't happen. Currently the frustum culling and the geomipmapping algorithm are turned off, and the problem is still ocurring, so i think that this is related somehow with the way i have implemented the division in sectors... Tnks for any help... Ps: I can post or send the source code (it's in Visual Studio 2005 and in C# 2.0 but it's fairly easy to convert to 2003) if requested... [Edited by - i24021 on July 18, 2005 6:23:22 AM]
  9. i24021

    MFC Alternative

    I have the same problem i was trying to do something like the effectedit (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/directxsdk/Tools/Content/EffectEdit.asp) that cames with the directx sdk but i have not find a suitable anwser for that problem. I'm discussing that topic in a begginers thread here : http://www.gamedev.net/community/forums/topic.asp?topic_id=321267 This tool (EffectEdit) is made in MFC...
  10. i24021

    UI in C# with c++ or only c++ ?

    Quote:Original post by abnormal wtf is wrong with you? you know c#, can do UI there, want to learn c++ and you will now start using MFC? sounds like you are going backwards to the stonge age. next thing you want to do is using assembler for everything? there is no need to use 2 languages simultaneously, you will have a lot of troubles passing stuff over. sometimes it can be helpful to write some smaller parts in c++ (libraries, low level hardware access) and call in in c# or the other way around (you have your engine in c++ and write tools in c# because it is faster). but i never heard from anyone coming from c# going to c++ just to use MFC. there must be something wrong here. It's a simple problem, i know that c++ is THE language to program games. So i need to learn c++ and i'm doing it. But now i need to do a GUI to set some properties like for example: use antialising, use anisotropic filtering in what level and so on. I want to see these changes in a panel or something like that with my 3d scene. I want to build something like the EfectEdit utility that cames with directx sdk. There is 4 ways to do that : - Use Managed directx and windows forms (it's easy since i know windows forms programming very well) (Not what i want since using c++ is a requisite) - Use some api in c++ for the GUI and the engine - A mix of the two choices - Implement the controls in directx 9.0 What i want to know is the best way to do it... Tnks in advance
  11. i24021

    UI in C# with c++ or only c++ ?

    Quote:Original post by paulecoyote OP > Any quick and dirty tools you need, you may as well develop in C# as you are already familiar. As for C++ using C#... well that will mean you will need the .Net runtime regardless (obviously). If I were to take that approach (C# for some of the UI), I would go the ActiveX / COM route. C++ should be able to use C# COM / ActiveX controls as it would any other COM control. http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=187 This partition of responsibility between view and business logic would probably actually be pretty useful in terms of a decent design actually. If you are lucky enough to have Visual Studio .Net - I would try and learn the forms designer stuff built in to Visual C++ .Net. http://www.codeproject.com/ has tons of tutorials for C++ and C#. As for graphics libaries, unless you are concerned with cross platform stuff then you may as well just use the MFC (eek) and whatever else is in Visual Studio... as the MSDN has tons of tutorials on how to get stuff done, and the DirectX SDK has loads of UI examples too. As another poster said though, this is probably creating unnecessary headaches for yourself - COM is not an easy subject, though you are already using it if you are using DirectX. It's probably best to just keep to C++ if that's your chosen language. Ok tnks a lot for your help i will try to do everithing in C++ probably with MFC
  12. i24021

    UI in C# with c++ or only c++ ?

    Quote:Original post by Arelius Save yourself the trouble and don't do it, Either do it all in C#, or all in C++... you could ofcourse use the WinForms in Managed C++. Ok, and what is the best gui library in C++ ? It's hard to decide there's a lot of implementations...
  13. Hi i'm starting my way into the wonderfull world of directx 9.0 :-). I have a great experience in c# and java but almost none in c++. I've already decided to learn c++ and i'm making great progress. But before i start my project i was wondering if it's possible to build the external shell of my program with C# (because it's easier to build ui's in windows forms) and the rest with pure c++ with directx 9.0. Maybe inside a panel. I would like to use this shell to configure parameters in my project. I don't know even if this is the best way... I have read that WTL is a good library for windows interfaces and besides i can always use MFC or even to change the settings in the context of the demo using some controls drawn to emulate the tradicional controls in windows... What is the best way to do something like this ? Tnks in advance
  • 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!