Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Woolie Wool on January 29, 2008, 07:20:57 pm

Title: Blinn-Phong shading in FSO?
Post by: Woolie Wool on January 29, 2008, 07:20:57 pm
http://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model

Would it be feasible to use a more sophisticated shading model in FreeSpace? Gouraud shading was perfectly adequate in FS retail, but I find that it often leads to odd results with specular lighting. Would this require an entirely different lighting  system or could we drop the Blinn-Phong model in place of Gouraud?
Title: Re: Blinn-Phong shading in FSO?
Post by: taylor on January 29, 2008, 09:02:16 pm
From the second sentence of the linked article:

Quote
Blinn-Phong is the default shading model used in OpenGL and Direct3D's fixed-function pipeline.
Title: Re: Blinn-Phong shading in FSO?
Post by: Woolie Wool on January 29, 2008, 09:23:04 pm
The behavior of the specular highlights on the borders of polygons reminds me strongly of Gouraud shading for some reason. Is this just because many models are so low-poly that a good-looking highlight is impossible?
Title: Re: Blinn-Phong shading in FSO?
Post by: taylor on January 29, 2008, 09:32:23 pm
Pretty much.  And some models just have issues anyway that work to hinder lighting quality.  But there is also the issue that the default specular exponent is not what I personally prefer, but what other people wanted since it better matched the D3D code effect wise.  You can play around with that using the -ogl_spec cmdline option, which may help improve the specular highlight effects for you (to some extent anyway).
Title: Re: Blinn-Phong shading in FSO?
Post by: wolf on January 30, 2008, 06:43:55 am
The behavior of the specular highlights on the borders of polygons reminds me strongly of Gouraud shading for some reason. Is this just because many models are so low-poly that a good-looking highlight is impossible?
That's because of per-vertex lighting. What you want is per-pixel lighting, and it's being used in glsl builds. For the main light only, though.
Title: Re: Blinn-Phong shading in FSO?
Post by: Woolie Wool on January 30, 2008, 09:35:55 am
Which builds are those? Unstable branch?
Title: Re: Blinn-Phong shading in FSO?
Post by: taylor on January 30, 2008, 11:49:27 am
Which builds are those? Unstable branch?
My Xt builds, the ones with normal mapping support.
Title: Re: Blinn-Phong shading in FSO?
Post by: Admiral_Stones on January 30, 2008, 11:58:04 am
Looking at the Wiki, I've never thought there are so many maths behind shadering.
Title: Re: Blinn-Phong shading in FSO?
Post by: Koth on January 30, 2008, 01:41:27 pm
Computer graphics are nothing more than visualized math.
Title: Re: Blinn-Phong shading in FSO?
Post by: Flipside on January 30, 2008, 02:52:54 pm
I read that as Bling shading, thought it must some kind of really heavy environment mapping shader or the like :nervous:
Title: Re: Blinn-Phong shading in FSO?
Post by: Admiral_Stones on January 31, 2008, 11:14:37 am
Phlame me if you wantm but I don't view a real difference between the three pics. A more obvious/larger example, maybe?
Title: Re: Blinn-Phong shading in FSO?
Post by: Turambar on January 31, 2008, 02:14:03 pm
the difference was in the highlights and they way they look in comparison with each other.

compare that to the standard fs2 shading method and you'll see a real difference.
Title: Re: Blinn-Phong shading in FSO?
Post by: Woolie Wool on January 31, 2008, 08:26:00 pm
http://en.wikipedia.org/wiki/Gouraud_shading <--This is the standard FS2 method. Compare it with the above examples.
Title: Re: Blinn-Phong shading in FSO?
Post by: blackhole on January 31, 2008, 11:14:04 pm
(http://i25.tinypic.com/2ywba82.jpg)
Title: Re: Blinn-Phong shading in FSO?
Post by: Woolie Wool on February 01, 2008, 10:30:17 am
I'm using the XT build on a GeForce 8800 and mine doesn't look that good...is there a newer XT build than 10/28?
Title: Re: Blinn-Phong shading in FSO?
Post by: Admiral_Stones on February 01, 2008, 01:44:52 pm
http://en.wikipedia.org/wiki/Gouraud_shading <--This is the standard FS2 method. Compare it with the above examples.

That was published in 1971?

Did they use like 10 University Mainframes to calculate that for a sphere?  :wtf:?
Title: Re: Blinn-Phong shading in FSO?
Post by: Woolie Wool on February 01, 2008, 03:04:42 pm
Full-on Phong shading (not Blinn-Phong) was invented in 1973, and it wasn't feasible for computer games until very recently. A lot of stuff is developed for CGI rendering and trickles down to games.
Title: Re: Blinn-Phong shading in FSO?
Post by: Admiral_Stones on February 01, 2008, 03:18:27 pm
Back in 1973, I don't think they had CGI already.
Title: Re: Blinn-Phong shading in FSO?
Post by: Nuke on February 01, 2008, 04:18:41 pm
phong did do a computer rendering of a vw beetle back in 'the 70s i think. with their computing power it probibly took a few months to render.
Title: Re: Blinn-Phong shading in FSO?
Post by: Admiral_Stones on February 01, 2008, 04:29:12 pm
And how did he model it  :wtf:?
Title: Re: Blinn-Phong shading in FSO?
Post by: blackhole on February 01, 2008, 05:19:17 pm
This entire conversation is irrelevant.

Taylor's Xt builds use custom pixel and vertex shaders. That means that none of those methods are used. It doesn't matter what FS2's default shading technique is, because we aren't freaking using it.

Thank you.
Title: Re: Blinn-Phong shading in FSO?
Post by: Cobra on February 01, 2008, 05:42:46 pm
Then how the hell did you get that kind of quality in the screenshot? Or is that a doctored picture? :P
Title: Re: Blinn-Phong shading in FSO?
Post by: IceFire on February 02, 2008, 12:07:03 am
Then how the hell did you get that kind of quality in the screenshot? Or is that a doctored picture? :P
Umm...thats the latest builds with bump mapping.  Still a work in progress.
Title: Re: Blinn-Phong shading in FSO?
Post by: Bobboau on February 05, 2008, 01:22:47 am
And how did he model it  :wtf:?

probably useing mathematical primitives, the older CG software was more oriented around that than polygons. so you'd have a sphere + a box - a come, **** like that, it required a lot less memory and that was the bottle neck back then. if you doubt the competency of 1970s CG watch Tron, the fx for that WAS done on graphics software of the day. it was the bleeding crying edge of it, but it was done on a computer.