nesdev.com
http://forums.nesdev.com/

"TwistIT", a small demo/intro
http://forums.nesdev.com/viewtopic.php?f=12&t=17023
Page 1 of 3

Author:  Revenant [ Sun Feb 04, 2018 1:27 pm ]
Post subject:  "TwistIT", a small demo/intro

http://resistance.no/releases/snes/Twis ... elease.zip

https://www.youtube.com/watch?v=9qHBVDgwCiI

A little something I worked on over the last month or so for the oldschool intro compo at Demobit this weekend, where it ranked first (out of... two...) Contains some HDMA abuse and attempts at semi-fast realtime 3D without a coprocessor. Totals a bit smaller than 64kb.

Most of the code was written as experimental stuff at a few points throughout late 2017, and then around the new year we decided to put it together into an actual production. I used Optiroc's libSFX tools/library (which I also helped out with a bit during development) and snesmod for music.

Source: https://github.com/ResistanceVault/demo-twistit

Author:  lidnariq [ Sun Feb 04, 2018 1:44 pm ]
Post subject:  Re: "TwistIT", a small demo/intro

Also, http://www.pouet.net/prod.php?which=74656

Author:  psycopathicteen [ Sun Feb 04, 2018 2:22 pm ]
Post subject:  Re: "TwistIT", a small demo/intro

Thank God somebody made this demo. Now I have stuff to show if anybody says that the SNES can't do polygons without a Super FX chip.

Author:  drludos [ Sun Feb 04, 2018 3:57 pm ]
Post subject:  Re: "TwistIT", a small demo/intro

Excellent, I really like the music, and the polygon graphics / blending are great!

Kudos for finishing it, and I'm eager to see your next release!

One silly question from a newbie SNESdev: How are you doing the "title blinking". Do you use an identical graphical data with a dynamically modified palette, or did you simply make a small "blinking" animation using different sprites / tiles data?

Author:  creaothceann [ Sun Feb 04, 2018 6:06 pm ]
Post subject:  Re: "TwistIT", a small demo/intro

psycopathicteen wrote:
Now I have stuff to show if anybody says that the SNES can't do polygons without a Super FX chip.

Of course it can, the question is how many fps spf.

Author:  Espozo [ Sun Feb 04, 2018 6:20 pm ]
Post subject:  Re: "TwistIT", a small demo/intro

psycopathicteen wrote:
Thank God somebody made this demo. Now I have stuff to show if anybody says that the SNES can't do polygons without a Super FX chip.

There actually is another demo out there that pushes about the same number of polygons at the same size and framerate. Of course, for a person's first demo though, this is excellent.

We all know the main problem with producing 3D on the SNES though, is having to convert the framebuffer to the SNES graphics format once the frame is done, unless you can find a way to render unshaded polygons on a framebuffer using the SNES graphics format at a faster speed.

Author:  Revenant [ Sun Feb 04, 2018 6:52 pm ]
Post subject:  Re: "TwistIT", a small demo/intro

If you're referring to the demo I think you are:

Image

Even at its smallest size/number of faces, this is never running at more than 20 fps, whereas my large cube is a constant 30fps (and would probably get a little higher at a size that small). The other (24-face) shape runs between 15-20 fps depending on how much else is happening (unfortunately all the stuff happening in the NMI keeps it ultimately locked at 15).

(If you're talking about a different demo that I've somehow forgotten about, then never mind :))

There's also not really any "conversion" needed on the software side if you make good use of $2115. I can demonstrate better once I get around to releasing the source, but basically I render into two separate 1bpp buffers and DMA them individually such that they're basically "converted" to 2bpp on-the-fly.

drludos: The flashing logo just uses some alternate palettes which are generated from the normal one by bitwise-ORing the colors with a few increasing shades of grey. (I could have also just used multiple pre-made palettes, but doing it programmatically on the SNES seemed easier somehow)

Author:  Espozo [ Sun Feb 04, 2018 7:02 pm ]
Post subject:  Re: "TwistIT", a small demo/intro

Revenant wrote:
Even at its smallest size/number of faces, this is never running at more than 20 fps, whereas my large cube is a constant 30fps, and the other (24-face) shape runs between 15-20 fps depending on how much else is happening (unfortunately all the stuff happening in the NMI keeps it ultimately locked at 15).

Okay then; nevermind. :lol:

Revenant wrote:
but basically I render into two separate 1bpp buffers and DMA them individually such that they're basically "converted" to 2bpp on-the-fly.

What would you have to do to get 4bpp? 2bpp is pretty much irrelevant for an actual game.

Author:  Revenant [ Sun Feb 04, 2018 7:04 pm ]
Post subject:  Re: "TwistIT", a small demo/intro

4bpp is probably doable the same way (the "address translation" and "increment after high/low" bits in $2115 are the key). At that point you'd have to be more careful about DMA bandwidth, though; ultimately I'm DMAing 128x128x2bpp of pixel buffer which takes nearly the entire vblank period.

Author:  tepples [ Sun Feb 04, 2018 8:11 pm ]
Post subject:  Re: "TwistIT", a small demo/intro

How are the starting and ending phases in the twist layer calculated for each frame?

Author:  Revenant [ Sun Feb 04, 2018 8:39 pm ]
Post subject:  Re: "TwistIT", a small demo/intro

Basically, the value of "f(t)" (where f(x) is some relatively simple sinusoidal function and t is a frame/tick counter) is added to the current scanline number and then used as the parameter to two other similar functions which determine each scanline's horizontal position (with an appropriate phase difference between the two twisters) and the actual twist position (which you can probably guess is just vertical scrolling, and each of the two layers uses a different function for this part).

f(t) is also used for the translucent twister to determine per-scanline color math settings for the "in front/behind" pseudo-3D thing.

So basically the horizontal movement as well as the actual twisting are just functions of the frame and scanline numbers (something like "sin(y + sin(t))"; that's not literally the equation since there's some additional frequency/amplitude/phase twiddling going on but you probably get the idea).

Author:  tepples [ Sun Feb 04, 2018 9:02 pm ]
Post subject:  Re: "TwistIT", a small demo/intro

I was also interested in the per-frame calculation for the twist position at the top and bottom.

Author:  Revenant [ Sun Feb 04, 2018 9:33 pm ]
Post subject:  Re: "TwistIT", a small demo/intro

It's calculated the same way for the top and bottom as it is for every individual scanline (or rather, every two scanlines) in between, using a combination of elapsed frames and the scanline number (and two or three lookup tables for some fairly basic sine-based curves).

It's not really as sophisticated as it might look, I just generated some sinusoid tables and experimented with ways to combine them and factor in frame/scanline counts until it looked sort of cool. I couldn't really tell you any exact equations or anything without trying to "un-work" a bunch of loops and lookup tables :P

Author:  Sumez [ Mon Feb 05, 2018 1:20 am ]
Post subject:  Re: "TwistIT", a small demo/intro

Revenant wrote:
Even at its smallest size/number of faces, this is never running at more than 20 fps, whereas my large cube is a constant 30fps (and would probably get a little higher at a size that small). The other (24-face) shape runs between 15-20 fps depending on how much else is happening (unfortunately all the stuff happening in the NMI keeps it ultimately locked at 15).

15 FPS is still twice as good as Starfox, and without a coprocessor, I'd say that's a feat. Of course, running a game at that speed is an entirely different challenge altogether. But I'm looking forward to seeing where SNES demos will go from here. I feel like the hardware should allow programmers to get way more creative than what the MegaDrive allows.

Author:  Optiroc [ Mon Feb 05, 2018 3:16 am ]
Post subject:  Re: "TwistIT", a small demo/intro

Aha, neat trick with the bitplane conversion!

Page 1 of 3 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/