C2P speed on plain ST for flat polygons

GFA, ASM, STOS, ...

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
Ragstaff
Atari Super Hero
Atari Super Hero
Posts: 610
Joined: Mon Oct 20, 2003 3:39 am
Location: Melbourne Australia
Contact:

C2P speed on plain ST for flat polygons

Postby Ragstaff » Wed Sep 21, 2016 1:50 pm

I'm curious to know whether the best C2P techniques applied to plain polygon graphics instead of texture-mapped graphics (e.g. Stuntcar Racer) can be faster than the old techniques of rendering 3d straight into planar?

Kalms
Retro freak
Retro freak
Posts: 13
Joined: Sat Oct 28, 2006 10:18 am
Location: Linkoping, Sweden
Contact:

Re: C2P speed on plain ST for flat polygons

Postby Kalms » Thu Sep 22, 2016 8:10 pm

There are some smaller things that you can take from it:

- if you are going to do 4-plane graphics with fairly small polygons, then you could construct 8 pixels x 4 bitplanes worth of data in a longword and use MOVEP for reading/writing. However if you expect to be having larger polygons, or perhaps not doing 4 full bitplanes, then it is probably faster to do directly planar with word/longword accesses for individual bitplanes.

- If you are going to do 2-plane graphics with fairly small polygons and 2x1/2x2 chunky pixelsize, then you can have a linear packed framebuffer (a1a0b1b0c1c0d1d0 ...), render like that to the first bitplane, and construct the contents of the second bitplane by doing a 1-bit swap on the contents on the first bitplane (a0a1b0b1c0c1d0d1 ...) and use a predefined 01010101 mask in bitplane 3. The 1-bit swap can be done as a table lookup on the bitplane data (256 bytes or 128k table needed) or perhaps via a blit (I don't know the STEs blitter capabilities well enough).

But overall, c2p approaches become much more useful if you are not looking to draw contiguous segments of pixels with the same color.

User avatar
Ragstaff
Atari Super Hero
Atari Super Hero
Posts: 610
Joined: Mon Oct 20, 2003 3:39 am
Location: Melbourne Australia
Contact:

Re: C2P speed on plain ST for flat polygons

Postby Ragstaff » Sat Sep 24, 2016 2:47 am

Thanks a lot for your reply, Kalms! 4-plane, higher polygon count is probably getting away from the ST's strengths anyway. I was just curious, personally I've only done basic 3d tutorials in C on the PC but was starting to think about approaches on the ST

Zamuel_a
Atari God
Atari God
Posts: 1220
Joined: Wed Dec 19, 2007 8:36 pm
Location: Sweden

Re: C2P speed on plain ST for flat polygons

Postby Zamuel_a » Sun Oct 09, 2016 10:16 am

If you want to do regular flat shaded polygons, then C2P is not necessary. You can do that rather fast in the normal bitplane mode. C2P is rather costly and it's only with texture mapping you might want to use it.
ST / STFM / STE / Mega STE / Falcon / TT030 / Portfolio / 2600 / 7800 / Jaguar / 600xl / 130xe


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 3 guests