Sign in to follow this  
Guest

ACT Scenery Pack photo scenery with small download

Recommended Posts

I have released my current version of ACT scenery. Readers of this group may be interested as I have further refined the technique of shipping jpg's and converting to texture files at the user end. As you will see I can ship water textures successfully using this technique by limiting the pallette during the conversion. I could also do Season variations using the same method ( if I had time ! )I have uploaded my scenery to my old site for download as separate files or at AVSIM bundled under ACT2002.ZIPYou can download at http://members.ozemail.com.au/~paeet/Note this is a beta. I would like to do more but am jammed for time (again)so I thought I'd upload.I would still like to do night textures and maybe seasons using the same technique.I would like to thank Martin and Elrond for their wonderfull tools and everyone on this group for tips.Patrick Fogartypaeet@ozemail.com.auBelow is my batch file for anyone interested in the technique.Batch File ( shortened )*****************************************************************************@echo offrem ACT2k.BAT Utility for generating photorealistic ACT FS2000/2002 Sceneryrem Patrick Fogarty 15/4/2002echo Installing scenery files . . .rem set up directory structuremd act2kmd act2kscenerymd act2ktexturerem copy autogen files overmove agn*.agn act2ktextureecho Generating alpha files for water textures . . .rem convert alpha jpg to bmp ( limit to black and white )djpeg -bmp -dither none -map BW.gif ACT2k_a.jpg act2k_a.bmpif not exist act2k_a.bmp goto Errecho **************************************************************echo *** ***echo *** working - water texture generation will take some time ***echo *** ***echo **************************************************************rem generate textures and tmfresample act2k_A.infif not exist act2k_a.tmf goto Err1rem Erase files we createderase act2k_a.bmperase act2k_a.tmfrem Move relevant files into appropriate subdirectories. Note work aound by using 2 directoriesmd alphamove *0su.bmp alphamd alpha1move *.bmp alpha1echo Generating files for base textures . . .rem convert jpg to bmpdjpeg -bmp -dither none act2k.jpg act2k.bmpif not exist act2k.bmp goto Errecho ********************************************************echo *** ***echo *** working - texture generation will take some time ***echo *** ***echo ********************************************************rem generate textures and tmfresample act2k.infif not exist act2k.tmf goto Err1rem generate bgltmf2bgl act2k.tmf act2k.bglif not exist act2k.bgl goto Err2rem Move bgl file into appropriate subdirectorymove act2k.bgl act2ksceneryrem Erase files we createderase act2k.bmperase act2k.tmfmd basemove *0su.bmp basemd base1move *.bmp base1echo *************************************************************echo *** ***echo *** FSTEXConvert texture Conversion ( thanks Enrond ) ***echo *** check file paths are ok then press 'convert slices' *** echo *** and go make some tea - or watch for a tour of the ACT!***echo *** ***echo *** Note you will need to do this twice because ***echo *** we do them in two lots ***echo *** ***echo *************************************************************fstexconverterase fstexconvert.inicopy fstexconvert.2nd fstexconvert.ini fstexconvertecho Success - now move the ACT2k directory and all contents to yourecho scenery directory and install the new scenery in Flight Simulator.echo goto end:Errecho Installation failed - check act2k.jpg,act2k_a.jpg and djpeg.exe are presentgoto end:Err1echo Error: resample failed - check act2k_inf,act2k.inf & resample.exe are presentgoto end:Err2echo Error: tmf2bgl failed check tmf2bgl.exe is presentgoto end:syntaxecho Generates texture files for the ACT2k scenery and puts files intoecho ACT2k SCENERY and TEXTURE subdirectories. echo Usage: ACT2k goto end:end

Share this post


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

Hi Patrick,I tested Your ACT2k a bit. A very interesting way transmitting a scenery. There seems to be a bug. After following the instructions, all the textures resisting in folder base where missing. The two converters have the same ini.I converted this slices and inserted into texture. So I had all the textures but water textures are out of order now.For first start, it would be good to have the Canberra airport sign after installing. I did search some time.Do You have a link to pictures of Canberra and around?I do not understand the reason for 2x base and alpha textures with 2 LOD ???Water textures are working in ACT; I saw. I remember in Mai You started working with water textures. From Your batch I can see how You do it. But is there something written anywhere?Why have Your JPGs different dimensions? Is it not possible to make smaller alpha-areas? Lakes only ?. Do You know what are the resample-filters for?peterwww.petercie.de

Share this post


Link to post
Share on other sites

John Dow has done such a good job of improving the colours in my ACT scenery that I had to upload it so it was available. It blends very well with the surrounding default scenery.I have uploaded my scenery to my old site as ACT2k_col.ZIP. Once I have done some good night textures to match I will upload the new version to AVSIM.You can download at http://members.ozemail.com.au/~paeet/Patrick Fogartypaeet@ozemail.com.au

Share this post


Link to post
Share on other sites

Pit,check what you are doing and make sure you start it in C:/temp, others have reported no problems except if start directory is wrong.>The two converters have the same ini. not sure why - see teh batch file , the new one is copied in - make sure you close the first one to bring up the second ( could be a bug on some system types - let me know )>Do You have a link to pictures of Canberra and around? >>I do not understand the reason for 2x base and alpha >textures with 2 LOD ??? FSTexconvert has a memory bug and if I didn't split them up it bombs out at 320 textures or so - I needed 480. LOD is not relevant, the jpg can be any resolution - resample resizes to 4.8m per pixel.Alpha textures are just to produce 'live' water. Don't worry about the different sizes for the two jpgs - this is a hangover of developement ( I was having trouble with MS resample introducing greys to the alpha channel ) In theory they should of both been the same size.>>Water textures are working in ACT; I saw. I remember in Mai >You started working with water textures. From Your batch I >can see how You do it. But is there something written >anywhere? >Why have Your JPGs different dimensions? Is it not possible >to make smaller alpha-areas? Lakes only ?. Yes, but it is easier to line up the water with the base if the edges are both the same and also makes the batch generation easier - otherwise you would have to split into have alpha and don't have alpha>Do You know what are the resample-filters for? Noregards

Share this post


Link to post
Share on other sites

Patrick,Here is te batch.fstexconverterase fstexconvert.inicopy fstexconvert.2nd fstexconvert.ini fstexconvertYou load the converterThe converter is on screen but nobody starts the converter.Now You erase the ini and copy the new one.You load the converter twice now You only have the new ini.On screen You get the second converter over the first.Now I think I have only one, and start converting the second converter.How can that go? Both converters have the same ini.Better You erase the files. If somebody trys to start the second tine.Pit

Share this post


Link to post
Share on other sites

Pit,from the installation instructions:***** Note you need to intervene by pressing the Convert button twice at this point and close the window when FXTexConvert is finished each time ******I just ran again on my machine and works fine. Sorry this part is so clumbsy but as I outline it is a work around.so sequence is ...>>fstexconvert rem open first one > intervene by hitting convert and when finished close>erase fstexconvert.ini >copy fstexconvert.2nd fstexconvert.ini rem sub in new paths>fstexconvert rem open second one > intervene by hitting convert and when finished closelet me know if it still doesn't work ( or if there is a cuter way ! )Patrick

Share this post


Link to post
Share on other sites

Hi Patrick,I'd be happy to whip up a little utility that could automate this a tad easier (and in a graphical way). I'd make it generic enough to where it'd work for any type of similar packaging as your idea (which is good, btw).Also, sorry about the bug going past 400+ textures... Its out of my hands however as its a memory leak in Martin's DLL which the utility relies upon. I think he's a bit too busy lately to look into it though.Alternately, you could write the batch to use the commandline features of FSTexConv instead of relying on the ini and having to switch them. The first pass would be called like such:call fstexconvert -b:"C:TempBase" -a:"C:TempAlpha" -o:"C:TempAct2kTexture" -t:1 -v:yand the second pass would be called like:call fstexconvert -b:"C:TempBase1" -a:"C:TempAlpha1" -o:"C:TempAct2kTexture" -t:1 -v:y(Note: The 'call' statement makes sure the process is exited before the batch continues.)Take care,http://members.rogers.com/eelvish/elrondlogo.gifhttp://members.rogers.com/eelvish/flyurl.gif

Share this post


Link to post
Share on other sites

Well I have certainly been busy recently but I have had a few looks through the code and it still seems "leak free" (at least in as much as I can`t find any memory allocated that isn`t deallocated afterwards..)However you can never be quite sure what the operating system is doing. The DXT dll loads another dll for the scaling routines and, although this dll is freed afterwards I`m not entirely convinced everything gets cleaned up. what I might try is to recreate the scaling routines in the single DLL and see if that stops it

Share this post


Link to post
Share on other sites

Hi Martin,Thanks for the reply as I wasn't expecting or requesting it... You've done so much for the community and I know you are always busy, so I appreciate it.I've combed through my code line by line to make sure the leak wasn't within and I'm certain its not there. I'd be happy to send you the project if it'd make it any easier for you to see what could possibly be up in the DLL. It was whipped together pretty quickly so its relatively sloppy and not commented in the least (which is why I haven't released the code along with the utility as I normally do), but I'd be happy to give it out if requested.Thanks again for the custom work you did on the DLL - memory leak or no, its really helped sort out the alpha issue in 2K2.Take care,http://members.rogers.com/eelvish/elrondlogo.gifhttp://members.rogers.com/eelvish/flyurl.gif

Share this post


Link to post
Share on other sites

Elrond, Martin,thanks for the replies,I wasn't aware of the command line option for FsTexConvert but will use it in future - sounds like the way to go.On the memory issue, I run win 2000 pro and have had the task manager open while FsTexConvert does its stuff. The memory usage ramps up and the drop out point appears to align with the last of the 'real' memory ( in my case 128 MB ) This may have nothing to do with it but may be worth a look.regards and thank you both for all the had workPatrick F

Share this post


Link to post
Share on other sites

Thanks Martin,refer below.On the graphic utility I would love to see one. If it was setup as an install type interface that took the input ranges ( i.e. corners output directories, jpgs etc ) from an ini type file it would be a neat way of doing it.I have been a real fan of shipping this stuff as a jpg since I first did it for my FS98 scenery. It really pulls down the download sizes and plays to the strength of jpg ( i.e. for ground textures close enough is near enough - after all who's to say the grass didn't grow a bit ! )I also have thought since the start that it would be a good way to store areas on HD and convert ' on the fly ' although I imagine any spare in cpu power is always going to go to where it should be - improving the view out the window.regards

Share this post


Link to post
Share on other sites

Hi ElrondI would be interested in seeing the code. Not because I think the leak is there but it might be easier to track when I see how the DLL is being called.I still have my doubts about the OS. Too much goes on behind the scenes.I checked my code again last night and couldn`t find any "direct" losses. However there is a lot of opening, reading, writing and closing of files and loading and unloading Dlls that goes on. A small leakage in any of these "behind the scenes" things soon mounts up when you are repeating the process 500 times...I would be interested in seeing if there are different results when the DLL is loaded once and unloaded after all the textures have been processed and when it is loaded/unloaded for each texture.And you haven`t seen real sloppy code until you`ve seen mine (which is why I`m too embarrassed to show it...)

Share this post


Link to post
Share on other sites

And to answer my own questions....It does seem to be the DLL loading that is causing the leak. Despite following all the proper LoadLibrary() FreeLibrary() methods it doesn`t seem to free up the memory until the calling-program is shut down. As the main DLL calls another DLL once for every texture there is a steady build up until eventually it falls over.You can reduce some of the effect by only opening the DLL once and keeping it open until you have finished. However this won`t stop the internal DLL calls so it only delays the inevitable a bit. I managed to get over 2000 conversions before it ground to a halt.

Share this post


Link to post
Share on other sites

Hi Martin,Sorry for the late reply...I'd be happy to send you the project and will do so tonight when I get home. One problem I had forgotten about is that I use a commercial component in the project from Envision. The component allowed me the ability to flip the image correctly without much work. I'll try to comment out this section so it doesn't rely upon the component - that way you'll be able to run the project. There are three other components it relies upon, but they are freeware so I'll include them (and embed them in the project so you don't have to have them pre-installed).In the meantime, here's the relevant code that works with your DLL:

function TfrmMain.ConvertImages: TConvertResult;type  TDXTcompressBMP = function(Data: PColor32Array; Width, Height: LongWord;	 Format: DWORD; bGenMipMaps, bDither: Boolean; Depth: DWORD;	 Filename: PChar): LongInt; stdcall;  TCombineAlphaDXT1 = function(pBaseFile, pAlphaFile, pOutFile: PChar):	 LongInt; stdcall;  THandle = Integer;var  DXTcompressBMP: TDXTcompressBMP;  CombineAlphaDXT1: TCombineAlphaDXT1;[b]...[/b]begin  // Load and initialize the DLL and functions.  hHandle := LoadLibrary('MWDDS.DLL');  if hHandle <> 0 then begin	@DXTcompressBMP := GetProcAddress(hHandle, 'DXTcompressBMP');	if @DXTcompressBMP = nil then	  Result := crNoDLLFunction;	@CombineAlphaDXT1 := GetProcAddress(hHandle, 'CombineAlphaDXT1');	if @CombineAlphaDXT1 = nil then	  Result := crNoDLLFunction;  end else	Result := crNoDLL;    try	[b]...[/b]	for iCount := 0 to BaseFiles.Count -1 do	begin	  [b]...[/b]		  if dwFormat <> TF_DXT1_1BitAlphaOld then		  begin			DXTcompressBMP(imgPreview.Bitmap.Bits,						   imgPreview.Bitmap.Width,						   imgPreview.Bitmap.Height,						   dwFormat, True, True,						   4, @pOutFile);		  end else begin			[b]...[/b]				CombineAlphaDXT1(@pBaseFile, @pAlphaFile, @pOutFile);	[b]...[/b]	end; {for}  finally	// Cleanup.	FreeLibrary(Handle);  [b]...[/b]  end; {try}end;

I coded it from the start to load the DLL, process the images, then unload the DLL. The number of textures processed before resources are depleted is system and memory dependant: on some systems, around 400 is the limit, on others as you say, it can be thousands.Thanks,http://members.rogers.com/eelvish/elrondlogo.gifhttp://members.rogers.com/eelvish/flyurl.gif

Share this post


Link to post
Share on other sites

ElrondUnless your email has changed you should have received a test-copy of mwgfx.dll that removes the leak problem.The leak is somewhere in the Library load/unload inside mwdds. Still can`t see where but by moving the code into mwgfx I do away with the need to load it from within mwdds. This stops the leak.

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