Help: Trying to make glass/windshield

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/
  • Weve updated the Tripwire Privacy Notice under our Policies to be clearer about our use of customer information to come in line with the EU General Data Protection Regulation (GDPR) rules that come into force today (25th May 2018). The following are highlights of our changes:


    We've incorporated the relevant concepts from the GDPR including joining the EU and Swiss Privacy Shield framework. We've added explanations for why and how Tripwire processes customer data and the types of data that we process, as well as information about your data protection rights.



    For more information about our privacy practices, please review the new Privacy Policy found here: https://tripwireinteractive.com/#/privacy-notice

Shurek

FNG / Fresh Meat
May 21, 2006
857
13
0
www.darkesthourgame.com
Howdy,

I'm hoping one of you texture artists/2D art gurus can help me out with some information on how to create a proper glass texture.

I imagine it goes a little something like this. First, you lay down a transparent alpha layer. Next on top of that you add a diffuse layer (or layers) with scratches, dirt, other blemishes, etc. You merge the layers and export the file as .dds. You import the texture into the editor, check mipmaps, and then set the texture properties as Masked and Two-Sided (or is it Alpha and Two-Sided?).

Well, I've tried that and unfortunately it appears that is not correct, or at least not the way I did it. I can get a transparent texture into the editor but it is not truly two-sided. If I set it as Masked, while the texture appears to be clear, however, static meshes and other objects are not rendered on the other side. If I set it as Alpha, then I am able to see through to the other side, however, my diffuse layer of scratches and dirt appears mutilated with strange colors and artifacts.

Okay, what am I doing wrong here?
 

SchutzeSepp

FNG / Fresh Meat
Sep 23, 2006
1,540
8
0
36
im not sure if this can be done properly, when you have transparent alpha layers you always get problems like meshes that disappear behind, and smoke and fog can sometimes not be rendered through it aswell
 

[TW]DrGuppy

Tripwire Interactive Staff
Nov 22, 2005
1,039
36
0
35
Atlanta, Georgia
Transparency Tutorial

Transparency Tutorial

Well, I don't claim to be a 2D guru of any sort but this should help. And hey, what else am I supposed to do all day with this dodgy internet connection? :rolleyes:



Text version

1. In Photoshop, create a New File with a transparent background.
2. Create your texture using layers for each separate material.
- Use the Opacity box to adjust the transparency for each layer individually.
- The hole in the glass was made by simply deleting that part of the glass layer and exposing the background (checkered).
3. Save the file as D3D/DDS (*.DDS) and choose (Explicit Alpha) DXT3 or DXT5 (Interpolated Alpha).
4. Import the file into the Red Orchestra editor via the texture browser (File > Import...). Be sure turn on the Alpha checkbox. If you forget or ever want to change this you can go into the texture properties (RMB + Properties over the texture in the Texture Browser to bring this up) and look under Surface.
5. You
 

Murphy

FNG / Fresh Meat
Nov 22, 2005
7,069
743
0
33
liandri.darkbb.com
What I do to get alpha into non-alpha textures is to create a shader and use the texture in question as "diffuse". Then I create a ConstantColor and change the A value of its RGBA color representation to the alpha value I want the texture to have and then I use that ConstantColor material as "Opacity" in the shader with the texture.
Only works if you want your texture to have the same alpha value everywhere, but for glass this works quite well.

I haven't had any problems with this regarding objects appearing "in front of it" although they should be behind it.
 

Foo'bar

FNG / Fresh Meat
Nov 12, 2007
275
0
0
Alte Ziegelei
fooblog.mexxoft.com
1. In Photoshop, create a New File with a transparent background.
2. Create your texture using layers for each separate material.
- Use the Opacity box to adjust the transparency for each layer individually.
- The hole in the glass was made by simply deleting that part of the glass layer and exposing the background (checkered).
3. Save the file as D3D/DDS (*.DDS) and choose (Explicit Alpha) DXT3 or DXT5 (Interpolated Alpha).
4. Import the file into the Red Orchestra editor via the texture browser (File > Import...). Be sure turn on the Alpha checkbox. If you forget or ever want to change this you can go into the texture properties (RMB + Properties over the texture in the Texture Browser to bring this up) and look under Surface.
5. You
 

worluk

FNG / Fresh Meat
Nov 21, 2005
2,226
85
0
hmm, driving no smoke vehicle? :)
You can see through smoke through alphas, at least through edges with high alpha part, basically every fence. Make sure you wont get that issue there -.-

Edit: hm, just now read your second post, might be an issue for the smoke too. If so, nvm ;) Pity there wouldnt be an easy way to fix this if its true.
 
Last edited: