Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Dragon on February 17, 2010, 01:21:08 pm

Title: Cockpit glass issue on mediavps ships
Post by: Dragon on February 17, 2010, 01:21:08 pm
I have been trying to enable cockpits in BP: AoA and ran into a problem when testing them on Erynies.
(http://img40.imageshack.us/img40/460/screen1215.th.png) (http://img40.imageshack.us/i/screen1215.png/)
It looks like the glass suddenly become visible on both sides instead of just outside, it did not happened when I enabled cockpits some time ago and played many campaigns with them.
It seems that it's also similar to the problem described here: http://www.hard-light.net/forums/index.php?topic=58443.0
AoA did not altered Erynies model in any way, nor it's textures.
I had experienced this problem on Steve-o's fighters several times before (this time XA on versions, in all ther incarnations, including originals, BP versions and my own reskins), so this may be either a common model issue or a code problem.
I've tested it on 3.6.10 build, the issue presisted.
So far, I confirmed it on Ulysses, Ursa, Herc II and Erynies, using only empty mission and mediavps.
If I made a wrong choice when chosing the board to post it on, feel free to move it where it belongs.
Title: Re: Cockpit glass issue on mediavps ships
Post by: Cobra on February 17, 2010, 01:42:42 pm
Yeah, the background gets reflected on the inside of the cockpits as well now. I personally have no idea what causes it.
Title: Re: Cockpit glass issue on mediavps ships
Post by: Colonol Dekker on February 17, 2010, 01:50:39 pm
Well at a guess i'd say somewhere, there's an environment map for the Erinyes glass.
 
Might be worth checking.
Title: Re: Cockpit glass issue on mediavps ships
Post by: Zacam on February 17, 2010, 03:51:17 pm
gold-glass.dds does have a -shine map for use on the outside. Always has.
Title: Re: Cockpit glass issue on mediavps ships
Post by: Dragon on February 17, 2010, 04:43:14 pm
Yes, and that was not a problem.
Erynies is an usefull example, as it shows that entire glass showed up, not just the shine map.
With the solid orange plate blocking the entire view regardless of ship's position it's fairly obvious.
Is there any chance to get it fixed?
Title: Re: Cockpit glass issue on mediavps ships
Post by: Zacam on February 17, 2010, 05:18:12 pm
Uhh. Again, the same texture is there that has been there since at least 3.6.8.
Title: Re: Cockpit glass issue on mediavps ships
Post by: Colonol Dekker on February 17, 2010, 05:20:06 pm
Shine and environment are different though aren't they?  :confused:
Title: Re: Cockpit glass issue on mediavps ships
Post by: Zacam on February 17, 2010, 05:21:45 pm
ENV is based off the -shine and requires -spec in use to use.
Title: Re: Cockpit glass issue on mediavps ships
Post by: Droid803 on February 17, 2010, 09:02:52 pm
I don't think it's a MVPs issue, but rather a change in the way the engine renders things.
This started surfacing along with 3.6.10. In 3.6.9, one-faced planes would only show up on the correct one side, but for whatever reason, after 3.6.10, it gets rendered on both sides. So now we have reflections on the inside, and the older versions of Steve-O's fighters (with the solid cockpit) becomes solid, where I never had that issue before 3.6.10.
Title: Re: Cockpit glass issue on mediavps ships
Post by: Zacam on February 17, 2010, 11:57:09 pm
I wonder what it does under fixed render pipeline then.

As it might (though I could be wrong here) be related to the way the shader system is doing things.
Title: Re: Cockpit glass issue on mediavps ships
Post by: Dragon on February 18, 2010, 08:02:28 am
This started surfacing along with 3.6.10. In 3.6.9, one-faced planes would only show up on the correct one side, but for whatever reason, after 3.6.10, it gets rendered on both sides.
Would that be possible to revert that change?
It makes usage of cockpits practically impossible.
Title: Re: Cockpit glass issue on mediavps ships
Post by: Woolie Wool on February 18, 2010, 08:47:37 am
I used a hack for Wings that gets around this, taking a version of the model with the "invisible" texture for the glass and using it as an external cockpit POF.
Title: Re: Cockpit glass issue on mediavps ships
Post by: Fury on February 18, 2010, 08:59:18 am
That's an ugly hack we shouldn't need. Is source of the problem in fs2_open? If yes, this topic probably needs to be moved there.
Title: Re: Cockpit glass issue on mediavps ships
Post by: Dragon on February 18, 2010, 09:26:42 am
I used a hack for Wings that gets around this, taking a version of the model with the "invisible" texture for the glass and using it as an external cockpit POF.
I also wanted to use that, but the rest of the team decided that it would be better to fix the problem than to get around it.
And yes, it's an FS2_Open problem, seemingly dating back to 3.6.10 nightlies, in which it started to appear.
I guess that moving it may get attention of the coders, who should be fixing such issues now.
Title: Re: Cockpit glass issue on mediavps ships
Post by: Kolgena on February 18, 2010, 10:54:53 am
Try turning down your launcher flags dealing with spec. A lot.

I think it was -spec_static. I used to have solid mirror canopies on all my fighters because of a spec_static of like 3. Not sure if it'll help in your case, but it's worth a shot.
Title: Re: Cockpit glass issue on mediavps ships
Post by: chief1983 on February 18, 2010, 03:33:38 pm
How is there any reflection at all?  Is the inside of the glass mapped somehow?  If it's not mapped it shouldn't be showing up.  If it is mapped and has some sort of shine applied to it, it's going to reflect.  Maybe the maps were always broken and the engine fixed something so that they reflect as they should now?  Just throwing some thoughts out there.
Title: Re: Cockpit glass issue on mediavps ships
Post by: Dragon on February 18, 2010, 04:56:21 pm
Is the inside of the glass mapped somehow?  If it's not mapped it shouldn't be showing up. 
I think that it isn't mapped, so it should not show up, jet it does.
That's why I'm asking SCP to fix that.
Title: Re: Cockpit glass issue on mediavps ships
Post by: FUBAR-BDHR on February 18, 2010, 05:41:02 pm
Just tore apart  the Ery from the MVPs.  Absolutely no inward facing normals on the polys that make up the cockpit glass.  Don't appear to be any on the helmet visor (which the eye point may or may not be inside) either. 
Title: Re: Cockpit glass issue on mediavps ships
Post by: chief1983 on February 18, 2010, 05:54:39 pm
I wonder if the specular effect itself is visible from both sides of a surface.  Not as if it was mapped from the inside, but the effect generated on the outside via the specular shader.  That'd be odd indeed, wouldn't it?  But perhaps someone made this change specifically for glass surfaces.  Does this happen with GLSL disabled?  I'm curious if it's a shader issue.  Even still, it could be a bug in the GLSL code itself and not the shader.
Title: Re: Cockpit glass issue on mediavps ships
Post by: FUBAR-BDHR on February 18, 2010, 06:03:08 pm
Well I know you can see reflections on the glass from the inside.  For most things it's kind of cool but for things like maneuvering thrusters it's not quite so much a feature.  You can't see the thruster itself but you can see the glow it causes so there might just be something to that. 
Title: Re: Cockpit glass issue on mediavps ships
Post by: Nuke on February 19, 2010, 06:47:14 am
any way to force a texture to use a particular cubemap instead of the one the game generates? then we could pre-render a cubemap for use with that texture give it something like texturename-cube.dds. would be useful for cockpits and hanger bays where the outside world is invisible. maybe somehow do a composite with the outside map so you can have transparent areas where the outside shines through.
Title: Re: Cockpit glass issue on mediavps ships
Post by: Herra Tohtori on February 19, 2010, 06:59:03 am
I don't know if this is related in any way, but I just had a very interesting episode with skyboxes where if both sides of the cube's faces were mapped, the result was that the apparent brightness of the maps doubled, since apparently the engine rendered the textures twice and with additive blending it doubled the pixel values... :nervous:

htsb-new.7z (http://www.mediafire.com/?1ozouzyzzqm) (this model suffers from the issue)
htsb-newer.7z (http://www.mediafire.com/?jonqjenmny0) (this model has it solved...)
Title: Re: Cockpit glass issue on mediavps ships
Post by: Cobra on February 19, 2010, 09:40:23 am
Isn't the cockpit glass mapped on both sides already when a model calls for the "invisible" texture? Or have I completely missed that discussion already?
Title: Re: Cockpit glass issue on mediavps ships
Post by: Zacam on February 19, 2010, 11:41:21 am
cubemap.dds is already a pregenerated map for use in F3.

For the ksybox, I believe a static cubemap can be made for each one, but I 'm not sure on the details.
Title: Re: Cockpit glass issue on mediavps ships
Post by: Dragon on March 15, 2010, 07:02:46 am
I have reproduced the issue with disabled shaders and specular maps.
(http://img697.imageshack.us/img697/448/screen1227.th.png) (http://img697.imageshack.us/i/screen1227.png/)
As you can see, the problem is still there, so it's most likely an engine issue.
Title: Re: Cockpit glass issue on mediavps ships
Post by: FUBAR-BDHR on March 15, 2010, 10:55:42 pm
I've been noticing it as well with the models I've been working on.  Appear fine in PCS2 but can't see through the canopy ingame.  Was just playing and notice if I tick disable lighting in the tech room the canopy is transparent again. 
Title: Re: Cockpit glass issue on mediavps ships
Post by: FUBAR-BDHR on March 16, 2010, 02:54:18 am
Additional update.  It also seems to be driver or video card related.  I'm on an older system with a Radeon 9800 Pro AGP 128 meg and no problem with the cockpit glass here.
Title: Re: Cockpit glass issue on mediavps ships
Post by: Cobra on March 16, 2010, 10:11:34 am
I'm on a geforce 8600 GT 256MB and I have no problems apart from backgrounds being rendered on the inside too.
Title: Re: Cockpit glass issue on mediavps ships
Post by: taylor on March 16, 2010, 10:50:36 am
I have only skimmed the thread, so excuse me if I'm missing something with this, but it is pretty trivial to simply disable env and spec textures when rendering the cockpit.  When I rewrote the ships lab code I added override vars to disable particular maps or features, so we can just set a couple of these before rendering the cockpit and then just turn them back on when it's done.  The changes would be maybe 4-5 lines at most.  I'm not sure whether or not that would solve the issues completely but it should reduce them at least. 
Title: Re: Cockpit glass issue on mediavps ships
Post by: Dragon on March 16, 2010, 12:39:11 pm
The pic on this side has disabled env and spec.
You're right though, as it would make the issue nonexistant on ships with standard glass.
The ones with orange glass would still suffer from this issue, but using an ugly hack mentioned earlier just on them should be more acceptable.
Title: Re: Cockpit glass issue on mediavps ships
Post by: FUBAR-BDHR on March 16, 2010, 02:57:08 pm
I'm on a geforce 8600 GT 256MB and I have no problems apart from backgrounds being rendered on the inside too.

Is the background that is rendered on the inside from below the ship?  That's what I was getting in one test.  The outline of the planet below the ship could clearly be seen on the top outside of the glass. 
Title: Re: Cockpit glass issue on mediavps ships
Post by: Cobra on March 16, 2010, 04:29:29 pm
Yep. In some cases it gets doubled due to the texture mirroring.