Qbasicnews.com
November 22, 2019, 06:48:27 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: uglputTranslucency  (Read 1348 times)
Agamemnus
x/ \z
*****
Posts: 3491



« on: July 13, 2003, 12:00:49 AM »

Someone implement this. I desperately need shading for air units and future buildings.. :|

Quote

1) UglPutTranslucency1 (target as long, startx as integer, starty as integer, source1 as long, source2 as long)

source2 is an 8bit DC.

For every color component of every pixel in source1, if the corresponding source2 pixel is 1, shade that pixel by reducing each color value by 1/2. (could be 2 if UGL supported it..)

2) UglPutTranslucency2 (target as long, startx as integer, starty as integer, source1 as long, source2 as long, shadevalue as integer)

source2 is an 8bit DC.

For every color component of every pixel in source1, if the corresponding source2 pixel is 1, shade that pixel by multiplying each color value by shadevalue/255 (shadevalue/255 is precalculated).

3) UglPutTranslucency3 (target as long, startx as integer, starty as integer, source1 as long, source2 as long)

source2 is an 8bit DC.

For every color component of every pixel in source1, multiply it by source2 and divide by 255.

-------------------------------

Note: 8 bit needs to only be divided by 2, as all colors are evenly distributed. (right? right?) If only there was 24bit! (stabs self)
Logged

Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!