Heaven/TQA #1 Posted April 27, 2010 I know I posted that very good demo here some time ago... http://noname.c64.org/csdb/release/?id=81157 I am not interested in the fx of the rotating pic divider but more in the often seen transition between bitmap gfx... how is it done as you normaly can not precalc all the "black chars" to whipe the screen off? is it simply a plasma-like fx in terms of adding several sin/cos values together? Quote Share this post Link to post Share on other sites
candle #2 Posted April 27, 2010 if you're reffering to the transition effect for the pics - i don't know how it was done on c64, but on a pc you would use another table of resolution of your primary screen buffer and just show pixels that would fulfill following equation let lookup(x,y) will return the value of byte at x,y of lookup table let buffer[x,y] will be primary screen buffer let picture[x,y] will be our picture let frame will be frame counter for frame=0 to 255 for y=0 to y_res for x=0 to x_res if lookup[x,y]<frame then pixel=0 else pixel=picture[x,y] buffer[x,y]=pixel next x next y sync next frame if you replace lookup table with (x,y) function you'll get something you (in my understanding) want function used for lookup table should be continuous - interference pattern would be a good example for this Quote Share this post Link to post Share on other sites
Heaven/TQA #3 Posted April 28, 2010 Thanks Candle, sounds interesting. so in theory you would need 40x25 buffers? as the c64 ones are normally not doing it by pixel but by char basis... Quote Share this post Link to post Share on other sites
Rybags #4 Posted April 28, 2010 I think the circular fade in/out is just doing selective masking while in the copy/erase phase. Check some of the transitions, colours appear that aren't actually in the square, so it's like e.g. using an initial AND mask of $55, then copying in the full data a little later. Quote Share this post Link to post Share on other sites
Heaven/TQA #5 Posted April 28, 2010 but when I dealt with such things the issue was always for me not to leave "holes" in terms of rounding issues while adding sin/cos values? on c64 common fx but had not see these transitions on A8? So I am still interesting how they do it? it is simple but still not get an idea yet... maybe TMR & Pete can send some light.. Quote Share this post Link to post Share on other sites
Rybags #6 Posted April 28, 2010 If you're only dealing with a circle in a 40x25 context, the table size doesn't have to be very big... a circle with radius of 20 pixels won't have many points in a quadrant. And you only need to maintain tables for 45 Degrees worth of area. Quote Share this post Link to post Share on other sites
candle #7 Posted April 28, 2010 in theory picture in lookup table looks like shaded ball for circle efffect (if displayed as 256 value grayscale picture) - thats all it takes Quote Share this post Link to post Share on other sites
PeteD #8 Posted April 28, 2010 There are lots of ways to do it, some already mentioned by the guys above. You can (as candle said) have a "shaded ball" with say 0 in the center out to whatever is your max value, scan through it and every time you find your current "expansion" value in the table process that square. Slow due to the scan through the table maybe unless you do a quicker outwards scan a bit like a simple fill routine. You could do the sin/cos or circle routine and not worry about accuracy by calculating it on pixels but then shift it to char squares. The demo takes a few frames to change each 8x8 area so it'd have time to ignore some passes as it was processing the current squares. Just flag the ones already being processed. It's probably possible to do something where you kind of sprite a char based circle of a certain size in sin/cos patterns. That way you can move it round in a circle processing newly touched squares and also get those other effects that seem more complex than the simple expanding circle. Quite hard to explain what I mean there Kind of like those additive "blob" things where 2 things seem to merge as they get closer which you can also do with the greyscale/0-255 shape thing. The most likely from watching the demo does seem to be the plasma style 0-255 ball/other pattern as it seems to process the transition scanning across X (or left and right from the center X). Pete Quote Share this post Link to post Share on other sites
candle #9 Posted April 28, 2010 anyone remembers LodeRunner? perhaps its time to hit "debug" button in Altirra? Quote Share this post Link to post Share on other sites
+JAC! #10 Posted April 28, 2010 (edited) Hi, Why Rybags said. To enumerate the 20*12 tiles as (x,y) of the upper left corner in any sequence you like (circle, ellipse, square, random) takes not more that 20*12*2=480 bytes. The rest is mirroring. For every step or radius you actually have to fade the tile on C64 by modifying the 2 color relevant bytes in one tile (C64 multicolor gfx use 2x4 bit from the 40x24 char map and 1x4 bit from the 40x24 color map for coloring the 3 possible pixel values). Assuming the circle as pattner, you have to update at most 4*20*(1+1)=320 bytes per refresh. The creative part is defining an enumeration sequence which looks good - and find color table which makes 16 fixed color "fading" look good. And that's why I like Andropolis a lot, too JAC! Edited April 28, 2010 by peter.dell Quote Share this post Link to post Share on other sites
+Stephen #11 Posted April 29, 2010 anyone remembers LodeRunner? perhaps its time to hit "debug" button in Altirra? I remember that - I was very impressed because I remember how terribly slow Atari BASIC was at drawing a circle. Seemed like magic to me at the time Quote Share this post Link to post Share on other sites
Heaven/TQA #12 Posted April 29, 2010 (edited) ok. got it... it is very simple to be honest... in max you are gonna scan through a 40x25 buffer which holds the "mask" which char will be displayed when... so as Candle mentioned his "frame"... I would call it threshold value... so f.e. imagine circles with the value of their radius... so inner circle starts with value 1, next circle with value 2 etc... so in frame 0 I am checking which value of the mask is below the frame counter and if below I am gonna display the char... so really nothing special... jesus... far simpler than thought... Edited April 29, 2010 by Heaven/TQA Quote Share this post Link to post Share on other sites
Rybags #13 Posted April 29, 2010 Even simpler... since it's symetrical you only need a quarter area mask. Quote Share this post Link to post Share on other sites
PeteD #14 Posted April 29, 2010 Yeah, symmetrical shapes you can reduce the mask size. That demo does some non-symmetrical stuff though so if you're looking at more than 1 transition just go with the full screen byte/char size thing. There's another demo with a similar effect and I can't remember which one it is but instead of slowly transitioning to black it uses concentric circles/shapes in an almost plasma greyscale manner to rapidly transition between 2 images. That's REALLY impressive looking ahhh just found it after taking a pause in typing.. http://noname.c64.org/csdb/release/?id=72559 It's 3 colour screens (as far as I can tell) so possibly for speed reasons. Quote Share this post Link to post Share on other sites
Heaven/TQA #15 Posted April 29, 2010 Pete, thanks for sharing... but where is the "transition"??? I love the demo... the flip-fx at the beginning is good, same to the "rubber"-bars... still one of the fx I still want to code... maybe after Gridrunner I will do an intro... Quote Share this post Link to post Share on other sites
Heaven/TQA #16 Posted April 29, 2010 (edited) random transition by char is far more simple then... tab(0...255)=rand(255) c=0 repeat for y=0 to 24 for x=0 to 39 if tab(x,y)<c then put_char(x,y) next x next y c=c+1 until c=255 aaarg... I need to become nearly 40 years old to get that... Edited April 29, 2010 by Heaven/TQA Quote Share this post Link to post Share on other sites
PeteD #17 Posted April 29, 2010 (edited) Pete, thanks for sharing... but where is the "transition"??? I love the demo... the flip-fx at the beginning is good, same to the "rubber"-bars... still one of the fx I still want to code... maybe after Gridrunner I will do an intro... lol, as soon as that flip has finished and the instinct/horizon text is gone, it's continually transitioning between 2 different images, look again *Edit* Vertical rubber bars/twister is eaaaaaaaaasy on A8, just LMS, horizontal, not so much Still not rocket science, but a bit more difficult. Pete Edited April 29, 2010 by PeteD Quote Share this post Link to post Share on other sites
Heaven/TQA #18 Posted April 29, 2010 aaaah... these are 2 pics... I thought it is only a plasma over the pic... Quote Share this post Link to post Share on other sites
PeteD #19 Posted April 29, 2010 aaaah... these are 2 pics... I thought it is only a plasma over the pic... It's a shame it is quite hard to see until you really look. Pete Quote Share this post Link to post Share on other sites
Heaven/TQA #20 Posted April 29, 2010 yeah...same colors, little difference imho... Quote Share this post Link to post Share on other sites
Heaven/TQA #21 Posted April 29, 2010 (edited) Pete, thanks for sharing... but where is the "transition"??? I love the demo... the flip-fx at the beginning is good, same to the "rubber"-bars... still one of the fx I still want to code... maybe after Gridrunner I will do an intro... lol, as soon as that flip has finished and the instinct/horizon text is gone, it's continually transitioning between 2 different images, look again *Edit* Vertical rubber bars/twister is eaaaaaaaaasy on A8, just LMS, horizontal, not so much Still not rocket science, but a bit more difficult. Pete yeah, I know that the bars are easy... but well... the hard thing for me would be to get the gfx right... and I never coded one so that's one of the reasons why... ok... not 100% right if you look at the APAC pic distorter I have done 1991... http://atari.fandal.cz/detail.php?files_id=224 Edited April 29, 2010 by Heaven/TQA Quote Share this post Link to post Share on other sites
PeteD #22 Posted April 29, 2010 Yeah, I've got a 1/2 done demo with some twister bars, I got a guy to render mine in 3D studio Pete Quote Share this post Link to post Share on other sites
Heaven/TQA #23 Posted April 30, 2010 (edited) thanks guys... it is so damned easy...... boot turbo basic... then type LOAD "D:TRANS.TUB" and press WARP button in your emulator to run at full speed... 1 GRAPHICS 0:COLOR 1 2 FOR I=0 TO 19:TEXT RAND(39),RAND(16),"ATARI":NEXT I 5 SCR=DPEEK(88) 10 MOVE SCR,$6000,960 20 GRAPHICS 0 21 DEG 22 SCR=DPEEK(88) 25 C=0 30 FOR R=1 TO 23 35 FOR I=0 TO 359 STEP 360/256 40 X=19+INT(R*SIN(I)):Y=12+INT(R*COS(I)) 45 IF X<0 OR X>39 OR Y<0 OR Y>23 THEN 55 50 POKE SCR+X+Y*40,R 55 NEXT I 60 NEXT R 90 MOVE SCR,$6400,960 100 GRAPHICS 0 110 C=0 120 REPEAT 130 FOR Y=0 TO 23 140 FOR X=0 TO 39 150 IF PEEK($6400+X+Y*40)<C 160 POKE SCR+X+Y*40,PEEK($6000+X+Y*40) 170 ENDIF 180 NEXT X 190 NEXT Y 200 C=C+1 210 UNTIL C=40 TurboBasicXLv1.5.atr.zip Edited April 30, 2010 by Heaven/TQA Quote Share this post Link to post Share on other sites
candle #24 Posted May 1, 2010 seems like my original idea Quote Share this post Link to post Share on other sites
Heaven/TQA #25 Posted May 1, 2010 yup. and it is really very simple... as others mentioned... the creative part is creating the mask... but your frame counter approach was the break through... thanks! one miracle solved in life... Quote Share this post Link to post Share on other sites