Author Topic: Freespace lighting  (Read 4115 times)

0 Members and 1 Guest are viewing this topic.

Offline Lynx

  • 211
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
Give a man fire and he'll be warm for a day, but set fire to him and he'll be warm for the rest of his life.

 

Offline KARMA

  • Darth Hutt
  • 211
    • http://members.fortunecity.com/aranbanjo
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.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Thanks for that Karma. I've never really understood all this talk about smoothing until now :)
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 

Offline Sticks

  • 29
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:



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



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.
"Napalm is good as a quickfire solution, literally..." -- cngn

"Shh... [Kazan's] schizophrenia allows him to multitask." -- Goober5000

Why am I still coding at 12:35am?

SCP: Templum sanctus ingeniosus

  

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
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.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Sticks

  • 29
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.
"Napalm is good as a quickfire solution, literally..." -- cngn

"Shh... [Kazan's] schizophrenia allows him to multitask." -- Goober5000

Why am I still coding at 12:35am?

SCP: Templum sanctus ingeniosus

 

Offline KARMA

  • Darth Hutt
  • 211
    • http://members.fortunecity.com/aranbanjo
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.
« Last Edit: March 14, 2004, 06:15:11 pm by 433 »

 

Offline Sticks

  • 29
Yes they do.

I anticipate that the smoothing flaws in many models will become very evident when this code goes in.
"Napalm is good as a quickfire solution, literally..." -- cngn

"Shh... [Kazan's] schizophrenia allows him to multitask." -- Goober5000

Why am I still coding at 12:35am?

SCP: Templum sanctus ingeniosus

 

Offline KARMA

  • Darth Hutt
  • 211
    • http://members.fortunecity.com/aranbanjo
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)
« Last Edit: March 14, 2004, 06:17:16 pm by 433 »

 

Offline Sticks

  • 29
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
"Napalm is good as a quickfire solution, literally..." -- cngn

"Shh... [Kazan's] schizophrenia allows him to multitask." -- Goober5000

Why am I still coding at 12:35am?

SCP: Templum sanctus ingeniosus

 

Offline KARMA

  • Darth Hutt
  • 211
    • http://members.fortunecity.com/aranbanjo
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.

 

Offline Woolie Wool

  • 211
  • Fire main batteries
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:



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



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.
16:46   Quanto   ****, a mosquito somehow managed to bite the side of my palm
16:46   Quanto   it itches like hell
16:46   Woolie   !8ball does Quanto have malaria
16:46   BotenAnna   Woolie: The outlook is good.
16:47   Quanto   D:

"did they use anesthetic when they removed your sense of humor or did you have to weep and struggle like a tiny baby"
--General Battuta

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
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.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Sticks

  • 29
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
"Napalm is good as a quickfire solution, literally..." -- cngn

"Shh... [Kazan's] schizophrenia allows him to multitask." -- Goober5000

Why am I still coding at 12:35am?

SCP: Templum sanctus ingeniosus

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
what people? and what 'weird' shadeing?
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Sticks

  • 29
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.
"Napalm is good as a quickfire solution, literally..." -- cngn

"Shh... [Kazan's] schizophrenia allows him to multitask." -- Goober5000

Why am I still coding at 12:35am?

SCP: Templum sanctus ingeniosus

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
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
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Sticks

  • 29
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.
"Napalm is good as a quickfire solution, literally..." -- cngn

"Shh... [Kazan's] schizophrenia allows him to multitask." -- Goober5000

Why am I still coding at 12:35am?

SCP: Templum sanctus ingeniosus

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
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
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Sticks

  • 29
Yeah, I'll show you what I mean.
"Napalm is good as a quickfire solution, literally..." -- cngn

"Shh... [Kazan's] schizophrenia allows him to multitask." -- Goober5000

Why am I still coding at 12:35am?

SCP: Templum sanctus ingeniosus