Sign in to follow this  
Guest

Help - Resample for alpha channel

Recommended Posts

Is there a problem using MS resampler to generate the alpha tiles for water? I have looked in teh archive and can not find any info.I am having trouble with the MS resample tool when trying to generate water textures.Even when I start with a 2 colour base bmp the resample process introduces a series of greys into my final texture files. At first I thought it was because I had a 6m resolution base but after resampling to 4.8m ( and back to 2 colours ) I still get the problem.Enrond's FSTexCOnvert program then (rightly) tells me that the texture is not valid.I need to do the slicing in a batch file.Any Ideas ?regards PatrickF

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

I am looking into the same thing as well.I am working on a tutorial for PhotoTerrain and I don't want to have only the basic stuff covered. Iwould like to at least have some "advanced" topics, like water.Also, I'd like to stick to the MS SDK tools. I know Elrond's tool supports the alpha channel functionality wonderfully, but there are already many "components" required for this process and I'm afraid that by adding another one it will just add to the already considerable state of confusion. If I could somehow keep this under one umbrella it would be great!Does anyone know how to add alpha channel (default water effects) through MS's ImageTool?Misho

Share this post


Link to post
Share on other sites

Hi Patrick,You may be getting greys from antialiasing, if you have this setting activated in your graphics program. I use Corel Photopaint, and when I create the mask that defines the water area, if I allow the program to antialias the selection, I'll have pixels that are attempting to "blend" between white and black at the interface. Turning off antialiasing gives me what I want.Play with texture formats, as far as the image error message...are you trying to use greyscale image format? Use RGB format, and you should be ok.And yes, once you run resample.exe twice (using the colored and alpha source files, saved in different locations) using Elrond's converter works superfine in batch mode. One click, no muss, no fuss.Bob Bernstein

Share this post


Link to post
Share on other sites

Misho, did you confuse resample.exe with imagetool.exe? Patricks question was about resample.exe. He specifically said "batch mode" and I don't know any way to use imagetool in batch mode. I can't image using imagetool on a slice by slice basis.Elrond provided command line access to his texconvert.exe program...wouldn't that be a piece of cake to integrate? And no one would get confused by any componants.Bob Bernstein

Share this post


Link to post
Share on other sites

>Misho, did you confuse resample.exe with imagetool.exe?Nope, I didn't. ImageTool is the one that creates (or at least should be able to) alpha channel textures. >Patricks question was about resample.exe. He specifically >said "batch mode" and I don't know any way to use imagetool >in batch mode.Huh? TerraBuilder uses ImageTool in batch (command line) mode. Simply go to your DOS window and type in "imagetool" and the switches you want to use. The switches used in TerraBuilder are given in a "imageTool" window - you can edit and cahnge those.I can't image using imagetool on a slice by >slice basis. No, that's why there is a command line batch mode.>>Elrond provided command line access to his texconvert.exe >program...wouldn't that be a piece of cake to integrate? >And no one would get confused by any componants. It would be - and it WILL be!

Share this post


Link to post
Share on other sites

you are both right !Imagetool is the ms tool that should do what FSTexConvert does - I haven't tried, I find FSTexConvert great although I would like a true batch runable version.What I couldn't ( and still can't ) get is resample.exe to slice up a B&W image into b&W slices.It slices fine but the 256x256 results have greys in them. This is despite the original bitmap being only 2 colours (0,0,0 and 255,255,255 in RGB ) format. This is a follow on from my old post about jpg > bmp conversion. I got around the problem of blured edges by forcing a pallete on the conversion. The result is a perfect 16m colour rgb bitmap with only 2 colours ie. sharp edge. I have checked the bmp after the conversion and cannot fault itI think I can also do winter,spring,fall textures off the same jpg using a simaler technique if I could be bothered.If I can't get the alpha slice to work I will just ship the slices individually as jpgs ( these work fine ) End result 27x30 km of photoreal ( 480 Tiles ) at 6m resolution ( resampled to 4.8m ) complete with autogen and water + a bit of 3D for under 5 Mbyte.My inf file looks like:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>[Destination]DestDir = "C:temp"DestBaseFileName = "act2k_a"UseSourceDimensions = 1 [source]Type = CUSTOMSourceDir = "C:temp"SourceFile = "ACT2k_a.bmp"Lat = -35.18249Lon = 148.951505NumOfCellsPerLine = 5773NumOfLines = 6399CellXdimensionDeg = 0.0000528446558CellYdimensionDeg = 0.0000431937282ScaleinMeters = 1.0SampleIsCentered = 0>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>and at the command line I have:rem generate alpha texturesresample act2k_A.infany pointers appreciated.regardsPatrickF

Share this post


Link to post
Share on other sites

Ok,I stuffed up somewhere, the resample does introduce some grey edges but FSTexConvert works fine on them.New problem ....... at file 422 out of 480 it bails out with an error 'semephore error allocating stream lock table'see attached image.Any clues ?regards

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