scp-fs2open / fs2open.github.com

Origin Repository for SCP FreeSpace 2 Open
https://www.hard-light.net/
Other
407 stars 163 forks source link

Hardpoint gauge issues (solid instead of outline in RTT, certain external weapon models don't show up) #1069

Open WoolieWool opened 7 years ago

WoolieWool commented 7 years ago

While working on Wings 2, I have noticed two major issues with the hardpoints gauge available in hud_gauges.tbl. The first is that, when displayed using render-to-texture, it appears as a solid shape instead of an outline, as demonstrated in this screenshot: http://i.imgur.com/TTlbMX1.jpg

The second is that some external models for secondary weapons don't render on the gauge, and no external primary models render at all. To demonstrate both of these, I have compiled a small mini-mod. Drop the contents of this zip into Blue Planet Complete, load up the mission "Kentauroi Race" (so you won't be bothered by enemy ships or mission objectives), take a UEF Uhlan, enable cheats, and cycle through various primary and secondary weapons. Note that the Uhlan only displays secondary weapons on its third bank. You will see the hardpoints gauge rendered on the Uhlan's cockpit, but as a solid silhouette rather than an outline. Depending on what secondary weapon you have in the third bank, it may show up or it may not. The primary weapons will not appear at all despite the -hdg.tbm specifically instructing the gauge to draw primary weapons.

https://www.sendspace.com/file/9ur5gk

WoolieWool commented 7 years ago

Addendum: The RTT gauge draws as a solid shape only in recent nightly builds. In 3.7.4 it draws as a wireframe, which is also wrong, but not in the same way. In 3.7.4 all external secondaries are drawn correctly, but primaries are still not drawn.

z64555 commented 7 years ago

Hopefully @SamuelCho (aka Swifty) can help out as soon as he's available. Or at the very least give us blokes some pointers on what to look for. :)

WoolieWool commented 7 years ago

Please note that that link to the demo mod will be auto-deleted by Sendspace in another 20 days or so. Got any suggestions as to a more permanent place to put it if Swifty won't be around for a while?

niffiwan commented 7 years ago

Mediafire? Or Freespace Files

SamuelCho commented 7 years ago

The reason why a solid shape is drawn is due to the fact that the hardpoints gauge requires a stencil buffer to the destination render target to get the outline effect. Some changes to the RTT system needs to be done in order to fully support stencil/depth buffers in render targets.

asarium commented 7 years ago

@WoolieWool Could you upload the test mod again? Fixing this bug should be relatively easy since @SamuelCho already found the reason why this is happening.

chief1983 commented 7 years ago

@WoolieWool you around still?

WoolieWool commented 7 years ago

Sorry for disappearing, here's the reuploaded zip: https://www.sendspace.com/file/vsymxq

asarium commented 7 years ago

I tried reproducing this but when I try to launch Kentauroi Race with a UEF Uhlan I do not see a HUD or the cockpit model. Is that the complete mod or do I need something else?

Also, the mod causes a bmpman assertion since the energy bar animation does not have enough frames. I fixed that with #1270 by adding a warning and then ignoring the specified file name.