Seamless Fog Generator (Source Included)
BlitzMax Forums/BlitzMax Programming/Seamless Fog Generator (Source Included)
| ||
Years ago my Dad received a magazine that showed games and RPGs you could purchase for the commodore Amiga, which is the computer we had at the time. I remember looking over many screen shots and seeing that wood, marble, and other types of backgrounds were very popular for borders and fields that displayd messages. With a good deal of experimentation I managed to generate a program of sorts that used 4-colors to create an effect of appearing either as wood, marble, or smoke. Today, my brain can't really reach that far back but looking over some old QBasic code, I saw a program w no author listed as "EALAVA" that created a smeared effect and animated the background palette to make it look a bit like an amoeba or moving metal. I took that a step further, cut down on the blurriness, and made it so it would link from any side. So - what you have is a nice fog generator that builds an image that is seamless. That is, you can place a copy of it above, below, or to the sides and you cannot tell where the 'seams' in it begin. Useful for special effects in games, and of course if you don't want to take the time to create a new fog each run you can simply save off the image it generates and then use just that in your own game code when you want to have fog or mist in it. Enjoi ! Here is the QBasic source code, I cleaned up the margins a bit: |
| ||
Can't seem to edit the message above. Someone mentioned something about BlitzMAX forums having problems w this sometimes. Anyways, here is update I wanted to add: |
| ||
nice to see it being constructed needed to have the setgraphicsdriver removed for a mac though |
| ||
Hi Adam. Glad you like it. And yes, I don't know what drivers are needed for Macintosh. Adjust the code so it works for you. :) |