It is currently Fri Dec 14, 2018 5:12 pm

All times are UTC - 7 hours



Forum rules





Post new topic Reply to topic  [ 31 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Sun Feb 04, 2018 1:27 pm 
Offline

Joined: Sat Apr 25, 2015 1:47 pm
Posts: 427
Location: FL
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


Last edited by Revenant on Wed Feb 07, 2018 8:42 am, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sun Feb 04, 2018 1:44 pm 
Online

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7825
Location: Seattle
Also, http://www.pouet.net/prod.php?which=74656


Top
 Profile  
 
PostPosted: Sun Feb 04, 2018 2:22 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2777
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.


Top
 Profile  
 
PostPosted: Sun Feb 04, 2018 3:57 pm 
Offline

Joined: Mon Dec 11, 2017 4:01 pm
Posts: 28
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?


Top
 Profile  
 
PostPosted: Sun Feb 04, 2018 6:06 pm 
Offline
User avatar

Joined: Mon Jan 23, 2006 7:47 am
Posts: 145
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.


Top
 Profile  
 
PostPosted: Sun Feb 04, 2018 6:20 pm 
Offline
Formerly Espozo
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3406
Location: Richmond, Virginia
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.


Top
 Profile  
 
PostPosted: Sun Feb 04, 2018 6:52 pm 
Offline

Joined: Sat Apr 25, 2015 1:47 pm
Posts: 427
Location: FL
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)


Top
 Profile  
 
PostPosted: Sun Feb 04, 2018 7:02 pm 
Offline
Formerly Espozo
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3406
Location: Richmond, Virginia
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.


Top
 Profile  
 
PostPosted: Sun Feb 04, 2018 7:04 pm 
Offline

Joined: Sat Apr 25, 2015 1:47 pm
Posts: 427
Location: FL
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.


Top
 Profile  
 
PostPosted: Sun Feb 04, 2018 8:11 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20876
Location: NE Indiana, USA (NTSC)
How are the starting and ending phases in the twist layer calculated for each frame?


Top
 Profile  
 
PostPosted: Sun Feb 04, 2018 8:39 pm 
Offline

Joined: Sat Apr 25, 2015 1:47 pm
Posts: 427
Location: FL
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).


Top
 Profile  
 
PostPosted: Sun Feb 04, 2018 9:02 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20876
Location: NE Indiana, USA (NTSC)
I was also interested in the per-frame calculation for the twist position at the top and bottom.


Top
 Profile  
 
PostPosted: Sun Feb 04, 2018 9:33 pm 
Offline

Joined: Sat Apr 25, 2015 1:47 pm
Posts: 427
Location: FL
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


Top
 Profile  
 
PostPosted: Mon Feb 05, 2018 1:20 am 
Offline
User avatar

Joined: Thu Sep 15, 2016 6:29 am
Posts: 833
Location: Denmark (PAL)
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.


Top
 Profile  
 
PostPosted: Mon Feb 05, 2018 3:16 am 
Offline

Joined: Thu Feb 07, 2013 1:15 am
Posts: 116
Location: Sweden
Aha, neat trick with the bitplane conversion!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 31 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: Google Adsense [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group