Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Test Builds => Topic started by: Valathil on September 01, 2011, 01:31:05 pm

Title: Transparent Texture fix
Post by: Valathil on September 01, 2011, 01:31:05 pm
This is for Zacam. I tried to fix the transparent texture ordering bug in model rendering but I don't have a ship to test it so I'm posting it here.

Build: http://www.mediafire.com/?f7l4kwbe0a42k8l

Patch: http://www.mediafire.com/?krufjji7ksnmsfu

EDIT: New Version seems working now





[attachment deleted by ninja]
Title: Re: Transparent Texture fix
Post by: Swifty on September 01, 2011, 01:58:41 pm
How come you aren't rendering the buffers with their submodel transformations?
Title: Re: Transparent Texture fix
Post by: Valathil on September 01, 2011, 02:02:20 pm
grr irc says its not working anyway and yeah swifty your right.

EDIT: Weekend Project cause i have work tomorrow. Look here on Saturday or Sunday for progress
Title: Re: Transparent Texture fix
Post by: The E on September 04, 2011, 03:29:58 pm
:bump: for great justice. Look at dat picture, and explode in joy.
Title: Re: Transparent Texture fix
Post by: Commander Zane on September 04, 2011, 03:31:39 pm
Oh. My. God. :eek:
Title: Re: Transparent Texture fix
Post by: Sab0o on September 04, 2011, 05:11:02 pm
**** year
Title: Re: Transparent Texture fix
Post by: Nuke on September 06, 2011, 08:46:17 am
il check it against the dante, it had transparent textures (the fighterbay "forcefields" and the secondary beam cannons) that i never got around to removing.

to words:

**** yea!

does this mean we can stop putting cockpit glass in another bitmap, and make cockpit interior part of the hull?
Title: Re: Transparent Texture fix
Post by: Vasudan Admiral on September 06, 2011, 09:31:05 am
Boo-freaking-yah!!!! :D :D :D You are an awesome person.

So is there anything on the model level we have to do to take advantage of this? And since I'm pretty awful at reading code, what did you change? How does it work? I've been hoping for something like this for years!

Btw, Nuke: Not so sure about the former (since I prefer to just reuse the nice existing glass textures), but the latter we have definitely already been able to do that all along. Separating the glass parts of the ship and calling them 'detail0-trans' before the PCS conversion basically reattached the glass polies and ensured they were last in the list to be rendered, and would therefore render correctly. :)
Title: Re: Transparent Texture fix
Post by: mjn.mixael on September 06, 2011, 10:07:48 am
I talked to him on IRC about what goes on here. Basically, from what I understand if a poly has a texture with the -trans flag it is pushed to the end of the list to render.

The diffuse map from the transparent poly would be 'blahblah-trans' instead of just 'blahblah'. The other maps work as expected but will need to be 'blahblah-trans-glow'.
Title: Re: Transparent Texture fix
Post by: Valathil on September 06, 2011, 11:58:08 am
basically what mixael said but i want to add whats different to the pcs -trans thing. pcs only orders it last in that submodel. i save the polys thill everything solid was rendered, so even if the transparent polies are in a sub sub sub sub rotating sub rotating submodel they would render at the end after everything with correct orientation and everything

EDIT: Comitted 7657
Title: Re: Transparent Texture fix
Post by: mjn.mixael on September 06, 2011, 01:53:04 pm
Thanks to this awesome little fix.. I can do this without even bothering with the model hierarchy. http://www.youtube.com/watch?v=YeajBT68XNI (http://www.youtube.com/watch?v=YeajBT68XNI)
Title: Re: Transparent Texture fix
Post by: Talon 1024 on September 07, 2011, 11:47:19 pm
So I did a little test with mjn's GTDr Phidias.  I renamed the phidflame texture (and all of its frames) to phidflame-trans.eff/phidflame-trans_xxxx.dds.  Unfortunately, it didn't work as well as I had hoped, and the positional data of the thruster subobjects is apparently being ignored.

Here's a screenshot:
(http://www.ciinet.org/kevin/myimages/others/PhidWrong.png) (http://www.ciinet.org/kevin/myimages/others/PhidWrong.png)