Atari colour warterfall effect

BlitzMax Forums/BlitzMax Beginners Area/Atari colour warterfall effect

Ian Lett(Posted 2011) [#1]
hi guys,

i am trying to recreate the atari logo colour watrerfall effect, (go see youtube for some vids), anyhoo i have a bmp logo in white (255,255,255) on black (0,0,0)

what i want to do is get the white part of the logo to display the color warterfall, i have some ideas but i have had no sucksess yet, any help here will be greatfully receved.

many thanks


ImaginaryHuman(Posted 2011) [#2]
One way is to draw the waterfall color thing first, then draw the atari shape on top of it - the atari shape will have alpha/mask where you want the hole to appear, render it in maskblend or alphablend.


Ian Lett(Posted 2011) [#3]
i tryed that first of all it does work but its a bit cluncky and slow, i also tryed to create a strip of animation images but again it was slow and cluncky, i am sure it can be done in code rather than in pre rendered gfx.


jkrankie(Posted 2011) [#4]
I guess i'd consider creating the Atari logo by defining the vertices for the shape in code, and then scrolling texture coordinates.

Cheers
Charlie


Ian Lett(Posted 2011) [#5]
ok with a bit of lateral thought, i have cracked it, i use a blank background image then recolor the pixsels by addressing them direct (a la pixmap), then i overlay a mask to create the final image, here is the code, it could do with tyding and i have to say its based on a number of other posts in the forums but the color cycling is all mine! you will need 2 images
light.png is the solid background
mask.png has the cutout to create the final effect.


thanks for the help any comment let me know

CODE:

Strict

Graphics 800,600

Global pixmap:TPixmap

Global image:TImage=LoadImage("light.png") 'this is the background image
Global mask:TImage=LoadImage("mask.png") ' this is the mask
Global color:Int=1
Global c:Int=254

While Not KeyDown(KEY_ESCAPE)
Cls

pixmap=LockImage(image)

Local P:Byte Ptr,x:Int,y:Int,w:Int,h:Int
Local red:Int,Green:Int,Blue:Int,alpha:Int

h=PixmapHeight(pixmap)-1
w=PixmapWidth(pixmap)-1

For y=1 To h

For x=1 To w

p=Pixmap.PixelPtr(x,y)

Red = P[0]
Green = p[1]
Blue = p[2]
Alpha = p[3]


Select color
Case 1
p[2]=c
p[1]=0
p[0]=0
p[3]=255


Case 2
p[2]=0
p[1]=c
p[0]=0
p[3]=255


Case 3
p[2]=0
p[1]=0
p[0]=c
p[3]=255

Case 4
p[2]=c
p[1]=c
p[0]=c
p[3]=255

End Select



Next
c=c-4
If c<1 Then
c=255
color=color+1
If color=5 Then color=1
EndIf

Next
UnlockImage(image)


DrawImage image,0,150
DrawImage mask,0,150

Flip

Wend
end


Kryzon(Posted 2011) [#6]
I don't think re-plotting the waterfall every cycle is the most efficient way of doing this.
With an animImage for your waterfall in the form of a rectangle not much bigger than your logo image, all you have to do is render your fully white "ATARI" logo, set the blend-mode to LIGHTBLEND* then draw the animated waterfall.
The waterfall's parts that fall on the black background won't be visible (as they'll be black as well), only having the parts that do fall on the logo showing up.

*After setting the LIGHTBLEND mode, anything that's drawn to the currently active buffer will be modulated by what is already in it, giving the visual phenomenon described above.