Jump to content
Sign in to follow this  
Guest artmartin

New utility seems to work great

Recommended Posts

Guest artmartin

As most of you know, I have a freeware autogen editing program out that's been well-used by designers. This weekend I added a new feature that I'm sure will be a help to many. I should have it ready for release soon. I used the existing program to add this feature even though they hardly seem related but found that the functionality of the program provided much of the code I would have to write.Basically, here's what it does. If you've created a large photoreal area with hundreds or thousands of tiles and chose not to create all the seasons at the same time, it can be daunting if you wish to later put in those other options, particularly the night lighting. There are already programs that will create the seasonal variations (generally only involves taking the source image and modifying colors) but the task of creating the lightmap file is a bit tougher. You can either go back to your source photo and edit that file (which generally is huge) or you can take each individual summer tile and hand edit it. The first option was difficult for me since I used a technique that did not require me to trim the edges of my source photo and the only tool that would translate that method (FS Resample Tools by Elrond Elvish), did not deal with seasonal and night variations. The second technique was just too much volume. The first version of my program had nearly 5,000 summer texture tiles. Last week, I found some wonderful freeware VB routines on the internet that dealt in edge detection in bitmap images as well as other types of graphics manipulations. I found that if you did the edge detection, inverted the image's colors, blurred it a bit and darkened it as needed, you came out with a wonderful night texture. My program was already designed to deal with large numbers of texture files and had the Martin Wright graphics routines built in to open DXT files. It also knew where all the autogen houses I created existed so I added a new module that would meet my bulk translation needs.Simply put, once you select the directory in the program where the texture files are located, you hit a button for creating the night textures and the code goes through each file in that directory, automatically alters a new image that highlights the main edges of roads, rivers, buildings, etc. and basically puts them over a black background. If there's no autogen defined for the tile, it generally means it's out in the boondocks so I greatly darken the result so that edges of mountains don't have bright lines defining them. If there are autogen buildings, I leave the brightness up a bit and put an airbrushed light effect radiating out from the center of the building so that the building will have lights around its edges. The program then builds the DXT1 file with the ...LM.BMP extension from the computed image in a separate folder. The orginally computed .bmp file is also saved in case you need to edit any further. The only thing I couldn't do was to preserve any alpha masking the orginal file might have. Martin Wright's routine to create the DXT1 file doesn't seem to do that but it just might be something I'm missing. My first run through was a complete success with the results of 4500 tiles completing in about 15 minutes. Once I got them to display in FS, I was blown away. Look at the screen shots forum for some examples.Anyway, I'll be putting out the new version soon. It's in rough form right now with no error trapping and just minimal user interface so I'll polish it a bit. Here's a question to designers. In order to display the night textures, I basically manually ran RESAMPLE.EXE against the original .inf file created by Elrond's program. That .inf file I edited so that it only defined the LightMap texture. The program creates the other seasons as well when you turn on that feature but all I cared about was that the .bgl file knew to look for textures other than summer. I just threw out the .tga files resample gave me. Seems there should be a simpler way to do this. I couldn't get the .bgl file to decompile to XML or ASM to edit and recompile so I'm assuming that's not an option. Am I mistaken here?Art

Share this post


Link to post
Share on other sites

Hi Art,wow, that sounds like a great feature to have. Night lights are definitely one of the daunting tasks for photoreal projects. Haven't seen any recent posts of yours in the SS forum but maybe they are not up yet.Not sure if I understand your question right but couldn't you just run the night texture as a regular summer bitmap and then have a batch file do the renaming?Cheers, Holger

Share this post


Link to post
Share on other sites
Guest artmartin

Holger, I probably didn't put the question right. The .inf file that gets created by FS Resample Tools by Elvish only deals with the summer texture and it's what I created my original tiles with. It's lacking the line that says - BuildSeasons = 1. The resulting .bgl file it produces doesn't know how to deal with the seasonal variations. You can fill the directory up with files with the various extensions and all you'll ever get is the daytime summer textures shown. Once I built my night textures, it would've been nice to be able to simply disassemble the .bgl file to XML, add in the lines, and recompile it to a .bgl. Obviously, the whole photoreal process works differently and only deals with .inf files instead of .xml. Problem is, Resample.exe seems to need to create texture tiles and won't just recompile the .bgl. What I did then is simply fool it into thinking I was creating the the night textures by feeding it the orginal graphic I used for the summer textures and it worked fine. I just deleted the .tga files it made then and saved the now seasonal .bgl file. What would be nice though is not having to sit through that tile creation process. Has to be a slick shortcut somewhere. The post in the screenshot forum got lots of looks but no replies so it retreated quickly. It's probably 5 or 6 pages down now. Here's one of the screen shots.Arthttp://forums.avsim.net/user_files/143624.jpg

Share this post


Link to post
Share on other sites
Guest RipPipPip

Hi Art,Autogen Editor is a pretty utility.I've installed v.1.066 and look at it now.By the way - is there a documentation somewhere, I could not spot it...[EDIT] Ooops- now I see it in the install directory: autogen editor.doc.Also - how to invoke lights generation? Or you did not published the function yet?Cheers Rysiek

Share this post


Link to post
Share on other sites
Guest artmartin

Haven't published that feature yet. Should be able to finish the UI soon.Art

Share this post


Link to post
Share on other sites
Haven't published that feature yet. Should be able to finish the UI soon.Art
Sorry to bring on an old topic. Is that feature already released? If so, where can I get it?Best regards from ColombiaLuis Miguel

Best regards,
Luis Hernández 20px-Flag_of_Colombia.svg.png20px-Flag_of_Argentina.svg.png

Main rig: self built, AMD Ryzen 5 5600X with PBO enabled (but default settings, CO -15 mV, and SMT ON), 2x16 GB DDR4-3200 RAM, Nvidia RTX3060 Ti 8GB, 256 GB M.2 SSD (OS+apps) + 2x1 TB SATA III SSD (sims) + 1 TB 7200 rpm HDD (storage), Viewsonic VX2458-MHD 1920x1080@120 Hz, Windows 10 Pro. Runing FSX-SE, MSFS and P3D v5.4 (with v4.5 default airports).

Mobile rig: ASUS Zenbook UM425QA (AMD Ryzen 7 5800H APU @3.2 GHz and boost disabled, 1 TB M.2 SSD, 16 GB RAM, Windows 11 Pro). Running FS9 there... sometimes on just battery! FSX-SE also installed, just in case. 

VKB Gladiator NXT Premium Left + GNX THQ as primary controllers. Xbox Series X|S wireless controller as standby/travel.

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