It is currently Tue Nov 21, 2017 9:05 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 18 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Mon Aug 14, 2017 6:09 pm 
Offline
User avatar

Joined: Sun Jun 11, 2017 5:39 pm
Posts: 39
I saw a video of this game boy game: https://www.youtube.com/watch?v=AyjU4MtonZM

At 0:46 I think they rotate a sprite (or they have every possible sprite)?

Is it possibile to do so on nes?


Top
 Profile  
 
PostPosted: Mon Aug 14, 2017 6:21 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5825
Location: Canada
Battletoads' intro "software renders" the flying spaceship into CHR-RAM with a scaling operation. (Check the CHR pattern pages in a debugger to watch it in action.)

A rotation would be similarly feasible. (Could probably scale at the same time as rotating too without extra complexity.)


Top
 Profile  
 
PostPosted: Mon Aug 14, 2017 6:24 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19239
Location: NE Indiana, USA (NTSC)
True sprite rotation is very slow without a coprocessor. In some cases, a small amount of rotation can be faked with shearing. But usually, pre-defined rotations are stored in the ROM.

Scaling without rotation is faster because it can be done with lookup tables.


Top
 Profile  
 
PostPosted: Mon Aug 14, 2017 6:39 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5825
Location: Canada
tepples wrote:
True sprite rotation is very slow without a coprocessor.

Hmm, doing a quick estimate, I think a naive fixed point 32x32 rasterizing could probably be done at 30fps?

You could keep up with a vblank bandwidth of 128 bytes per frame, I believe.


Top
 Profile  
 
PostPosted: Mon Aug 14, 2017 11:37 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7272
Location: Chexbres, VD, Switzerland
MartsINY wrote:
I saw a video of this game boy game: https://www.youtube.com/watch?v=AyjU4MtonZM

At 0:46 I think they rotate a sprite (or they have every possible sprite)?

Is it possibile to do so on nes?

What is shown in this video is wireframe graphics. This is perfectly on a NES. Elite is a game released only with those. I did a demos myself using that, and so did other nesdev people.

My demo does not look really 3D, but I have another one on my hard disk with pre-calcluated 3D shapes and it works and looks impressive. I wanted to save it for a real game so I didn't publish this but since I don't know if I'll ever release a real game...

Another approach to rotating sprites is simply to pre-render it. Usually pre-rendering is the key of success when it comes to this stuff :p


Top
 Profile  
 
PostPosted: Tue Aug 15, 2017 6:27 am 
Offline
User avatar

Joined: Thu Mar 31, 2016 11:15 am
Posts: 211
It's 1000 times easier to bake rotation into sprites than it is to generate them on the fly.


Top
 Profile  
 
PostPosted: Tue Aug 15, 2017 12:33 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2363
Say you are using a mapper with 16kB of memory per bank. In that bank you can store a 256x64 8-bit bitmap image. Have all the rotatable sprites located in the middle of that 256x64 bitmap, with extra space between them. Then you can calculate the ROM address for each pixel by having X location as the low byte, and Y location as the high byte. Then fetch the pixels and convert them to planar format.


Top
 Profile  
 
PostPosted: Tue Aug 15, 2017 1:32 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19239
Location: NE Indiana, USA (NTSC)
A 64x64 pixel 2bpp graphic is 1 KiB. A 256x64 pixel 8bpp graphic is 16 KiB. If you'll be wasting 94% of each bank on 8bpp sprites with huge blank spaces between them, you might as well just use the space for 16 pre-baked rotations that you can scale using a shrinking LUT.


Top
 Profile  
 
PostPosted: Tue Aug 15, 2017 2:52 pm 
Offline
User avatar

Joined: Sat Jul 04, 2015 9:58 am
Posts: 568
Location: -29.794229 -55.795374
Little Samson's character select screen have the selected character rotating.
I think it's a prerendered rotation, not made on the fly.
But it's a nice effect!!


Top
 Profile  
 
PostPosted: Tue Aug 15, 2017 3:18 pm 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 874
Location: Sweden
Heh yeah it's nice but I don't think the topic is about that kind of rotation. That's just normal animation.


Top
 Profile  
 
PostPosted: Tue Aug 15, 2017 3:34 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10117
Location: Rio de Janeiro - Brazil
You'd need 3D models to do Little Samson's rotation in real time...


Top
 Profile  
 
PostPosted: Wed Aug 16, 2017 3:38 am 
Offline
User avatar

Joined: Thu Sep 15, 2016 6:29 am
Posts: 382
Location: Denmark (PAL)
Pretty sure all of Little Samson is prerendered :D


Top
 Profile  
 
PostPosted: Wed Aug 16, 2017 7:41 am 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 729
Location: New York, NY
http://imgur.com/9U0safd


Top
 Profile  
 
PostPosted: Wed Aug 16, 2017 7:51 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19239
Location: NE Indiana, USA (NTSC)
The effect seen in Super Spy Hunter is shearing, the overhead counterpart to how Pole Position and Rad Racer draw their roads.


Top
 Profile  
 
PostPosted: Wed Aug 16, 2017 12:24 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2363
tepples wrote:
A 64x64 pixel 2bpp graphic is 1 KiB. A 256x64 pixel 8bpp graphic is 16 KiB. If you'll be wasting 94% of each bank on 8bpp sprites with huge blank spaces between them, you might as well just use the space for 16 pre-baked rotations that you can scale using a shrinking LUT.


You can composite 4 sprites into the 8bpp bitmap, and even rotate all 4 at once that way.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 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:  
cron
Powered by phpBB® Forum Software © phpBB Group