SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH4 Mods Workshop
Forget password? Reset here

Reply
 
Thread Tools Display Modes
Old 05-10-08, 09:04 AM   #1
conus00
Grey Wolf
 
Join Date: May 2008
Location: DB85
Posts: 804
Downloads: 166
Uploads: 0
Problems with transparency in modified files...

Hello all,
I have just recently joined this site... I actually "stumbled upon" this site while I was looking for GWX and I am really impresed by it. Anyway here's my question:
I am fairily new to modifying files and "skinning", nonetheless I consider myself being good in Photoshop. Recently I have been running into this problem: When I modify any files which use "layers" the transparency does not work anymore. I am assuming that the surrounding of the object has to be a certain color to be transparent. Even though I triple-checked the values of the "transparent" color against the original file I am still getting solid black instead of transparent.
I don't know if I am expressing myself good enough it is kinda hard without pictures. If I could post pics it would be much easier.

Anyway, what am I doing wrong? Is there some trick to it?
Just for the record here is the process I have been using:
1. convert the .dds file to .jpg using DDS Converter 2
2. modify the bitmap in Photoshop (CS3 Extended)
4. convert .jpg back to .dds
5. install the mod using JSGME

I would really appreciate any insights on this. It must be something trivial but I cannot figure it out...
Thanks!
conus00 is offline   Reply With Quote
Old 05-10-08, 10:28 AM   #2
Nisgeis
Ocean Warrior
 
Join Date: Jan 2008
Posts: 2,909
Downloads: 77
Uploads: 11
Default

Hi Consus, welcome aboard! As far as I know, you can't have transparency in a texture file, it is interpretted as black and I don't think there is a transparency colour key, like in a GIF. I'd check to see, but I just installed Vista to do some troubleshooting, so I don't have any of my tools. You can set opacity through the material properties in the .dat file (using silent 3ditor) where the texture is set up, but it will apply to the whole texture. If you want to put in a real limber hole, instead of just having it black, you'd have to edit the 3d model to remove that section. if you wanted a window, which reflected, you'd have to make a 3d window object and make it transparent and give it a light map.

Someone correct me if they know better please.
Nisgeis is offline   Reply With Quote
Old 05-10-08, 10:41 AM   #3
conus00
Grey Wolf
 
Join Date: May 2008
Location: DB85
Posts: 804
Downloads: 166
Uploads: 0
Default

Yes, I uderstand that, but here's the problem: I have changed only small details on the part of the file which is gonna stay "solid" so the properties in corresponding .dat file which (I assume) describes which portions of the bitmap will become transparent/semi-transparent (like a mask) should stay unchanged as well...
The HEX value of the surrounding "black" in the modified bitmap is exactly the same as in the original file. Where the original file is transparent the modified one shows solid black...

Here are two examples.
This is how the file is supposed to look like (original file):
http://www.mediafire.com/imageview.p...cxzxze&thumb=4
And here is how it looks like (modified file):
http://www.mediafire.com/imageview.p...zx2ejz&thumb=4

And again:
(original):
http://www.mediafire.com/imageview.p...ev3md9&thumb=4
(modified):
http://www.mediafire.com/imageview.php?quickkey=ujtxujfpym9&thumb=4

Last edited by conus00; 05-10-08 at 11:31 AM.
conus00 is offline   Reply With Quote
Old 05-10-08, 10:53 AM   #4
Nisgeis
Ocean Warrior
 
Join Date: Jan 2008
Posts: 2,909
Downloads: 77
Uploads: 11
Default

The .dat file only has options to make the entre texture opaque or not, not portions of it. The only exception to this is light sources, which are transparent in the black portions. If you set a portion of a light source's file to transparent, the whole texture becomes solid and also rather odd thinigs can happen (none of which are good).

This is becoming rather abstract, it would help if you said what files you were altering and what you were trying to do.
Nisgeis is offline   Reply With Quote
Old 05-10-08, 11:03 AM   #5
conus00
Grey Wolf
 
Join Date: May 2008
Location: DB85
Posts: 804
Downloads: 166
Uploads: 0
Default

Quote:
Originally Posted by Nisgeis
This is becoming rather abstract, it would help if you said what files you were altering and what you were trying to do.
Ok, please check the links at my original post....
These are screen captures of the problem I am getting.

Also, here are two samples if you want to compare them in the Photoshop.
(original) http://www.mediafire.com/imageview.p...jz1bdz&thumb=4
(modded) http://www.mediafire.com/imageview.p...0eob0z&thumb=4

Last edited by conus00; 05-10-08 at 11:34 AM.
conus00 is offline   Reply With Quote
Old 05-10-08, 12:02 PM   #6
conus00
Grey Wolf
 
Join Date: May 2008
Location: DB85
Posts: 804
Downloads: 166
Uploads: 0
Default

Quote:
Originally Posted by Mikhayl
What happens if you replace the black "transparent" part with an alpha channel ?
Good idea. I just tried it but no dice. I also opened one of the original files to look at it again and there is no alpha channel either...
conus00 is offline   Reply With Quote
Old 05-10-08, 12:52 PM   #7
Nisgeis
Ocean Warrior
 
Join Date: Jan 2008
Posts: 2,909
Downloads: 77
Uploads: 11
Default

Ah, these are 2d graphics, I thought you were talking originally about 3d. The 2d graphics support the alpha channel for masking purposes. What may be happening is your conversion to bitmap (or is it jpeg) is removing the alpha channel (not sure if BMP supports transparency). Get the dds plugin for photoshop, or get gimp with the dds plugin. Not sure if PNG supports alpha channels, but you might try converting the dds to PNG or TGA instead of bitmap. It's also possible that you are stripping out the alpha channel when you convert to dds, you need to save as DXT3 (default for the game I think) or DXT5. DXT1 doesn't support transparency.

Google dds plugin and you should get the nVidia plugin listed for photoshop.
Nisgeis is offline   Reply With Quote
Old 05-10-08, 10:59 PM   #8
conus00
Grey Wolf
 
Join Date: May 2008
Location: DB85
Posts: 804
Downloads: 166
Uploads: 0
Default

Quote:
Originally Posted by Nisgeis
Ah, these are 2d graphics, I thought you were talking originally about 3d. The 2d graphics support the alpha channel for masking purposes. What may be happening is your conversion to bitmap (or is it jpeg) is removing the alpha channel (not sure if BMP supports transparency). Get the dds plugin for photoshop, or get gimp with the dds plugin. Not sure if PNG supports alpha channels, but you might try converting the dds to PNG or TGA instead of bitmap. It's also possible that you are stripping out the alpha channel when you convert to dds, you need to save as DXT3 (default for the game I think) or DXT5. DXT1 doesn't support transparency.

Google dds plugin and you should get the nVidia plugin listed for photoshop.
You nailed it. It was indeed a problem with a alpha channel. The problem was that using DDS Converter 2 I forgot to turn the DXT3 on so it was not creating alpha channels. Also while saving TGA I saved them as 24-bit instead 32-bit (required to keep alpha channel) which was screwing up the conversion back to .dds file...

Anyway, I got it all figured out so I am working on some upragdes for SH4 now.

Mod, please close this thread.
conus00 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:46 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.