I must have done something right. Converting terrain to a planet took all of 2 hours. A couple tweaks to collision works a little bit but likely I'll have to make a decent octree system for collision. I'll worry about that later. For now PLANET!
- Details
- Written by Chris Savoie
- Category: Update
- Hits: 2103
Not sure where to go from here. I'm not 100% about the quad tri system anymore. The T Junctions are starting to concern me a bit. I need to get some more motivation. I'll be studying lighting techniques... since I've never done it before. I haven't really been working on it much lately because I haven't been able to think of what to work on. For some reason I don't think it's quite at the state to apply to a planet. Maybe I just need to do some refactoring. Current list of things that need to be done 'right':
- Culling
- Proper thread based subdivision
- Texturing
- Lighting
- Add Quad/Oct tree for faster collision
- Water
- Clouds
- Atmosphere
- Stars
- Sun
- Foliage
I need to stop complaining about something to do and just do something. For now you just get furry terrain.
At least I know the normals are correct.
- Details
- Written by Chris Savoie
- Category: Update
- Hits: 2179
I guess I should first say why I was losing motivation. I want to have a nice simple triangulation system. Using Quad Triangle tree (each triangle splits into 4 when subdivided) seemed interesting. When using an equilateral triangle all sub triangles keep the same proportions. My only concern initially was the T junctions that were caused. Once I created a simple triangle class that only managed the subdivision I thought the system was complete. The problems came when I tried to subdivide in more that one location. I started getting gaps all over the place (see first picture). I found a few fixes (making sure edges are never more than 2 levels apart) but the problem persisted.
I got my epiphany and narrowed it down to the points. New points are created by interpolating between two existing points. They are not always updated to reflect the proper position. What would happen is that a triangle would be subdivided but it's points would not be updated. Then when triangles further away would tesselate they would cause the points that were used to create a point to update but the child points would remain unchanged. All in all a really weird situation. Since I was already keeping pointer to the two points that were used to create any particular point I simple added some update counters so I could easily tell when a point changes. The one problem I'm not happy with is that whenever a point is requested it has to check if it needs to update. That can always be optimized later though. For now I'm sick and motivated again. I finally have a decent smooth mesh (see second picture).
- Details
- Written by Chris Savoie
- Category: Update
- Hits: 2229
- Details
- Written by Chris Savoie
- Category: Update
- Hits: 2149
It took a lot of thinking to get my head around it but I finally have camera positioned based tesselation. In the end it was simpler than I thought. I used a similar system to my previous post. I simply determine which head triangle my camera position is contained within and subdivide it. Do the same thing recursively. Once I've subdivided to the lowest triangle I do a plane distance check for simple collision. This works great except that the only area of detail is directly under the camera. I tried a simple method to extend the tesselation by spliting neighbours. I split the neighbours up to the same amount of steps away as the current tesselation depth. This works except triangles stopped connecting properly so I simply found another bug in the base triangle class. The bug searching will have to wait until after the weekend though. Here's a pretty nasty shot of the terrain. Once I fix the bug in the triangle class I'll try to make it a bit prettier.
Sorry if this is a little unintelligable (sp?) it's past my bedtime. I'll fix it up later. Or maybe I'll just leave it here as a lesson to go to bed on time.
- Details
- Written by Chris Savoie
- Category: Update
- Hits: 2235
I've been thinking how I can write unit tests for it but the key thing stopping me is being able to come up with complex enough tests and proper test data to compare it to. Most of the bugs I've found have to do with collapsing and rebuilding multiple neighbouring triangles at the same time. Trying to iterate through making sure that all the edges and children are resolving properly sounds like a plan.
Well anyway, here's the exciting bit. Some screenshots of subdivision in action. The first is the basic structure, two head triangles connected to each other. The second show where two rays shot into the mesh cause it to tesselate. It's not amazing at the moment but it's a very important first step. Next step is getting an algorithm together to auto tesselate the mesh based on view position.
- Details
- Written by Chris Savoie
- Category: Update
- Hits: 2040