FSIC Messageboard
  Tech Talk
  Smooth shading question - help me! :)

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   Smooth shading question - help me! :)
Sv
Pilot
posted 04-28- 11:31 AM     Click Here to See the Profile for Sv   Click Here to Email Sv     Edit/Delete Message   Reply w/Quote
I am confused, can anyone help me? This would make my life so much better!

How does smooth shading work? From my (small) understanding, doesn't it use some math calculation to vary the light intensity over the surfaces of multiple polygons so as to make the surface look smooth?

And I have also heard that objects that are to be smooth shasded must have ploys that physicaly share their vertecies. For example, if you have a wheel LOD let's say, each adjecent poly of the wheel needs to share its neighboring ploy's verts. If you hve two verts that share the identical coords but are not shared as one vert, the smooth shading will fail, right? I have seem this happen, then I optimize (share) verts and it is fixed!

Is the math of the smooth shading done by the 3d engine? Or is it mapped to the polys like textures? When you click on "smooth shading" in AC3D, WHAT DOES THIS DO? Well I know it makes it look all somoth in the 3D window, BUT WHAT REALLY HAPPENED TO MY OBJECT?

Please, this is what I need to know!

Here is what I cam getting at: can you smooth shade over multiple LODS in SDOE? Can a wing made out of two pieces show a nice smooth shading across the entire wings with no shadow lines? TS said you can do this, and other panes look great, but all my planes suck and show seem lines between LODS

What can I do?

Much thanks for any help you can give me... any insight at all.. thanks!

-Smooth Shady

IP: Logged

mposis
Pilot
posted 04-28- 12:00 PM     Click Here to See the Profile for mposis   Click Here to Email mposis     Edit/Delete Message   Reply w/Quote
Sv,

What I do is merge the the lods together in AC3D ,snap the points, and then optimize vertices. I then cutaway one of the lods and export them. This will make the shading uniform over the 2 lods.

To get rid of the lines between lods you must determine the translates of the lods so that their connecting points are at the same coordinates. I am never able to get the translates perfectly but if they are close enough you won't see the lines. It is better to have an small overlap instead of a gap between the lods.

IP: Logged

Sv
Pilot
posted 04-28- 08:05 PM     Click Here to See the Profile for Sv   Click Here to Email Sv     Edit/Delete Message   Reply w/Quote
THANKS MPOSIS!!!!!!

I will try that!

-Sv

IP: Logged

Bryan Russell
Pilot
posted 04-28- 11:39 PM     Click Here to See the Profile for Bryan Russell   Click Here to Email Bryan Russell     Edit/Delete Message   Reply w/Quote
OK, the simple version of how shading works...

What SDOE uses is called Vertex lighting (lighting and shading are somewhat interchangable), or also gouroud(sp?) shading. Basically, you have a light source pointed in a particular direction, normally defined by a Normal. Also each vertice of the Mesh has a normal, termed a vertex normal to differentiate it from the face normal. (In simple flat shading systems the Face normal is used to light the whole poly with the one intensity. In SDOE it is used more for backface removal and other stuff)

When the lighting pass is done, intensity of the lighting for that particular vertice is assigned based on the relative orientation of the vertex normal and the light source normal. i.e. when the light source and vertex normal are pointing at each other then the intensity is highest, and when they point perpendicular to each other the light intensity if the smallest. Pointing away from each other will produce the sammest value of intensisty as well.

Once all of the vertices have a intensity value assigned, and the rendering of the polygon begins, the intensity of two vertices that make up an edge is interoperlated between each other, and then when each scan line of the polygon is drawn, the intensities along the edges are interoperlated with the corresponding point on the other edge.

It is not nessacery for two co-located vertices to be joined to produce smooth shading, so long as there vert normal point in exactly the same direction. Welding and such may be required for the shading routine of AC3D or MAX to work it out. IMO you can smooth in MAX without welding but the MAX2OBJ plugin upsets the vert normals.

What happens when you click smooth shading in AC3D is that the lighting type may be changed from face lighting, to vertiex lighting. Face lighting gives that faceted look.

Hope that long explanation helps

IP: Logged

Sv
Pilot
posted 04-29- 12:07 AM     Click Here to See the Profile for Sv   Click Here to Email Sv     Edit/Delete Message   Reply w/Quote
Bryan, that is GREAT!

But where and how is a vertex normal stored in the LOD? I know I can see and flip face normals in AC3D, but do you have any idea about vertex normals?

So to make a smooth shaded sphere, all vertex normals must face out perpindicular to the sphere surface?

Face normals are alway perp. to the surface, right? What are vert. normals perp. to? Can a vert. normal point in any direction?

This is a great help, much thanks! I feel I am getting close to knowing the secret

-Sv

IP: Logged

mposis
Pilot
posted 04-29- 04:53 AM     Click Here to See the Profile for mposis   Click Here to Email mposis     Edit/Delete Message   Reply w/Quote
Sv,

Here is a line describing a point in a LOD:
-4.921259880 -10.17099762 0.8044519424 0.0000000000 -1.000000000 0.0000000000 1.000000000 1.000000000

First 3 numbers are the coordinates of the vertex. Next 3 numbers is the vertex normal. Next 2 numbers is the texture coordinate.

IP: Logged

Pachy
Pilot
posted 04-29- 08:12 AM     Click Here to See the Profile for Pachy   Click Here to Email Pachy     Edit/Delete Message   Reply w/Quote
By the way, does anybody know if it is possible to have an object in AC3D that would be mostly shaded but still have a sharp edge. For example how can I have the front part of a wing element appear smooth and the trailing edge with flat shading?

thanks!

IP: Logged

Sv
Pilot
posted 04-29- 08:47 AM     Click Here to See the Profile for Sv   Click Here to Email Sv     Edit/Delete Message   Reply w/Quote
Thanks again mposis,

That clears up more again, how little I know!

So the last question is, how do these vert normals get set in AC3D? Can they be? Or do they fall out from the surface normals?

-Sv

IP: Logged

mposis
Pilot
posted 04-29- 09:08 AM     Click Here to See the Profile for mposis   Click Here to Email mposis     Edit/Delete Message   Reply w/Quote
Pachy,

First explode the wing with a 0 distance.

1.Merge only the polygons of top part then optimize vertex for this object.
2.Merge only the polygons of the bottom part then optimize vertex for this object.
3.Merge the 2 objects but do not optimize vertex then export.

You have to determine which polygons in front of the wing goes with the top part so that the wing looks correct.

Sv,

I think AC3D sets this depending on how the polygon is created. I don't know how you can change this in AC3D.

IP: Logged

Bryan Russell
Pilot
posted 04-29- 07:20 PM     Click Here to See the Profile for Bryan Russell   Click Here to Email Bryan Russell     Edit/Delete Message   Reply w/Quote
SV,

In simple terms, to apply smooth shading to an edge (which is the join between two polygons) you have a vertex which bisects the angle between the two faces. and to make a sharp edge the normals are perpendicular to the faces that make up the edge.


Sharp Edges


Smooth shaded edges (and point)

Of course you never see this, the 3D package does it for you based on other types of input.

[This message has been edited by Bryan Russell (edited 04-29-2000).]

IP: Logged

Sv
Pilot
posted 04-29- 07:53 PM     Click Here to See the Profile for Sv   Click Here to Email Sv     Edit/Delete Message   Reply w/Quote
Thanks again all, and nice diagrams Bryan!

So this is my understanding:

When you smooth shade and object in AC3D, the vertex normals are adjusted to accomplish this. When the LOD is exported via Hippie's plug-in, the vert normals reflect this change.

This is why the AC3D instructions mposis gave me should work:

1. You have the entire right wing as an object. Now you optimize verts, now the verts are shared.

2. Now you SMOOTH SHADE. This step alters the vert normals to shade the object corrrectly

3. Now you cut away the wing tip object. Now you have two objects.

4. Now you export each object as a LOD. They will retain the smooth shading they were assigned when it was one object before, EXACTLY like texture mapping.

Is this right? Is it just like texture mapping then? I can map one big object, now when I split into many LODS, the texture map still works. The key step is the moment I map the texture. Now it is mapped and the mapping travel with the polys (more exact is verts?) So is the key moment for shading when I click the "Smooth shade"?

Much thanks guys, this is SO helpful. If I understand this correctly my planes will be 10 times better, but MAN do I have work to do

-Sv

IP: Logged

mposis
Pilot
posted 04-29- 09:06 PM     Click Here to See the Profile for mposis   Click Here to Email mposis     Edit/Delete Message   Reply w/Quote
Sv,

Yes, if you texture map a big object and cut away polygons from it the texture coordinates does not change on the polygon.
The only time they will change is when you do a remap texture coordinates.

The coordinates, vertex normals, and texture coordinates of the polygons do not change when you cut it from an object.

IP: Logged

Pachy
Pilot
posted 05-09- 03:40 AM     Click Here to See the Profile for Pachy   Click Here to Email Pachy     Edit/Delete Message   Reply w/Quote
OK I've just spent 5 hours in a row struggling with my wings and I've come to the conclusion that you should be careful with the "optimize vertices" function (well, I'm reading again mposis' answer and realize I should have paid more attention to it!). Do not run it if your object contains a sharp edge, like a wing trailing edge.
SV, if you optimise the vertices on a whole wing object in step 1, I think you will run into shading problems.

IP: Logged

Sv
Pilot
posted 05-09- 07:20 AM     Click Here to See the Profile for Sv   Click Here to Email Sv     Edit/Delete Message   Reply w/Quote
Interesting Patchy, but why?

I think this may be the case, I wish I could see vert normals in AC3D!

So sall I try to take the wing apart again, then optimize the top and bottom seperately, then merge, and then export with no vert optimization? Maybe I will try this...

-Sv

IP: Logged

Snickers
Pilot
posted 05-09- 09:50 AM     Click Here to See the Profile for Snickers   Click Here to Email Snickers     Edit/Delete Message   Reply w/Quote
NOw that I have read this, understood some, guessed at some and went huh? at the rest, I like to make the following suggestion:
sv, I think there is enough information here that you could create yet another help page. That way you can explain all of this to common idiots like myself....

I think though Bryan, you have explained to me why the model of the PBY does what it does as far as shading goes. So let me add my thanks to sv's.

------------------
Snickers
=FC=

IP: Logged

Sv
Pilot
posted 05-09- 10:18 AM     Click Here to See the Profile for Sv   Click Here to Email Sv     Edit/Delete Message   Reply w/Quote
This I am planning Snick, but I still am not 100% there. I will try smoothing the MoraneN wings with these ideas. If it works, I will post a detailed page. I don't post anything until I can make it work myself. I think I am getting close, this seems to be a key area and the posts here are awesome, thanks guys!!!

-Sv

IP: Logged

Pachy
Pilot
posted 05-09- 04:48 PM     Click Here to See the Profile for Pachy   Click Here to Email Pachy     Edit/Delete Message   Reply w/Quote
quick note.
If a poly has shading problem try the following:


  1. select the exact vertices of the faulty surface
  2. "surface/cut-away object"
  3. on the new object flip the normals twice. DON'T ASK ME WHY!!!
  4. optimize vertices on the new object
  5. smooth
  6. merge with previous parent object. DON'T optimize vertices anymore!
  7. figure out why the f**k the texture mapping was lost in the process

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | Fighter Squadron Information Center

(This site Copyright (c) 1999 Inertia LLC)

Powered by Infopop www.infopop.com © 2000
Ultimate Bulletin Board 5.45c