Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
uglputTranslucency
#1
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)
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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)