Is there a way, in a predefined square area of the screen (or even circular area), to modify the colors such that it is almost like a light being shined into an otherwise "dark" area. I was thinking to make all light grey, white and all dark grey, black, but I'm not sure if that would be an accurate effect.

Anyone any ideas?
Assuming you already have a pair of buffers for grayscale, one thing you could do is decrease the lightness one level for all pixels r1 <= radius < r2 pixels from the center (white -> light gray, light gray -> dark gray, dark gray -> black), decrease it two levels for r2 < radius <= r3 (white -> dark gray, everything else to black), then fill with black outside radius r3. That would not be smooth, though, so you'd probably want to consider some dithering. You could pre-define a very nice-looking dithered mask if you have 768 bytes free for it in your program.
KermMartian wrote:
Assuming you already have a pair of buffers for grayscale, one thing you could do is decrease the lightness one level for all pixels r1 <= radius < r2 pixels from the center (white -> light gray, light gray -> dark gray, dark gray -> black), decrease it two levels for r2 < radius <= r3 (white -> dark gray, everything else to black), then fill with black outside radius r3. That would not be smooth, though, so you'd probably want to consider some dithering. You could pre-define a very nice-looking dithered mask if you have 768 bytes free for it in your program.


I actually might have 768 bytes. Depends on the total size of the program without it. The data section as of now looks to be in the ballpark of 5 kB, so I don't suppose its too bad.

Btw, how is rendering a masked sprite different to rendering a normal sprite. I know that in concept, its limited to three-level greyscale, with the white configuration actually being transparent, but when I had a look at how Axe handles it, my brain exploded.
bump
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement