### Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

### Messages - boogop

Pages: 1  3 4
21
##### General coding questions / voxel waves
« on: April 04, 2018 »
Does anyone know of or have an example of this effect, the one that future crew had in second reality? The only example I've been able to find is by Insolit Dust who used to post here, but it's difficult to read and has enough hardcoded values that I can't really tell what it's trying to do. Any language should be okay, but it's more difficult for me to deconstruct an xy location if the video is addressed like unsigned char *b = DBuf + (a << + (a << 6) + i;

snippet from insolit dust, he posted a link to his site here so I hope this is okay!

Code: [Select]
`void Line(int x0, int y0, int x1, int y1, int hy, int s){ register int i;     int sx, sy;     int c,y,h,u0,v0,u1,v1,a,b,h0,h1,h2,h3;          sx = (x1 - x0) / 320;     sy = (y1 - y0) / 320;          for (i = 0; i < 320; i++)     {         u0 = (x0 >> 16) & 0xFF;         a = (x0 >> 8) & 255;         v0 = ((y0 >> 8) & 0xFF00);         b = (y0 >> 8) & 255;         u1 = (u0 + 1) & 0xFF;         v1 = (v0 + 256) & 0xFF00;                  h0 = HMap[u0 + v0];         h2 = HMap[u0 + v1];         h1 = HMap[u1 + v0];         h3 = HMap[u1 + v1];                  h0 = (h0 << 8) + a * (h1 - h0);         h2 = (h2 << 8) + a * (h3 - h2);         h = ((h0 << 8) + b * (h2 - h0)) >> 16;                  h0 = CMap[u0 + v0];         h2 = CMap[u0 + v1];         h1 = CMap[u1 + v0];         h3 = CMap[u1 + v1];                  h0 = (h0 << 8) + a * (h1 - h0);         h2 = (h2 << 8) + a * (h3 - h2);         c = ((h0 << 8) + b * (h2 - h0));                  y = (((h - hy) * s) >> 11) + (240 / 2);                  if (y < (a = LastY[i]))         {                unsigned char *b = DBuf + (a << 8) + (a << 6) + i;                int sc,cc;                                if (LastC[i] == -1)                   LastC[i] = c;                                   sc = (c - LastC[i]) / (a - y);                cc = LastC[i];                                if (a > 240 - 1)                {                      b -= (a - (240 - 1)) * 320;                      cc += (a - (240 - 1)) * sc;                      a = 240 - 1;                }                                if (y < 0)                   y = 0;                                   while (y < a)                {                      *b = cc >> 18;                      cc += sc;                      b -= 320;                      a--;                }                                LastY[i] = y;         }                  LastC[i] = c;                  x0 += sx;         y0 += sy;     }}`

22
##### General chat / Re: Hello there!!
« on: January 02, 2018 »
Nice to see some new faces! I'm also a fan of amiga demos, pretty much all I do are in that style

23
##### Challenges & Competitions / [Summer 2017] Summer of Love BBS
« on: June 19, 2017 »
Boogop's amazing summer demo! Loaded with ancient crusty effects you've seen a gorillion times before! Absolutely no new ground broken whatsoever!

Kludged up in Freebasic, Tinyptc_ext by RBZ, FMod for music (could have used Tinyptc_ext++ herp derp), FPS limiter by RBRAZ, FFNT_Lib by Deleter. Music is d3.mod by Necros. Is there anything in here by me?!

24
##### General chat / Re: Ideas for a new DBF compo
« on: April 28, 2017 »
TWO HOURS!! have mercy

25
##### General chat / Re: Ideas for a new DBF compo
« on: April 26, 2017 »
Ditto! Some summer theme sounds like a winnah

26
##### General chat / Re: Hello !
« on: April 19, 2017 »
Welcam Mon! What's yer language of choice?

27
##### C / C++ /C# / Re: [C#/GDI+] Xor Texture Tunnel (aka Fake 3D)
« on: April 11, 2017 »
Got a little more speed out of it. I love c# but eventually we run into the limitations of the language Code: [Select]
`        FastBitmap a = new FastBitmap(myTexture);        FastBitmap b = new FastBitmap(myBitmap);        for (int x = 0; x < bmp.Width; x++)        {          fixed (int* pDistance = &distanceTable[x, 0])          {            fixed (int* pAngle = &angleTable[x, 0])            {              for (int y = 0; y < bmp.Height; y++)              {                int xp = *(pDistance + y);                int xx = (xp + shiftX) % 128;                int ap = *(pAngle + y);                int yy = (ap + shiftY) % 128;                Color c = a.GetPixel(xx, yy);                b.SetPixel(x, y, c);              }            }          }        }`

28
##### C / C++ /C# / Re: [C#/GDI+] Xor Texture Tunnel (aka Fake 3D)
« on: April 11, 2017 »
Note: much discussion on bounds checking exists and unless you read the IL it's not easy to tell what the compiler is doing.

29
##### C / C++ /C# / Re: [C#/GDI+] Xor Texture Tunnel (aka Fake 3D)
« on: April 11, 2017 »
Glad to see some c#! All my contest entries so far have been in c#.

Two items jump out at me
1. Multi-dimension arrays. The compiler has to do bounds checks on those and it will tool your performance.
2. Getpixel. Even with fastbitmap these are bad. They make flame effects problematic in this language.

I can't tell what size your picturebox is but using gdi 640x480 is going to be about the limit. I find 350x350 or thereabouts works pretty good but above that starts really slowing down.

The game in c# is all about optimization. When I've done contest entries I sh1t you not the last couple months are spent optimizing.

30
##### C / C++ /C# / Re: [C#] SineWaveScroller w/Bitmap Font Support
« on: March 01, 2017 »
Nice to see work in c#! I've gotten a lot of mileage out of it and have done all my DBF compo entries in it. I use the FastBitmap class which allows direct pixel-pushing to the graphics object, which in my thirst for punishment I enjoy.

31
##### Freebasic / Re: 13 * 13 Sin Scroll font in binary
« on: February 09, 2017 »
Sorry to necro this thread but this is way cool! I was looking at the unenviable task of writing my own when I found this. I think it will do just fine!

32
##### General chat / Re: Merry Christmas 2016
« on: December 26, 2016 »
Merry Christmas dbfinteractive!

33
##### Freebasic / Re: Dot Tunnel
« on: November 23, 2016 »
This is a surprisingly low level language for all its VB trappings. I used to make my living in vb6 but this sure ain't that

34
##### Freebasic / Re: Dot Tunnel
« on: November 22, 2016 »
Liking this a lot! What's this all about?

Code: [Select]
`dim as integer w=any,h=any`

35
##### Freebasic / Re: Dot Tunnel
« on: November 22, 2016 »
Well,  tomorrow I can either fix a shop floor data collection app or mess around with this...wat do? lol the joys of 'padding the schedule'

36
##### Freebasic / Re: Dot Tunnel
« on: November 21, 2016 »
Yep, that works! Thanks!

But there's a basic design problem with the way I do tunnels. I've modified the algorithm from 3D stars, where each point in the circle is divided by Z in the processing loop, so each point moves towards the screen boundaries. Doing that I can never be outside the tunnel looking at it. See the attached screenshot below from Xography; treating each point on the circle like a 3D star, that view will never happen

37
##### Freebasic / Re: Dot Tunnel
« on: November 18, 2016 »
lol thanks! Freebasic is a new experience but I'm liking it a lot

38
##### Freebasic / Dot Tunnel
« on: November 17, 2016 »
Dot tunnels gave me fits trying to figure out. So here's one for the lulz, maybe it will help (or hinder) someone else!

Code: [Select]
`'''''''''''''''''''''''''''''''''''''''''''''''''''''''' DOT TUNNEL' by boogop' The c# logic from my entry for the Amiga' demo a year or so ago' - now in glorious lo-res!'' For me, dot tunnels were the hardest effect' to figure out. There didn't seem to be many' examples (before I found dbfinteractive, on' which there are several) and the ones I could' find on the intarnets or hornet archive were ' frequently not very good. Some of them' weren't tunnels at all, they were tubes with the' rings fixed in place. The best one I ever saw' was Crystal2 BBS addy by Xography but they never' released the source, and I haven't been able to' figure out how they were handling the movement path'''''''''''''''''''''''''''''''''''''''''''''''''''''''#include "tinyptc_ext.bi"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' screen dimensions & put_pixel routine'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''const screenWidth = 320const screenHeight = 200const SCR_SIZE as integer = screenWidth*screenHeight dim shared buffer( 0 to SCR_SIZE-1 ) as integer dim shared as uinteger ptr pntr dim shared as integer ptr pdeclare sub put_pixel(buffer() as integer, byval x as integer, byval y as integer, byval col as integer) ' this may be Shockwave's routine!sub put_pixel(buffer() as integer, byval x as integer, byval y as integer, byval col as integer)     if(y < screenHeight -1 and y > 1) then        if( x < screenWidth-1 and x > 1 ) then                         PNTR = @buffer(y * screenWidth + x)                         asm                mov eax, dword ptr[col]                mov edi, [pntr]                                stosd            end asm                         end if    end ifend sub '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' declare variables''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' type colors    dim as integer r,g,b end typedim shared as colors colArray(256)const _pointsPerCircle = 20const _numCircles = 35dim shared as double zDistance = 8' named star because I lifted it from my 3d starfield code :)type star    dim as double xpos, ypos, speed, zpos    dim as double origX, origY, origZ    dim as integer oldx,oldyend typedim shared as star circles(_numCircles, _pointsPerCircle)dim shared as double maxZ = 0dim shared as double diam = 50dim shared as double xp,yp,zp,increment, px, py, skew, skewCountdim shared as integer angle = 0dim shared as double zPos = 1dim shared as integer angleAdder = int(360 / _pointsPerCircle)     dim shared as double zPosAdder dim shared as double midWidth = screenWidth / 2dim shared as double midHeight = screenHeight / 2dim as integer i,j, xpathcountdim as double rad = 3.1416 / 180.0'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' set initial values'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''skewCount = .0001zPosAdder = zDistance / _numCirclesfor  j = 0 to  _numCircles        for  i = 0 to _pointsPerCircle          dim as double Y =  diam * Sin(angle * rad)      dim as double X = 2 * diam * Cos(angle * rad) ' make it oval shaped for the lulz      circles(j, i).xpos = X      circles(j, i).ypos = Y          circles(j, i).speed = .0025      circles(j, i).zpos = zPos      circles(j, i).origX = X      circles(j, i).origY = Y            circles(j, i).oldx = 0      circles(j, i).oldy = 0          angle += angleAdder        next izPos += zPosAddernext j      maxZ = 0' figure out the largest z valuefor  j = 0 to _numCircles    for i = 0 to _pointsPerCircle             if circles(j, i).zpos > maxZ then            maxZ = circles(j, i).zpos        end if        next inext jincrement = 0' fill color array     i = 0while i < 256          dim as single red = 1 + Cos(i * 3.14 / 128)    dim as single grn = 1 + Cos((i - 85) * 3.14 / 128)    dim as single blu = 1 + Cos((i + 85) * 3.14 / 128)    colArray(i).r = int(red * 127) mod 256    colArray(i).g = int(grn * 127) mod 256    colArray(i).b = int(blu * 127) mod 256    i = i+1wend'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' run the thing''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''ptc_setdialog(1,"FullScreen?",0,0)if( ptc_open( "freeBASIC - tinyPTC Dot Tunnel", screenWidth, screenHeight ) = 0 ) then    end -1end ifwhile inkey() <> chr(27)         if skew <= 1 then        skew = skew + skewcount    end if         for  i = 0 to _numCircles               for  j = 0 to _pointsPerCircle                      ' erase the last point            put_pixel Buffer(),circles(i, j).oldx,circles(i, j).oldy,0            put_pixel Buffer(),circles(i, j).oldx+1,circles(i, j).oldy,0                        ' bring each circle towards the viewer            circles(i, j).zpos -= circles(i, j).speed                        ' if a circle is close enough to the viewer, send it to the back            ' using the maximum z value            if circles(i, j).zpos < 2 then                            circles(i, j).xpos = circles(i, j).origX                circles(i, j).ypos = circles(i, j).origY                circles(i, j).zpos = maxZ             end if                        ' most compilers will perform some kind of bounds checks, and those            ' will really bog an app down. Cast the array to vars so any bounds            ' checking only has to happen once            xp = circles(i, j).xpos            yp = circles(i, j).ypos            zp = circles(i, j).zpos                        ' kludgey color fader lol            dim as double cc = 1 - Abs(zp / (maxZ * .8))            if (cc < 0) then                cc = 0            end if            if (cc > 1) then                cc = 1            end if            dim as integer c = int(300 * cc)            if c > 255 then                c = 255            end if            dim as integer co = rgb(colArray(c).b,colArray(c).r,colArray(c).g)            if zp > int(maxZ * .6) then                co = rgb(colArray(c).b/2,c,c)            end if                           ' zpos isn't quite right and doesn't bring the circles as close           ' as it should but I don't feel like fixing it!            dim as double z = zp - 1.5                        ' path of the tunnel            px = 50 * Sin(z * skew * sin(increment))            py = 40 * Cos(z * skew * cos(increment))                                   ' calculate perspective, add path, align to center screen            dim as double sx = (xp / z) + px + midWidth            dim as double sy = (yp / z) - py + midHeight                        dim as integer ix = int(sx)            dim as integer iy = int(sy)                                  put_pixel Buffer(),ix,iy,co            put_pixel Buffer(),ix+1,iy,co                                   ' save the current pos so we can erase it in the next iteration            circles(i, j).oldx = ix            circles(i, j).oldy = iy                    next j    next i               increment +=.0005               ptc_update @buffer(0)  wend `

39
##### Freebasic / Fractal Zoomer
« on: November 09, 2016 »
Here's a version of the fractal zoomer from R.I.P. Boogop converted to freeBasic/ASM. I'd love to figure out a way around having to iterate over each pixel 300 times because that's where all your performance goes. It drives me nuts. This seems about as optimized as I know how to make it; if you focus optimizing anywhere else but the iteration loop it's a red herring, that loop is the killer. There are ideas around to split the screen in half and render each half in a separate thread, but that's still working around the central problem of the inability to determine if an equation is going to go to infinity without doing it 300 times.

On my work PC (LoMem Kludge-0-Matic 100) I get to the lose-resolution point in about 22 seconds. If you want to go deeper you'll need to tweak horizPosAdjust and vertPosAdjust to position yourself where you want to be

Code: [Select]
`''''''''''''''''''''''''''''''''''''''''''''''''''' MANDELBROT ASM ZOOMER TEST' by boogop' this may be a little faster than the FB version ' but I'm sure I've done lots of stuff wrong or fb ' is just smarter than I am lol' Where this loses resolution is about the limit' of a single data type. Converting to double will' zoom farther in but also take longer''''''''''''''''''''''''''''''''''''''''''''''''''#include "tinyptc_ext.bi"' 350 x 325 to size it the same as the c# effectdim shared as integer screenWidth = 320dim shared as integer screenHeight = 200const SCR_SIZE as integer = 320*200dim shared as integer ptr pdim shared buffer( 0 to SCR_SIZE-1 ) as integer dim shared as uinteger ptr pntr dim shared as integer w, h, h2' initial valsdim shared as single a1 = -2.5dim shared as single b1 = -1.5dim shared as single ax1 = -2.5dim shared as single ax2 = 1.5dim shared as single bx1 = -1.5dim shared as single bx2 = 1.6dim shared as single bailnum = 2.0dim shared as single bailGT1 = 1.3dim shared as single bailLT1 = -1.3dim shared as single z1, z2, z3, dx, dy, crx, yy, cr, ci', dydxdim shared as integer k = 0    dim shared as single wwdim shared as single hhdim shared as single a1w, b1hdim shared as single awdim shared as single bhdim shared as single zoom = 1dim shared as uinteger colSingle(300)declare sub initdeclare sub DrawMandelbrotdeclare sub CreateMandelbrot(a1 as single, a2 as single, b1 as single, b2 as single)declare sub put_pixel(buffer() as integer, byval x as integer, byval y as integer, byval col as integer) sub init            w = screenWidth    h = screenHeight        h2 = h / 2             ' these coords put us in scepter valley    a1 = 153.41801      b1 = h2 - 8.650006           ' if you change the size of the window you have to figure out where in the    ' mandelbrot set you are - not easy! >:(    dim as single horizPosAdjust = 13.24    dim as single vertPosAdjust = 1.5        a1 = a1 - horizPosAdjust    b1 = b1 - vertPosAdjust        ww = ax2 - ax1    hh = bx2 - bx1        a1w = a1 * ww    b1h = b1 * hh        aw = a1w / w    bh = b1h / h        dim i as integer = 0    ' usually the array would be dimensioned to 256 but if we set it to the    ' number of iterations we can skip a mod operation    while i < 300              dim as single red = 1 + Cos(i * 3.14 / 128)        dim as single grn = 1 + Cos((i - 85) * 3.14 / 128)        dim as single blu = 1 + Cos((i + 85) * 3.14 / 128)                dim as integer r = int(red * 127) mod 256        dim as integer g = int(grn * 127) mod 256        dim as integer b = int(blu * 127) mod 256                colSingle(i) = rgb(r,g,b)                     i = i+1    wend           end subsub DrawMandelbrot            zoom = zoom + (zoom * .05)    dim as single d = zoom + zoom        dim as single wax = ww / d    dim as single wah = hh / d            dim as single newleft = aw + ax1 - wax    dim as single newright = aw + ax1 + wax    dim as single newtop = bh + bx1 - wah    dim as single newbottom = bh + bx1 + wah        CreateMandelbrot(newleft, newright, newtop, newbottom)    end subsub CreateMandelbrot(a1 as single, a2 as single, b1 as single, b2 as single)        p = @buffer(0)        dim as single dr = (a2 - a1) / w    dim as single di = (b2 - b1) / h    dim as integer j = 0    dim as integer i = 0    dim as single temp, q, a, b    dim as single dx1, dy1        dim as single ptr t    'dim as string key        for j = 1 to h                ci = b1 + j * di                  for i = 0 to w-1                         cr = a1 + i * dr                        dx1 = 0.0            dy1 = 0.0                                         ' PERIOD CHECKING             ' if we can tell we're inside the cardiod or period-2 bulb we can skip the iterations.            ' period checks make the routine blaze until we're past them but the iteration loop is            ' the big problem            crx = cr + 1.0            yy = ci * ci                        if ((crx * crx) + yy < .0625) then                                ' checks for a point inside the period-2 bulb                ' but once you're past that it does nothing                *p = 0                goto bail                            end if                        ' check for cardiod bulb            temp = cr - .25            t = @temp           ' q = temp * temp + yy            q = (*t) * (*t) + yy            a = q * (q + *t)            b = .25 * yy            if (a < b) then                               *p = 0                goto bail                            end if                       ''''''''''''''''''''''''''''''''''''                  ''''''''''''''''''''''''''''''''''''            ' SSE ITERATION LOOP            ''''''''''''''''''''''''''''''''''''               ''''''''''''''''''''''''''''''''''''             k = 0               ' 32 bit singles are only taking up 1/4 of these registers            asm                mov cx, 0                movss xmm2, [ci]                movss xmm3, [cr]                                  @starter:                              movss xmm0, [dx1]                mulss xmm0, xmm0                 movss [z1], xmm0        'z1 =  dx1 * dx1                                                movss xmm1, [dy1]                  mulss xmm1, xmm1                   movss [z2], xmm1        'z2 =  dy1 * dy1                                                              addss xmm0, xmm1        ' z1 + z2                                     comiss xmm0,[bailnum]   ' if z1 + z2 > 2.0                 ja @asmdone                                                  inc cx                  ' handle the iterations counter                cmp cx, 300                je @asmdone                                movss xmm0, [dx1]                movss xmm1, [dy1]                mulss xmm0, xmm1        ' dy1 * dx1                                addss xmm0, xmm0        ' (dy1 * dx1) + (dy1 * dx1)                                addss xmm0, xmm2        ' + ci                movss [dy1],xmm0        'dy1 = (dy1 * dx1) + (dy1 * dx1) + ci                                               movss xmm0, [z1]                movss xmm1, [z2]                subps xmm0, xmm1        ' z1 - z2                               addss xmm0, xmm3        ' + cr                movss [dx1],xmm0        'dx1 = z1 - z2 + cr                                                 jmp @starter                                            @asmdone:                 mov [k],cx            end asm            '''''''''''''''''''''''''''''''''''''               '''''''''''''''''''''''''''''''''''''            '''''''''''''''''''''''''''''''''''''            if k = 300 then                *p = 0            else                               *p = colSingle(k)            end if                        ' print k, z3, dx1, dy1            ' key = INKEY            ' WHILE key = "": key = INKEY: WEND            bail:                        p = p + 1                    next i    next j    end subptc_setdialog(1,"FullScreen?",0,0)ptc_open( "tinyPTC Mandelbrot test", screenWidth, screenHeight )'dim as string key'print "Press to start"'WHILE key = "": key = INKEY: WENDinitdim as single t1,t2t2 = timerwhile inkey() <> chr(27)        t1 = timer        DrawMandelbrot    ptc_update @buffer(0)        print t1 - t2    Wend`

40
##### Challenges & Competitions / [Halloween 2016] R.I.P. Boogop
« on: October 28, 2016 »
R.I.P BOOGOP (getting some halloween correlation is really reaching!)

C#, .NET 4, VS2015, SharpMod for music, hopefully most folks will be able to run it without having to install a bunch of cruddy .NET which you probably wouldn't do anyway! No frameworks, only GDI with getpixel/putpixel [pointer] routines and bmp.drawstring. The drawback to doing things that 'oldskool' way is I have to limit the form size to get acceptable performance (particularly for the fractal zoomer), do my own sucky 3D, load my own textures [into int arrays] blahblah.

optimizing assumptions
- must have a doevents each time through the demo loop for the app to behave while rendering
- add is faster than mult (old assumption that may no longer be valid)
- bounds checking gets exponentially worse with 2-dim arrays so use multiples of 1 whenever possible
- switch is faster than if due to jumptable opcodes
- C# is optimized for doubles
- using pointers anywhere but the actual drawing would p-r-o-b-a-b-l-y be slower (much discussion on this exists)
- use bitwise ops whenever possible (&=, >>, <<)

Notes on some of the FX (I really need to get out of the early 90's, man)

FRACTAL ZOOMER
- my two problems with fractal zooming is the thing wants to spend longer and longer in the escape-time loop to get resolution at depth, and eventually you run into the limits of a double variable type. After I'd gotten the thing working I dug around in the IL and optimized it based on what I saw the compiler emitting, though I'm guessing on some of the commands (just for kicks I rewrote this in freebasic with ASM for the inner loop, SSE instruction set, and it was slow as crap. But it may be my retarded asm too)
XOR
- these are lulzy and look really oldskool if you live in the past like I do
BOBS
- there's a few of these in here for ball-0-ween lolz
DOT LANDSCAPE
- I'm really pleased with this, I worked the problems out of the one I used in my last demo and tweaked it until it looks close to 'fake demo' by Pelusa which I love
VECTOR BALLS
- The problem with these is whatever I do with them they usually end up looking like Tumblin's 94 demo unless you just bounce them around like Scoopex, but that was less interesting
TRIPLASMA
- I liked Argon by Matrix (1997), however this ain't that. I draw three plasmas on top of each other and skip the black values in the color array. What I've done is probably not a true tri-plasma and Argon seems to be doing some blending that eludes me. But even if I translated it directly it wouldn't look the same. STOSW in c# --> lololol
PLASMA CLOUDS
- a modification of the effect I used last time which drew the plasma then rotated the palette. This one attempts to do it in realtime by using values in arrays to redraw the map instead of getPixel each time which is a killer. For some reason this wants to migrate to the bottom right. Meh, palette rotation actually looks better.

CREDZ
skull graphic, palm tree and a few others from some public domain clipart collection I can't remember, openclipart maybe
Music is starlitdeception.mod by Necros. Dude was one of the best trackers ever
Font is some free thing but I call bmp.SetResolution(320, 200) which doesn't affect the actual drawing but causes the font to be rendered in glorious lo-res lol

Pages: 1  3 4