|
Author |
Message |
Anonymous
Member |
Does anybody have a source for a simple water effect like in the Sunsetglow intro (Thrust) ?
|
Cyf
Member |
it's not the best, but it's very simple, like raster effect (see Copper thread)
based on bitplane Modulo bplmod1, bplmod2
one line is made with : WAIT,MODULO1,MODULO2
ex. dc.w $240f,$fffe,$108,0,$10a,0
buffer in copperlist for example x lines :
buffer: ds.w x*6
fill this buffer, get modulo in a table (test your own. example : 80,40,160,0,120,-80,-40,-120... for a 40 width)
then cycle (change wait or/and modulos) values each frame, like with colors in raster.
the best is to make water effect on the reflect of a pic (use negative modulos)
|
noname
Member |
there was a contest for tiny-water on amycoders.org years ago. sources can be downloaded from that website.
|
Cyf
Member |
on amycoders, it's "pixels" water effect, not oldskool "water effect" with copper ^^
a simple example (Height=nbline*2) with copper wait move :
makelist:
lea listewait,a0
lea modulos(pc),a1
move.l #$240ffffe,d0 ; wait
move.w #nbline,d7
.loop
move.l d0,(a0)+ ; wait
move.w #$108,(a0)+ ; mod1
move.w (a1),(a0)+
move.w #$10a,(a0)+ ; mod2
move.w (a1)+,(a0)+
add.l #$02000000,d0 ; next line (+2 lines)
dbf d7,.loop
rts
move:
lea listewait,a0
move.w #nbline,d7
move.w shift(pc),d0
.loop
add.w d0,(a0) ; wait+shift
lea 6*2(a0),a0 ; next line
dbf d7,.loop
lea listewait,a0
cmp.b #4,(a0) ; amplitude clip
bne.s .ok
neg.w shift ; down
.ok
cmp.b #1,(a0)
bne.s .exit
neg.w shift ; up
.exit
rts
shift dc.w $100
modulo dc.w 80,40,160,0,120,... ; "Height" values
|
Cyf
Member |
also possible by changing bplxpt pointer at each line, and cycle colors
one line: wait,e0,x,e2,x,e4,x,e6,x,182,x,184,...
or only e2,x,e6,x...(if possible with size of pic)
and calculated position in pic from a table of pos.
|
bonkers
Member |
I've done a water effect (long time ago , can be seen in Tulou-Khold last part), it's pretty simple. I used the tutorial that can be found on Programmers Heaven (http://www.programmersheaven.com/d/click.aspx?ID=F15361). There is quite a bit of tweaking to be done to make this algo run descently in 1x1. Atleast I needed to do that , but I've never been able to code efficiently anyway =).
|
|
|