|
Help reduce polygons...
About Truespace Archives
These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.
They are retained here for archive purposes only.
Help reduce polygons... // New Users
Post by kena // Jan 26, 2007, 8:37pm
kena
Total Posts: 2321
|
How can I reduce the number of polygons and just leave the squares? The way I did this is I used Teragen to generate a terrain map. I then loaded it into Truespace 7.11 and I used the point edit tool to remove the diagonals. This only took 12 days, and I was wondering if there was an easier way. I tried reducing polygons, but just ended up with a mess. |
Post by splinters // Jan 26, 2007, 10:08pm
splinters
Total Posts: 4148
|
Not sure if it will help here but if you use a boolean subtract on two objects that are not touching it removes triangulation but this may only be if the model was native to tS. Either way can't hurt. Just place a cube or any other primitive into your scene but make sure it is not touching any other mesh. Choose your terrain>click object subtract> click on the cube.
Good luck. |
Post by kena // Jan 27, 2007, 8:38am
kena
Total Posts: 2321
|
Good Idea, but I already got that far... Sorry I didn't mention it in my first post. Here is an example of what happens when you do that. Note that it DOES reduce the polygon count a bit, but it still leaves a lot of angle vertexs. I want to know if there is a way to reduce by just the angled portions. as seen in the first post.
Edit: the finished "world" has 30,274 Ver and 29,792 Faces... much smaller than the starting point, it just took a very long time to get to that point. |
Post by parva // Jan 27, 2007, 9:10am
parva
Total Posts: 822
|
You can just try if Terragen export in a format without triangles (don't know if lwo can do that). Detriangulation can destroy, like you see, the mesh very fast. But why do you want quads? For landscapes it isn't bad and the render engine triangulate any way. |
Post by ProfessorKhaos // Jan 27, 2007, 9:16am
ProfessorKhaos
Total Posts: 622
|
The angled portions remain after the boolean subtract because the resulting squares would be non-planar otherwise. 3 vertices always result in a planar surface. 4+ vertices can be but don't necessarily guarantee it. I think you're seeing diagonals remain on the non-planar squares. Without the diagonal, it gets tougher for the surface to be interpreted properly anyway. |
Post by RichLevy // Jan 27, 2007, 10:32am
RichLevy
Total Posts: 1140
|
in ts 7.1 there is a poly reduction tool on the Player side that should work very nicely on your mesh. It will not remove the triangulation (it will triangulate the mesh) but it does a decent job reducing the poly count of a mesh like this...
sorry I do not have a screen grab to show you the location of it.
rich |
Post by kena // Jan 27, 2007, 4:08pm
kena
Total Posts: 2321
|
I know the Polygon reduction tool very well. I use it on DFX objects all the time, it just doesn’t work very well on THIS type of object.
Using the reduction tool caused the rolling hills to become sharp peaks and messed up the UV mapping quite a bit. It works great on “solid” objects, but this is essentially a morphed plane.
I don’t really mind the reduction to nothing in the flat areas. The reason for wanting to get rid of the extra? I’ve been working with Truespace since version 3, and reduction of polygons has always been the way I do things. Note that I managed to go from 80,000 to just under 30,000 without compromising the final render as long as I use the smooth texturing rather than the auto-facet. It allows for faster rendering and allows me to put objects with a greater poly-count since this object is now lower.
I was just hoping that there was a way to do it without having to select vertices manually, as that is a very long process. Something to save time. |
Post by TheWickedWitchOfTheWeb // Jan 27, 2007, 4:18pm
TheWickedWitchOfTheWeb
Total Posts: 858
|
If the native tools aren't doing it for you then you could use the Un-tessellate plugin which is part of the Polytools suite. It's purpose is to turn tris to quads.
check it out here: http://ckgamefactory.hp.infoseek.co.jp/tsxe/polytool.html |
Post by kena // Jan 27, 2007, 4:41pm
kena
Total Posts: 2321
|
That looks promising... It looks like it would be worth the $20 for just that one function. I can only hope it works in version 7 like advertised in version 6. |
Post by TheWickedWitchOfTheWeb // Jan 27, 2007, 5:09pm
TheWickedWitchOfTheWeb
Total Posts: 858
|
The whole suite is more than worth it. Look at the Lambo - I'd never have made that without them. I'm using them in 7 and they work just fine.
Hope that's of some help. |
Post by Tiles // Jan 27, 2007, 11:24pm
Tiles
Total Posts: 1037
|
Untesselate never worked for me at imported Terragen LWO Objects. No clue why. Maybe because it is not a solid. And also tends to crash TS when trying to untesselate the whole mesh at once.
Another option is to grab the greyscale picture from Terragen. Then use the Displaceatplace Plugin from the Cool Powers 2 suite to create your terrain from this image. Here you can choose between quads and tris. Displaceatplace makes a solid object, cube based. But no big problem to separate the landscape part then.
Another benefit: LWO export has a minimum size. 16k Vertices is the smallest possible one. By using Displaceatplace you can go much smaller by simply resizing the greyscale picture you use as the source.
CP can be found here: http://freecp.sourceforge.net/ |
Post by TomG // Jan 29, 2007, 8:23am
TomG
Total Posts: 3397
|
There is an easier way, the "non-touching boolean subtract" method. A forum search will uncover the longer posts, here it is in brief.
1. Load the object you want to detriangulate / reduce polys on
2. Create a cube, make sure it is not touching your object in any way
3. Select your object.
4. Choose Boolean Subtract. Right click and ensure "Delete Edges" is enabled. This will remove all non-vital edges.
5. Click on your cube.
And that's it. All non-vital edges will be removed from your object. Note that any edges left, including triangulation, are necessary! To render correctly, a face must be flat. If any of the vertices making up that face are not in a plane with the others (non-coplanar), then the renderer cannot determine correctly what direction points on that face are pointing in, and you will get odd artefacts, "tears", unusually lit surfaces etc.
So quite how many edges get removed depends on that. The ones that are left do need to be there to avoid errors (this is why so many objects are triangulated, because with 3 points all the points mathematically must be on the same plane).
HTH!
Tom |
Post by Bobbins // Jan 29, 2007, 8:37am
Bobbins
Total Posts: 506
|
Tom,
That was already suggested quite early on in this thread. It removed some, but not all of the tris - we presume because the quads would become non-planar as a result. |
Post by TomG // Jan 29, 2007, 2:40pm
TomG
Total Posts: 3397
|
Hmm post was caused by the irritating forum habit of displaying the page with just one post on it, the original, when there is another whole page of replies. I would expect it to work the other way round - displays a whole page of replies, until it gets to the latest where there might be just one post.
Anyway, it looked like there had been no answer, just the original post, hence my posting.
If the tris are left, then they are indeed vital, it means that the quad that they belong to would be non-coplanar, hence it can't be used. Many landscape generators do this of course, they work with triangles as it gives that bit more "resolution" to the mesh (they aren't confined to having to have four points in the same plane and can move all the vertices to whatever required height for the terrain).
I quite like the alternative suggestion of making the mesh directly in tS using one of the plugins that read greyscale values and turn them into height on the geometry, in that case.
HTH!
Tom |
Post by kena // Jan 29, 2007, 3:30pm
kena
Total Posts: 2321
|
Thanks Tiles… It didn’t work on a converted dxf format. I imported to Truespace, saved as a cob, and tried the Untellelate. It did not work.
<sigh> back to doing all of the ones I don’t want manually.
Leaving the triangulated edges on a tall height is a good thing, but for a rolling hill, it really isn’t necessary.
And thanks to you also TomG. I know you wanted to help.
EDIT: shoot Cool Powers loads just fine in TS7, but every time I do a boolean subtract, it crashed sht program.. I guess I will try TS 6 and see if it works better there. |
Post by ProfessorKhaos // Jan 29, 2007, 4:59pm
ProfessorKhaos
Total Posts: 622
|
Perhaps it may be an overall benefit to perform a smooth quad divide followed by a simplify mesh operation. Not entirely intuitive at first glance.
Kinda a case of "one step back, two steps forward". The "simplify" operation is capable of removing plenty of faces. The trick is keeping them in the areas of higher definition. Smooth quad divide may give you more control over detail loss in subtle areas while not interfering much with the simplification of generally flat areas.
Worth a shot anyway. Final result may not represent a grid and there will be a few triangles in there but it might get your face count down a bit overall. |
Post by Tiles // Jan 29, 2007, 11:00pm
Tiles
Total Posts: 1037
|
EDIT: shoot Cool Powers loads just fine in TS7, but every time I do a boolean subtract, it crashed sht program.. I guess I will try TS 6 and see if it works better there.
Boolean crash isn't the fault of Cool Powers. Boolean is always problematic at big meshes ;)
Why bool at all? It's just 5 faces more when you leave it solid.
Ah, wait, there was something with the geometry when i remember correct. Haven't used it for a pretty while ...
Have a closer look at the lower bottom loop. You may notice that the outer edge doesn't fit exactly. Displaceatplace makes fun here, offsetting the edge a bit. Which causes wrong geometry. Well, you could manually fix this.
Do the following: Create your landscape with Displaceatplace. SAVE. Create a cube. Move it offset so that it doesn't overlap. Do a boolean substract. This removes lots of edges*. SAVE. Now look at the wrong geometry parts at the bottom, and fix those four corners :)
*Or is that the problematic part? Bool to remove the not needed edges and faces? In this case first fix the wrong geometry part. Is of course a bit more work than with the cleaned mesh. Makes no trouble to me though. But i use TS 6.6 ...
Now it should even be possible to bool without a crash, just in case that you still want to bool parts away. Dependand of how you bool of course. As told, Boolean is sometimes problematic. Never even try to bool when vertices, faces or edges has the same location. Chances are very big that it will not work then :) |
Post by kena // Jan 30, 2007, 5:34am
kena
Total Posts: 2321
|
Do the following: Create your landscape with Displaceatplace. SAVE. Create a cube. Move it offset so that it doesn't overlap. Do a boolean substract. This removes lots of edges*. SAVE. Now look at the wrong geometry parts at the bottom, and fix those four corners :)
Yes, that is exactly where it crashes Truespace 7. works OK in 6.6 though, so I concider my original question answered, and can port form 6 to 7 when I want to add all those extra things 7 has.
Thank you all. |
Post by Tiles // Jan 30, 2007, 7:48am
Tiles
Total Posts: 1037
|
Well, the modeler part of TS7 is a bit ... umn ... i went back to TS66 for good reason ;) |
Post by ProfessorKhaos // Jan 30, 2007, 8:53am
ProfessorKhaos
Total Posts: 622
|
There may be a way to reduce some of the polygons via script in tS7 but it won't be every diagonal that gets removed.
The key would be to make non-planar squares planar again. You won't be able to do this against every square because it's impossible with any decently varying terrain. You could however alternate rows of squares and triangles, which would reduce your diagonals by about 40% at a minimum. Possibly more if you have a large number of adjacent polys that already lie in the same plane.
3 vertices in a square defines the new plane, the 4th is adjusted in height until it falls in the same plane. An easy way to do this is by the following equation
Assume pt1, pt2, pt3, and pt4 where pt2 is diagonally opposite of the pt4 to be calculated
pt4.height = pt1.height - pt2.height + pt3.height (only valid for a regular grid)
Afraid it won't give you the total solution you want, but it's a step in that direction. |
|