Jump to content
Sign in to follow this  
Holger

road textures - colorkey vs. normal alpha

Recommended Posts

Hi all,trying to alter some road textures; no, it's not related to USARoads ;-)I use the following procedure:1. Load the road texture in DXTBmp, then send both texture and alpha to Photoshop2. After I'm done with the edits I save in Photoshop and refresh both parts in DXTBmp, then save as Targa image (alternatively, I combine the texture and alpha directly in Photoshop and save as tga or psd)3. In Imagetool, I open the tga, change to 8-bit, create the mipmaps, and save as bmp.However, the source and altered textures differ in that the former says "Alpha: Alpha" and my new one "Alpha: Colorkey". It seems that this prevents the blending from working as intended as my roads now have black edges.I've read some of the older posts in the forum but none of the ones I found has a direct explanation how to revert from colorkey to "normal" alpha.Any hints are greatly appreciated.Cheers, Holger

Share this post


Link to post
Share on other sites

Hi Holger.Use imagetool, load "dirtroadsu.bmp", view the alpha, and zoom in to maximum ( ctrl-uparrow ).I count a 10 value greyscale for Alpha:AlphaBlack, white, and 8 grays. I don't know of any tool to make these.When I look at the terrain SDK's "niagara_falls_hw.tga", the alpha channel is also Alpha:Alpha, but is just black & white.DickEDITED:www.terrabuilder.com has a download ( under Resources ) for FSTexConvert, by Elrond Elvish. These use Martin Wright's dlls to add an alpha channel to a bitmap, and the alpha is any 256 greyscale bitmap. ( This leads me to believe Martin's utilities also should have this ability. )

Share this post


Link to post
Share on other sites

Hi Holger.Here's a process I got working using Paintshop Pro 7, and imagetool:PSP7:Your image should be 24-bit.=================================Make your Alpha bitmap: Load your image. Copy and paste as a new image ( for your alpha ). With your new image, Selections/Select ALL, Selections/Modify/Transparent_Color, Black with 0 tolerance. Delete ( with the delete button ), and Selections/None. Now you have a standard black and white image. Change to Colors/Grey_Scale Effects/Blur/Blur_More, Effects/Edge/Erode, Effects/Blur/Blur_More.... Save As "MyAlpha.bmp" Close MyAlpha.bmp This leaves your original image still loaded to PSP.==============================With your image loaded, join the alpha: Masks/Load_from_Disk... MyAlpha.bmp ( use all files instead of .msk ) Masks/Save_to_Alpha_Channel/OK/OK Masks/Delete... and say "No" to merge. Save As MyImage.psd ( Photoshop image ).==============================Load MyImage.psd into imagetool ( seen as 32-bit with Alpha:Alpha ) Format/8-bit. Create MipMaps. Save As MyImage_Alphaed.bmp==============================All done.The Grayscale alpha.bmp can be anthing you want. I don't know if it really defines tranparency in 8-bit or DXT1, but it might. And as you noted, it might get rid of the dark outline.Dick

Share this post


Link to post
Share on other sites

Hi Dick,wow! thanks so much for the great tutorial! Had to dust off an old version of PSP but managed to follow your steps and now I'm back to Alpha:Alpha. I haven't looked at the results yet in FS itself but it does answer the main question.I particularly like the combination of effects you suggest for "eroding" the edges of the alpha - is that your home-made procedure?You may know this already but here's a tip for designers of alternative vector textures (the "issue" being that we don't want to alter the terrain.cfg but that means losing the ability to attach vector autogen and/or flattens/depression to (local) alternate textures): Use two instances of the road/stream in question: one instance with the desired autogen/flatten from the terrain.cfg but with Width=2 and, one level up(!), your replacement texture with the accurate width. No need to draw the vectors twice; just re-use the bgl by changing the texture calls in the asm code. The only caveats are that your replacement texture should have the same shape ("curviness") and that using this approach for high-density vectors (such as USARoads) might be hard on frames (never mind carving up the mesh).Cheers, Holger

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...