Good and Bad news
Good news: Have an algorithm that generates a texture based on position info. Once I create a nice function to procedurally generate height, also based on position info, I can use the same function to generate the texture that will be seen from high up and seemlessly blend into the tiled terrain. Atleast that's the plan.
Bad news: That damn seam. Not sure why but for some reason the edges seem to be wrapping by one pixel. I've outputed the generated textures to file and they are fine so the problem isn't there. I'm too tired to figure it out now.
- Details
- Written by Chris Savoie
- Category: Update
- Hits: 2560
Minor Update
Quick update. I've made converted the plasma heightmap generation to work with on a sphere. I've set it up so it creates 4 textures, one per quadrant (as seen on the bottom of the screenshot). It's mapped in a wierd way that skews it a bit but it seems to look fine from space.
Bonus: In the edges you can see the patching at work. It's really easy to determing which patch to use, I can just test each edge and shift a bit up and add it to result and the final number is simply the index of the index buffer to use. (e.g. if edge 2 is at a lower level I just use index buffer 2, if 1 and 2 are lower I use buffer 3).
- Details
- Written by Chris Savoie
- Category: Update
- Hits: 2471
Patched Up Planet
Quick update. I converted the planet to use the planet patches. It still looks really with absolutely no subdivisions. The first two images show the planet in medium quality (9 vertices per edge) and second two are at the highest quality (129 vertices per edge). The new system handles 524288 triangles with ease (131072 for planet, same for atmosphere and the second pass rendering of edges). Since the data stays on the card it's very optimal. I can probably pump it up a lot and it won't hitch. The other great thing is that this system is extremly fast at setting up the structure, the overall triangle structure is easier to deal with since I don't have to deal with situations where where a triangle is subdivided but it's points aren't updated yet.One issue that you can notice a bit in the second picture is that the new system don't distribute the triangles as evenly around a sphere and the old system did. I'm not very worried about that since it shouldn't matter once the patches are subdivided a bit.
Update: First win: I did some stress testing of the new patches. It seems to be almost 20% faster!! Before I could get just under 80 million Triangles per second and that was with one draw call per 131072 triangles. Now I'm getting around 95 million triangles and that's with around 32 draw calls per planet, each draw call is limited to 16384 triangles (max patch resolution). I do the testing by adding planets until the framerate begins to drop below 60 so these are the number of triangles while maintaining 60FPS, also they are textured, I haven't been able to figure out why it's rendering black.
Second win: Since the triangle hierarchy is a lot shallower the generation time for the triangles is incresed probably atleast a thousand fold. Before it would take around 10 minutes to generate a planet with a resolution of 131072 triangles. To do the same doesn't even affect framerate anymore.
Third win: The code is amazingly simpler. Before I had cases where a triangle's point may not all be updated which could cause cracking and I had to take a lot of special care to make sure everything subdivided smoothly. Now I just have to worry that no patch is more than 1 level of subdivision different than it's neighbours.
Finally: I was also able to see the cost of the atmoshperic shader. I can keep 60FPS at max resolution using 3 textured planets (1.5 million triangles total). At max resolution the proper planet and it's atmosphere will drop the framerate down to 30fps (1 million triangles). This approximately says that the Vertex shader I'm using is 3 times as expensive as the fixed pipeline (1.5mil at 60fps = 3 mil at 30fps) which actually doesn't sound that bad now that I think about it.
Quick picture description: First two are the planet at medium resolution (9x9x9), second two are at max resolution (128x128x128), The last two are the stress test, first without the shader, second with it.
- Details
- Written by Chris Savoie
- Category: Update
- Hits: 2437
Triangle Patches
So I've created a nice triangle patching system similar to the patches used in geomipmapping. By my calculations they are slightly less efficient since each vertex list will have duplicate edges along the edges. Also stripping won't be as easy. The good news is that overall I should be able achieve the same level of detail as geomipmapping with overall less triangles since I only have to subdivide half as much as a time. In the first picture you can see the patch, which is not very interesting itself but in thefollwing images you can see how it can sit side by side with neighbour paths of lower detail. This is good because I can have 7 static index buffers per detail level. The other big win by moving to patches is that I can generate the vertex buffer once and leave it on the video card wich will be a lot faster than the previous ROAM-like implementation. Enough talking, have some pictures:- Details
- Written by Chris Savoie
- Category: Update
- Hits: 2442