Jump to content
Sign in to follow this  
nudata

Need Process For Making Part of PhotoReal Transparent

Recommended Posts

I have FSTEXTURE. However, what is the process to create a transparency mask to block the appearance of specific elements/thing of a photoreal texture from showing in FS2002?? I have never used the Alpha channel so not sure of how to do this - color, etc...The objective is to isolate roads from Terrascene for placement without any other textures so that the roads are laid on top of the existing FS2002 textures and not show Terrascene textures.DickKLBE


regards,

Dick near Pittsburgh, USA

Share this post


Link to post
Share on other sites
Guest

I use DXTBmp for transparency. Very simple . All what transparent must be painted with pure green 0,255,0. (you may use pure black too). Then save as .tga or even bmp. Load as Normal, hit create Alpha Channel and save as Extended. When in Save as Extended window you will have many options of format. Chose either DXT1 or DXT3 depending on what transparency you want to get (full DXT1 , partial DXT3).Play little with program and soon you will be at ease with it.From now on you can load your picture to be previewed by Load as Extended. Do not forget about Mipmaps. And wait until the process of photo conversion is fully finished - takes 2 to 5 secs. Now for your application I would suggest first to extract the roads from the map by " color selection" - for that I use Photoshop. Then your layer has only roads and background which you will fill with pure green. Ted

Share this post


Link to post
Share on other sites

Ted,Thanks for the info. This is either part of my needed answer or what I am trying is not possible.In Terrascene, if you are not familiar with it, I can create a green background (0,255,0) with grey roads. The roads are created directly from USGS data. I normally take this BMP and run it through Terrabuilder. Here the BMP is resampled, passed through the Imagetool and then through TMF2BGL. I now have a set of proper textures in standard FS2002 format and a BGL describing them.From what I reading DXTBMP only operates on one texture file at a time and I can have dozens. This does not seem a viable approach.FS Texture Converter operates on all texture files located in a particular folder. That looks like what I need.The question arises (for me) is how do I prepare the Alpha channel? I have created a series of textures (FS2002 format 43kb) with grey roads on a green background. Do I use the original single image of the total scenery as the Alpha mask (grey on green)? Should I convert it first with DXTBMP to grey scale? Is this the proper Alpha mask or just something needed by DXTBMP?As you can see I am not sure how to create the Alpha mask and also how to best handle the dozens of FS2002 format textures.DickKLBE


regards,

Dick near Pittsburgh, USA

Share this post


Link to post
Share on other sites
Guest

Yes I see what you are after. I think that FS Texture converter should convert all files from Terrabuilder folder. This is a batch converter. Terrabuilder should resample big BMP from Terrascene with just green background and grey roads. Green or whatever color FS Texture converter considers as transparent (do not quite remember). Ted

Share this post


Link to post
Share on other sites
Guest

BTW talking about automatization of scenery designing process. Looks like we will soon going to need it badly. Just that "exclude" clicking in Ground2K for one Area 1024 times can really put you to sleep. I was looking briefly at "Automate" program to see if some of the activities can be done by komputer alone. Ted

Share this post


Link to post
Share on other sites

Thanks Ted,I hold down the ENTER key while clicking the exclude sectors. Makes it a single click operation. I also usually kill the background so I can clearly see the road/river I am isolating.With Ground2K I usually do very large areas using Topozone maps. I just get the largest lo-res (200000:1) map and use a screen shot as the template. Topozone provides the lat/lon for you also - a must. I have tried Global Mapper but really do not see a need for it when placing larger road/river areas. I cheat(re-align) a little to match items accross new map boundries. The large maps reduce the number of cheating interfaces. FSGenesis 38.4 mesh for the USA helps as rivers stay inside valleys. The greatest problem are rivers that FS200x displays. If you exclude them the original flattened river bed remains and looks quite bad when the correct river is placed. I just finished doing the Youghiogheny River - it is near Frank Lloyd Wright's Falling Water Home in south Central PA. The river is a white water attraction and thus did it in sections to keep elevations reasonable. Dick


regards,

Dick near Pittsburgh, USA

Share this post


Link to post
Share on other sites

Hi Dick.First a picture:http://forums.avsim.com/user_files/25493.jpgThis is Whitewater, Wisconsin.The city streets are grey roads masked onto a black background. The background is then made the alpha channel. The transparency is because the textures are 8-bit, flipped vertically, mipped, with alpha, and placed as a VTP2 poly, layer 32, with the landclass #253 ( no seasons for this example... as the roads could be the same for all seasons ).The country roads leading to the city are regular VTP lines, layer 31.By using the 'slices' for just the cities, you save a LOT of texture overhead. If you use a large Terrascene image for the Ground2k background, you'll have your road "map", and the roads should line up very well with slices made from the same image.The slices are named by resample, and Ground2K shows the slice name for each LOD13 area. The polygon doesn't need to be exactly an LOD13 size, it can be the size of the entire city, and irregularly shaped... it's just roads and transparency. You can even make autogen for the city. Make it for the road slices before you flip them. ( The uppermost layer's autogen will show ). The autogen and slices need to be in the .../scenedb/world/texture folder ( with the default autogen ) for that to work. If autogen is unimportant, the slices could be in a local texture folder, twinned to the scenery folder.VTP2 is vertically flipped, so the slices need that done. XNView has a batch function ability for that. I think one of Martin Wright's utilities may also do that. Elrond Elvish's "FSTexConvert" can batch the alpha's if you want, but I do alpha's of the slices with PaintshopPro, as I'm only doing the cities. I convert from 24 bit to 8 bit ( and mip ) with imagetool, as a batch.Here's the LOD13 Areas marked:http://forums.avsim.com/user_files/25497.jpgHere's Delavan:( Before flipping )http://forums.avsim.com/user_files/25498.jpghttp://forums.avsim.com/user_files/25501.jpgDick

Share this post


Link to post
Share on other sites

Thanks for your usual detailed explanation...Just to see if I have this correct since I have never paid any attention to Alpha stuff:Create the usual "slices" of the original full texture BMP through normal processes (SDK etc.) to produce the extended 193kb BMPs.Then create another set of slices, from the same full BMP, that will become the matching Alpha masks. I assume that I can vertically invert the full BMP to satisfy the requirement for vertically inverting the Alpha masks. Then use a batch processing program, such as FS TEXTURE, to combine the two sets of slices (using the 193kb bmp slices for both) into properly masked final 43kb BMP slices suitable for use in FS200n.I understand the masking and the density of the mask determining the degree of transparency. Therefore, I assume that it may be best to create a seperate original full BMP for Alpha masks with all white roads to permit the final grey roads to fully display.I remember the original Alpha discussions some time ago but never looked at them since my focus was on something else at the time. If there is a basic tutorial of some sort on this stuff that could save you a lot of time trying to remotely lead me to water (roads).Thanks,Dick KLBE


regards,

Dick near Pittsburgh, USA

Share this post


Link to post
Share on other sites

Hi Dick.I create slices with resample. I can save a copy of the slices if I want autogen with these textures... as autogen is not flipped vertically, and I'd need the originals to place the autogen correctly.I then flip them vertically.I then alter them for the alpha channel with PaintShopPro7, by 'selecting' the image, and 'modifying' the selection as 'transparency' = black. I then save the selection to alpha channel, and then save the image as a TARGA ( making sure the option for the SaveAs is 24 bit uncompressed ). This image can be read by imagetool for processing as an 8-bit, mipped bitmap ( approx. 87kb image ). This is the FS2000 extended format. It is not DXT.There are ways to use FSTexConvert or Martin Wright's BMP2000 to do this alphatizing. The alpha must also be vertically flipped... so you flip first, then alphatize. I'm not sure if Martin's utility allows batch processing. I believe he has such a utility for DXT1 textures, and that could be used, but then they'd need to be re-batched by imagetool for 8-bit. I can't remember if Elrond's FSTexConvert can batch as 8-bit mipped.. so those might also need re-batching with imagetool.=========================So... resample, save copy, vertically flip, alphatize, process as 8-bit, mipped.Now these can be placed as VTP polys... and those can be placed in 3 basic ways:1) If you desire autogen, place them as VTP2 landclass #253 ( or #252 if you've made seasonal variations ). These textures would need to be in the .../scenedb/world/texture folder ( and the autogen as well ). You can use a large poly to cover an entire city.. even trimmed to the city limit extents. I use this even if I don't want autogen. The sim tiles the correct CUSTOM texture in the right LOD13 Area, within the confines of the polygon. That allows you to control the autogen exclusion by trimming the poly in Ground2K... so a single LOD13 Area can have many landclass numbered polys and each having their own autogen.or2) If you don't want autogen, you could place the textures as named textures... a name for each season. If VTP2, then you'd need to try to make the polys go right to the limits of each LOD13 Area.. and you may have "imbrication" issues if they overlap slightly. Instead of one large poly, you'd need many small LOD13 sized polys.or3) Use the placement as VTP1... Christian has some sort of VTP1 placement that will flip the textures for you. I honestly haven't used it much, and you'd need to read the docs. I think these also need to be named textures ( not numbered as #253 ). I also have heard of some problems with VTP1 polys and FS2002... even after seasonal/night variations are named.Of all those methods, the first makes the most sense, and allows autogen.==============I realise this all sounds horribly complicated. Terrabuilder has some sort of integration with FSTexConvert.. so that would help, except each slice needs to be vertically flipped ( not the entire source image ). The whole problem would be solved if there was a utility that could batch the works as automatic flipping, then color-coded alphatising, then rebatching to 8-bit... or if imagetool allowed flipping and alpha creation.I do remember that Martin Wright has some sort of utility that does allow flipping, alpha creation, and batching. But it is DXT1, I believe. Even so, those slices could be re-batched to 8-bit by imagetool. So the steps could be reduced.For my use, PaintShopPro and imagetool do the job. For larger projects, you might need batching of some sort.Dick

Share this post


Link to post
Share on other sites

Indeed that is a daunting set of process when one is dealing with several hundred texture slices/sectors/files. Ok for small city area but not for large the areas that I am working with. Thought that there might be an expedient method to place Terrascene roads since this is the only program that fully automates the creation of roads. I have revisited this from time-to-time but never found a good way to do it. Ground2k is a wonderful program for correcting the wierd FS200x roads and rivers. However. I always wanted to completely blanket an area with a full contingent of elegible roads to see what it looked like. Would take longer than justified by the Ground2K manual method.If Christian had some hooks (API) to permit a devoted and skilled programmer to build a program that would input USGS data and drive Ground2k that would be ideal. I have also suggested to him the possibility of creating an agolrithim that would re-mesh/smooth elevations for roads to avoid tilted roads or where roads are cut thru a hill and the cut out section is too small to render using 38 meter mesh. Yes, you can redo the mesh under the roads by hand but another very tedious task. Especially given the hundreds of miles of roads in a typical VFR excursion area. Probably I should play with jets at 40,000 feet so all I need are some of the fine airports available with no regard for scenery detail.Dick


regards,

Dick near Pittsburgh, USA

Share this post


Link to post
Share on other sites
Guest Elrond

Hi Dick,Since I haven't been active in the community for quite some time, I'm pretty well lost with the discussion you're having... Except the bit about needing a tool that will vertically flip resulting resample.exe created slices during the process of applying the alpha to them while creating masked DXTx or Extended textures. This, if I understand the gist of what you need, I can do.In the existing TexConvert, I actually have to internally flip all slices vertically before they are written right now when creating CUSTOM resamples because the textures are processed "upside down" internally. I can add a commandline and UI option to bypass that internal flip and leave them in the state it seems you require if you wish. Such an update to TexConvert would still require a separate alpha mask bmp that was run through resample.exe (exactly like the "base" bmp) instead of internally creating the alpha by color match from the original slices... Its the method of alpha masking that I designed the tool around (its a much "cleaner" method of alpha masking even though its more work). But if you need the flipping, I can help with that.Let me know if I caught the gist of what you need and/or want an update to TexConvert.Take care,Elrond

Share this post


Link to post
Share on other sites

Hi Elrond.VTP2 polys that use a texture number of 252 ( seasonal set ) or 253 ( single season ), can display resampled slices in FS2002 and FS2004.If the slices are converted to 8-bit mipped with alpha ( the same as the road and river textures ), then we can use the alpha channel as tranparent in VTP2 polys, rather than as resample's water.The odd thing is that VTP2 displayed textures are vertically flipped.All this allows you to use a program like Ground2K to draw any sized or shaped poly as VTP2 with landclass number 252 or 253, and correctly named bitmapped slices will display in the drawn poly.This also allows roads, rivers, LWM water... to be used with photoreal images in the sim.As the above images show, you can make a georeferenced image of a city's streets, and make it a layered VTP2 poly. Kind of a nice detail for a project.nudata's project is much more ambitious, as he would like to cover a vast area with these transparent slices... very possible with the right tools, but I'm not sure about framerates and memory management in F2004.Dick

Share this post


Link to post
Share on other sites
Guest Elrond

Thanks for the explanation Dick. That clears up the topic pretty well for me. So, it sounds like adding the vertical flip (actually removing it, since I internally flip already) might be useful. If you agree, I'll do so sometime in the next week and get a new build out. If you'd rather have a different tool that also includes building the alpha internally from colored pixels instead of merging them from a separate mask, I'll leave it for someone else's utility.Take care,Elrond

Share this post


Link to post
Share on other sites
Guest Richard Hill

Dick;Do you think this forum might get some of our great programmers heads togeather and produce a program like TerraScene in the near future? If they could work with each other with their tools I would think it could be in use in a few months. I would think the developer of TerraScene would be willing to add his support.Richard;

Share this post


Link to post
Share on other sites

Hi Elrond.DXTBMP, by Martin Wright, allows flipping of the image and the alpha... but doesn't use 8-bit.... but it could be saved as 24 bit and then batch processed as 8-bit with mips in imagetool. I think DXTBMP has batching.I don't have any problem with using a separate BMP for the alpha, as that can be created from the source image quite easily. It's just the vertical flipping of all the textures with alpha that is a problem. The conversion to 8-bit mipped can still be done by MS' Imagetool.Dick

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...