Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: KARMA on June 17, 2004, 05:09:40 pm

Title: why people should start using smoothgroups
Post by: KARMA on June 17, 2004, 05:09:40 pm
well, that's a bit old thing I wanted to post, I reminded it now  thanks to aldo's post, btw I think that many here could find it useful

without smoothgroups
(http://www.3dap.com/hlp/hosted/swfs2/wips/snap197.jpg)
with smoothgroups
(http://www.3dap.com/hlp/hosted/swfs2/wips/snap196.jpg)

this is a mix of smooth and faceted shadings converted with cob2fs2, but you can obtain similar results using PCS and different autofaceted angles.
Why smoothgroups? (I hope you'll understand this despite my english)
smooth shadings are intended to simulate roundness.
Using autofacet you'll apply the smooth only to the gruop of faces with an angle lower than a defined degree to each other (well actually it depend by normals, and I still have to understand if it just affect the amount of roundness or if it dinamically select what faces to smooth and what not depending by the angle).
This means (in theory) that with a smoothing angle lower than 90° a cube will remain a cube with the shadings of a cube and not of a sphere..with autofacet you'll obtain better results than with smooth when generically applyed to the whole model.
Unfourtunately there are many situations where either smooth shadings and autofacet generate weird shadings. This depend usually by the hard edges connected to rounded parts, like in the example I made above.
How to solve this?
in two ways: splitting meshes or using autofacet
splitting the mesh mean to just cut the offending detail and have it as a submodel. All the rounded polys will stay together, without hard edges. Obviously this isn't very efficent in a game model, and it's stupid anyway if you can use smoothgroups.
Smoothgroups mean to give different shadings to different groups of polys. All the connected faces sharing the same shadings (type or angle) will stay together like if they're indipendent, the hard edges will not affect them and the smooth shadings will be as clean as possible.

To make smoothgroups in Truespace:

open the textured model
open the material editor
select a group of faces whith the same texture that you want to use the same shadings
select their texture and the type/angle of shading you want to use and press the paint tool: all those faces will be painted with the selected texture and will be a smoothgroup.
Remember to don't use the same type/angle of shading of the neighbor faces
that's it
Title: why people should start using smoothgroups
Post by: Bobboau on June 17, 2004, 09:39:34 pm
yeah, been saying this a while now
Title: why people should start using smoothgroups
Post by: Omniscaper on June 17, 2004, 10:30:49 pm
Though I agree 100 percent, its all pretty useless the second shine maps come into the picture. The vertex based speculars still reveal faceted polygons on a smooth grouped model part. I've tried many different methods to erradicate the pproblem with the Trek ships (since they heavily use shine maps) but, I've haven't found away around this problem.

I probably spent MANY hours trying to solve my shading issues via smooth groups and auto faceting just to find out that its the shine mapping that causes the aesthetic nasties.

I just recently converted www.xwaupgrade.com's Tie interceptor for personal fun and I found it difficult smoothing it out with shine maps activated. Otherwise, smooth groups works wonders for it as long as shine maps are off.
Title: why people should start using smoothgroups
Post by: Bobboau on June 17, 2004, 10:45:54 pm
it's less visable if you use auto-facet, as the interpolated normals tend to be closer the what would be there
Title: why people should start using smoothgroups
Post by: ShadowPuppet on June 18, 2004, 03:54:16 am
What version of Truespace do you need to do this with?

With TS3.2 you don't seem to have any control over the shading angles etc.

Also, assuming the model has been UV mapped in Lith and imported back into TS, does the material painting have any effect on the UV's ?

I know the benefits of shade groups... use them in Max, and Lightwave a lot ... essential ANYWHERE that you have parts attached to a surface. On other tools, I have been forced to make seperate parts just to get the same effect, duplicating verts so the shading could be different.

Lightwave allows you to set the shading angle for every material, but none of that survives the conversion process. In fact, I can't map in Lightwave and have the thing convert properly. Areas of the mapping seem to end up screwed for no apparant reason, and Lith won't load a model textured with LW7 +

Basically, when I convert, the process is:

Build and apply basic smoothing in LW
Import to Lith to UV map
Export as COB
Open up in TS3.2 to assemble hierarchy and add lights etc for PCS autogen and to ensure correct structure for clean conversion
PCS to build POF

So, if I was to use smooth groups...

1) Does TS 3.2 allow me to do that
2) Does it screw the UV mapping , and if so, how do I get round this
3) Can anyone give me a rough guide to proper use of the material editor in TS 3.2 !!!!! Tried the manual, and it's not really helpful ;)
Title: why people should start using smoothgroups
Post by: KARMA on June 18, 2004, 05:22:13 am
no bob, sorry but you are wrong, I had the same problem of omniscaper with pcs: with the specular effect if you use autofacet at ANY angle you see the edges of the polys, whatever you do. I spent too a lot of time in trying to find a solution, and the ONLY way to fix it is to use smooth shadings (like in the pictures above), which mean to convert with cob2fs2, as I do with all the rounded models I have.
Title: why people should start using smoothgroups
Post by: KARMA on June 18, 2004, 05:25:52 am
@shadow:

don't know if 3.2 support smoothgroups, btw smoothgroups don't affect UV coords, and in theory you could have smoothgroups with the polys using different uvs and probably (not sure) materials.

In the material editor, there should be a little icon for the shadings: continuous press gives you the 3 options: smooth, faceted, autofaceted. Right click on autofaceted will let you set the autofaceted angle
Title: why people should start using smoothgroups
Post by: ShadowPuppet on June 18, 2004, 06:24:12 am
Thanks Karma, I'll check that out. The worry I have over UV's comes when you have to try and apply different materials. If I applied a material set with a smoothing angle 0f, say 87 degrees, and I wanted to set a different angle to another part, it looks like I would have to apply another material to the polygons.

update:

Found the necessary buttons etc. in TS. With the material loaded into the library, I could apply the material using that silly 'roller' icon and it would appear OK. Still not got it 100% but I think I am on the right track
Title: why people should start using smoothgroups
Post by: ShadowPuppet on June 20, 2004, 03:18:20 pm
OK :) cracked it.

When I build the model in Lightwave, each material gets a smoothing angle. The LW rendering is better than TS, so sometimes the results don;t come out as well as expected, and a bit of tweaking is called for.

I simply make a note of the smoothing angle I set for each material.

Next, I import to Lith and texture map as normal.

Once done, I open up the UV mapped model in TS 3.2. I make a BMP copy of the PCX textures so I can view them in TS. TS 3.2 doesn't support PCX.

Open up the material editor and create a new material as normal. Right click on the 'checker' default texture, choose you map. Next, right click on the auto-facet opotion and set the angle as per my smooothing angle in Lightwave. Then, add the material to the library. Finally, choose the 'paint roller' to paint over existing material. This DOES NOT mess the UV co-ords. The material is applied and you can view the smoothing to make sure it looks good enough.

Then, once you are happy that the smoothing doesn't have any nasty bits, and that your smoothing angle is doing what you want it to, and you can carry on with the hierarchy setup and PCS it.

You need to be careful when you plan the model to make this possible. If you want to have 2 smoothing angles on the same texture, forget it. TS 3.2 certainly won't let you. Make sure that you plan your textures to allow for this.

Lastly, if you build using PCS, do not expect the 3D render to show up smoothing errors. IT won't!!! Your model can look perfect in the heavily lit PCS render, and look utterly awful in game. IF you want to check the smoothing, sue the 3D textured view in Modelview. It is a much better approximation of how your ship will look in game.

Thanks to Karma for helping me get to grips with this :D
Title: why people should start using smoothgroups
Post by: Nuke on June 21, 2004, 05:31:31 pm
i personally do most my modeling and uv mapping in truespace 4.2, advanced texture mapping in truespace 6, advanced geometry in max 4. ive yet to figure out how to make smoothing work right. truespace doesnt give many options for it. its fairly easy to apply smoothing in max but when you import back to truespace it tends to loose the smoothing info.

most of my materials use smooth shading, but it rarely works.
Title: why people should start using smoothgroups
Post by: ShadowPuppet on June 22, 2004, 03:17:03 am
The smoothing options in TS3.2 are certainly not as advanced as Max, and I don't think they have added much functionality in later versions.

You can set a smoothing angle for each material, but you cannot set smoothing groups up like you can in max. So, multiple groups of smoothing are not possible on a single material ( I think ). In Max, you can select a group of polygons and make them a smoothing group. In TS, you would have to allocate that as a seperate material.

For smoothing, set the material up to use auto-facet, and then right click the autofacet to get up the smoothing angle dialogue box
Title: why people should start using smoothgroups
Post by: Nuke on June 22, 2004, 03:30:21 am
so using the smooth option wont work? that would explain alot, i use it on everything. i seriously never noticed that angle box before. and i never trusted autofaucet.
Title: why people should start using smoothgroups
Post by: ShadowPuppet on June 22, 2004, 06:51:59 am
From what I understand, smooth will just apply the same level of smoothing to everything....whether it looks good or not! Where you have angles and joins, the effects are bad....

Auto-Facet, if just used on it's own, makes an attempt at working out what angles should be shown, and where things should be smoothed. Left at efault, it's not really much better than 'smotth'. By controlling the angle, you get the results you want.
Title: why people should start using smoothgroups
Post by: KARMA on June 22, 2004, 07:22:05 am
you can have multiple smoothgroups with the same texture in ts6, dunno older versions.
nuke's prob is that pcs can't convert smooth and cob2fs2 can't convert autofacet I think, but this has been said 22.569.692.045 times
Title: why people should start using smoothgroups
Post by: Col. Fishguts on June 22, 2004, 07:28:15 am
Quote
Originally posted by KARMA
you can have multiple smoothgroups with the same texture in ts6, dunno older versions.
nuke's prob is that pcs can't convert smooth and cob2fs2 can't convert autofacet I think, but this has been said 22.569.692.045 times


But it works vice-versa, right ?
(PCS can convert autofaceted models ?)
Title: why people should start using smoothgroups
Post by: KARMA on June 22, 2004, 02:45:16 pm
yeah, pcs use autofacet but not smooth, cob2fs2 (internal converter of modelview) use smooth but not autofacet.
Pcs generate a much better pof file than cob2fs2, but there seem to be some issues with autofacet and the specular effect.
Title: why people should start using smoothgroups
Post by: Nuke on June 22, 2004, 09:08:40 pm
sounds like mod tools are in dire need of upgrading
Title: why people should start using smoothgroups
Post by: Knight Templar on June 23, 2004, 02:11:52 am
mmmmm TIE-Interceptor...
Title: why people should start using smoothgroups
Post by: Bobboau on June 23, 2004, 10:31:35 am
well the PCS source is open, if you want to do some upgradeing there is nothing stopping you
Title: why people should start using smoothgroups
Post by: KARMA on June 23, 2004, 11:59:09 am
you are right bob, but this isn't a minor thing in my opinion.
this is an old shot of the corvette: http://www.3dap.com/hlp/hosted/swfs2/img/corv02.jpg
if you look at the nose it seem faceted, when I used autofacet instead.
And I grant you that if I use smooth+cob2fs2 it is correctly shaded, like this TI: http://www.3dap.com/hlp/hosted/swfs2/img/TI1.jpg
It looks perfectly rounded, and I wasn't able to obtain the same result using pcs+autofacet althought spending many hours on it. This forced me to use cob2fs2 to convert the ties, althought we all know that PCS generate a better pof file.
It is useless to spend all that time and efforts to create a better converter if we can't use it because it cause some graphic flaws....