Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Lynx on March 14, 2004, 05:14:26 am

Title: Freespace lighting
Post by: Lynx on March 14, 2004, 05:14:26 am
There's something with the FS lighting that alwys bugged me about the FS lighting: there are two modes, with or without smooth shading. most round ships look good with and most edgy ships without it, but there's no in-between for ships that have both rounded and edgy parts. Our Hellcat, for examply looks almost perfect without smooth shading, but you can see every poly on the cockpit in it's full ugly edginess; with smooth shading, the cockpit and engine nozzles have good shadows, but the shdows on the rest of the ship look like crap. And one other thing about smooth shading is that you can see the poly lines on flat surfaces(!) - and because of this, the light and shadow patterns look absolutely absurd. I could live with smooth shading as is, but this is most disturbing - it has always been like that, but it has really become obvious with the invention of specular mapping.
It seems really to be a Freespace engine thing - I've seen some ships in at least two other engines (XWA and Freelancer) where such absurdieties with the ligthing either just don't happen or are far less common. Would it be possible to do something to make the shadows look better(I'm not talking about the invention of real time shadows and bullcrap like that, just about trying to make the the smooth shading a bit less extreme and getting rid of the obvios flaws of the FS lighting model). Would that be possible
Title: Freespace lighting
Post by: KARMA on March 14, 2004, 06:14:29 am
althought it is true that fs2/pof/converters don't have the best shadings possible, what you are reporting are problems caused by you doing something wrong
cob2fs2 (or modelview) can use SMOOTH or FACET
pcs can use AUTOFACET or FACET
this mean that if you convert a smoothed object with pcs, it will be faceted, if you convert an autofaceted object with modelview, it will be faceted
Faceted is good for blocky elements, but when faces are not flat (like with rounded elements) you'll see the lighting on a per face basis (you'll see the borders of the polys)
When you have rounded elements you have to go with autofacet in pcs or smooth in modelview
If you have a complex solid object you MUST use smoothgroups, or it will suck.
Smoothgroups means that you don't use the same shadings on the whole object, but you use different autofacet angles in different parts, or you make some parts faceted and others smoothed.
If you are using submodels you'll have less shading problems (which doesn't mean that you have to use submodels)
Don't split you mesh in subobjects untile you are forced to (subobjects' shadings is screwed in fs2)
If you don't want to bother using smoothgroups you'll have the best results by using autofacet on the whole mesh, with an angle around 45-60°
Sometimes, it happened to me, pcs give problems with autofacet: it converted the mesh with a very low angle, no matter what angle I defined, and the result was similar to faceted shadings, I could see the edges of the polys, in this case you'll have to use smooth shadings and modelview.
Title: Freespace lighting
Post by: karajorma on March 14, 2004, 09:07:07 am
Thanks for that Karma. I've never really understood all this talk about smoothing until now :)
Title: Freespace lighting
Post by: Sticks on March 14, 2004, 02:55:47 pm
It's funny that this should get posted just now. I've been working on per-pixel specular lighting vs the per vertex lighting we have now. Take a look at how it looks:

(http://www.theoriginalreggiedecker.com/badlighting.jpg)

Utter garbage. Obviously the model normals are totally forked. Then you have shots like this.

(http://www.theoriginalreggiedecker.com/goodlighting.jpg)

It would seem that coplanar polies have their normals properly converted whereas some others do not. I really don't know. However, this is why env mapping doesn't look quite right and why we're screwed when bumpmapping comes in.
Title: Freespace lighting
Post by: Bobboau on March 14, 2004, 05:09:01 pm
hmmm, goober's gona eat your heart with a spoon :D

anyway as I said in the internal, untill I see this myself (don't supose you'd be willing to post a build) I'm not going to be able to tell what's going on, but I can garentee you the normals are not garbage.
Title: Freespace lighting
Post by: Sticks on March 14, 2004, 06:01:37 pm
Ouch, that sounds painful.

Well, for a few seconds anyway...

I suppose the normals may not be garbage per se, but a lot of them conflict with each other.
Title: Freespace lighting
Post by: KARMA on March 14, 2004, 06:08:16 pm
does the shadings (faceted, autofacet, smoothing) affect those per pixel shadings?
because when using autofacet or smoothing on irregular and complex (with hard edges) groups of polys (like if you use the same shader on the whole model) you often have screwed shadings, which can be fixed by  smoothgroups.
Title: Freespace lighting
Post by: Sticks on March 14, 2004, 06:13:36 pm
Yes they do.

I anticipate that the smoothing flaws in many models will become very evident when this code goes in.
Title: Freespace lighting
Post by: KARMA on March 14, 2004, 06:14:19 pm
ohhh I think I found the problem, Sticks

it is the subobject's shading problem that Aldo and I posted a while back.
For some strange reasons the shadings of all the subobjects except the main polygroup are totally screwed, and in :v: ships this happen even on the main polygroup sometimes.
And this happen on ulysse's lod0 too.
If you open the model in modelview and switch to untextured view (I'm looking at it now), you'll see on the wings the screwed shadings, which have the same shape of the lightning effect in your pic above.
More details and pics about this bug here: http://www.hard-light.net/forums/index.php/topic,20741.0.html

(edit: forgot the link:p)
Title: Freespace lighting
Post by: Sticks on March 14, 2004, 06:34:48 pm
This is going to have to go in the closet for now, cause I got in trouble for posting this. Remind me again after 3.6
Title: Freespace lighting
Post by: KARMA on March 15, 2004, 05:22:34 am
ok, but nonetheless this is an annoying bug that should be fixed, regardless the consequences on what you're working on.

as I said, all the subobjects except the main polygroup have screwed shadings and a good % of the original models have screwed shadings on the main polygroup too.
This generate weird lightning, expecially with specular effects, on turretts and various subobjects of all of our mods.
And if you need your model to have big huge subobjects this is expecially weird
Also it cause wird lightning effects on the whole hull of some of the :v: ships.

You can see this in modelview, it doesn't happen only in game, and it happens with all the ships, :v: ships too, no matter what you used to convert, so it is not a game bug but it is either a POF file bug or a converter bug.
Title: Freespace lighting
Post by: Woolie Wool on March 19, 2004, 02:56:48 pm
Quote
Originally posted by Sticks
It's funny that this should get posted just now. I've been working on per-pixel specular lighting vs the per vertex lighting we have now. Take a look at how it looks:

(http://www.theoriginalreggiedecker.com/badlighting.jpg)

Utter garbage. Obviously the model normals are totally forked. Then you have shots like this.

(http://www.theoriginalreggiedecker.com/goodlighting.jpg)

It would seem that coplanar polies have their normals properly converted whereas some others do not. I really don't know. However, this is why env mapping doesn't look quite right and why we're screwed when bumpmapping comes in.


Then we ought to fix the normals (how hard is it, really?), throw out the vertex lighting, and put in a per-pixel system like current games.
Title: Freespace lighting
Post by: Bobboau on March 19, 2004, 09:39:12 pm
it isn't that simple,  and it seems that this isn't realy as per pixel as Sticks thought, seems like it's just a better interpolation  than normal liniar interpolation would get you.
Title: Freespace lighting
Post by: Sticks on March 19, 2004, 09:56:46 pm
I still contend that the normals aren't correct. However, Bob is partially correct as well. I didn't properly encode the tangent vector into the specular component of the vertex. So, that explains why that looks off. It is indeed, however, per-pixel.

Again though, people have been complaining about the wierd shading for a while now, I this is definately something that I have first on my list for after 3.6
Title: Freespace lighting
Post by: Bobboau on March 19, 2004, 10:23:13 pm
what people? and what 'weird' shadeing?
Title: Freespace lighting
Post by: Sticks on March 19, 2004, 11:05:00 pm
These people.
http://www.hard-light.net/forums/index.php/topic,20741.0.html


The wierd shading that makes Omni's ships look bad. The wierd shading that makes any of the ships look very chunky. Etc.

Everyone I've talked to and shown screenies to has said that even vertex lighting should look better than what we've got, and that I should look into maybe a problem with unwelded vertices or bad normals.
Title: Freespace lighting
Post by: Bobboau on March 19, 2004, 11:08:22 pm
those people are obbsesing over a bug in modelview and  posably incorectly converted models.

I think the issue with omni's ships may have been fixed, I need to ask him though
Title: Freespace lighting
Post by: Sticks on March 19, 2004, 11:10:43 pm
Not necessarily. Those same shading errors occur in game as well.

If you've got a build with that fix, I'd like to try it.
Title: Freespace lighting
Post by: Bobboau on March 19, 2004, 11:14:36 pm
I've never seen anything that seemed in error, they said that subobjects were not getting rendered corectly, that ships with large subobjects look wrong, I have converted the Golgotha, and it looks completly fine, I supose I should post screens
Title: Freespace lighting
Post by: Sticks on March 19, 2004, 11:18:16 pm
Yeah, I'll show you what I mean.
Title: Freespace lighting
Post by: Bobboau on March 19, 2004, 11:36:07 pm
(http://freespace.volitionwatch.com/blackwater/ls1.jpg)
(http://freespace.volitionwatch.com/blackwater/ls2.jpg)
Title: Freespace lighting
Post by: Bobboau on March 19, 2004, 11:38:14 pm
see the side there is all smoothed togeather, now it isn't fully smothed (that would look realy bad on this model) but if it was faceted you'd be able to pick out each poly
Title: Freespace lighting
Post by: Sticks on March 19, 2004, 11:43:21 pm
It's not smoothed at all. Any set of poly's that aren't coplanar you can see the edges of. Bring that model into another game and you'll see what I mean.
Title: Freespace lighting
Post by: Bobboau on March 19, 2004, 11:49:21 pm
those polys arn't coplaner, and you can not see the edges between them (the ones that are within the auto-facet angle)
Title: Freespace lighting
Post by: Bobboau on March 20, 2004, 12:10:56 am
(http://freespace.volitionwatch.com/blackwater/ls3.jpg)
Title: Freespace lighting
Post by: Terawatt_99 on March 20, 2004, 01:48:30 am
secksay! :D:yes:
Title: Freespace lighting
Post by: Nico on March 20, 2004, 05:05:18 am
Quote
Originally posted by Sticks
It's not smoothed at all.  


It is, but the smoothing angle is obviously very low.
Title: Freespace lighting
Post by: Bobboau on March 20, 2004, 03:41:45 pm
:nod:
Title: Freespace lighting
Post by: Taristin on March 20, 2004, 06:04:14 pm
But that's not everyone's complaint, methinks...
Title: Freespace lighting
Post by: Bobboau on March 20, 2004, 06:21:35 pm
that's the only one I'm aware of
Title: Freespace lighting
Post by: Taristin on March 20, 2004, 06:28:28 pm
Well, while you're available... d'ya think you could update your aurora? I wanna see higher poly models with it, and it no workee... :(