English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 06 December 2013, 15:27   #1
h0ffman
Registered User
 
Join Date: Aug 2008
Location: Salisbury
Posts: 785
interleaved bitmaps and blitting

Quick question.. I'm thinking of using an interleaved bitmap instead of the usual bitmap method of each bitmap one after the other.

The idea is that I should be able to blit all 5 planes in one blit rather than having to add plane size to the pointer on each blit.

Anyone had any experience with this? Also is there an iff converter which will output the raw image this way?

By my calculations the plane pointers in this case would be.. (for a 320 pixel width screen)

plane 1 = source
plane 2 = source+40
plane 3 = source+80
plane 4 = source+120
plane 5 = source+160

and the modulo would be 120.
h0ffman is offline  
Old 06 December 2013, 18:00   #2
h0ffman
Registered User
 
Join Date: Aug 2008
Location: Salisbury
Posts: 785
Seems to be the day for it today!! I found that PicCon can save interleaved raw bitmaps, chucked in the new values above and all went it perfick
h0ffman is offline  
Old 06 December 2013, 21:10   #3
mc6809e
Registered User
 
Join Date: Jan 2012
Location: USA
Posts: 374
Blitting to multiple planes in with one blit is wonderful, especially if the dimensions of the pixel block are small. A case where blitting is only slightly faster than the CPU becomes a huge win with interleaved bitplanes.
mc6809e is offline  
Old 07 December 2013, 12:22   #4
Codetapper
2 contact me: email only!
 
Codetapper's Avatar
 
Join Date: May 2001
Location: Auckland / New Zealand
Posts: 3,188
If you can spare the extra chip memory to store the mask once for each plane - yes!
Codetapper is offline  
Old 07 December 2013, 15:02   #5
nandius_c
Fernando Cabrera
 
Join Date: Oct 2013
Location: Spain
Posts: 106
I'm using interleaved bitplanes for my game. I create the interlaved data with IFFConverter which is very easy to use and can also generate palette and sprite data. As Codetapper said, I'm storing the mask once for every bitplane.
nandius_c is offline  
Old 07 December 2013, 18:16   #6
mc6809e
Registered User
 
Join Date: Jan 2012
Location: USA
Posts: 374
Quote:
Originally Posted by Codetapper View Post
If you can spare the extra chip memory to store the mask once for each plane - yes!
That's true. Not a big problem if only small bobs use the technique, of course.

I've been wondering, though: is there any extra use that can be gotten out of what is normally the mask in this case? Some special effect, possibly using some unusual LF? That way the extra copies of the mask aren't wasted.

I'm thinking something like semi-transparency.

If the palette is setup correctly, then semi-transparency can be done with something like LF=$B2.

With that LF, whenever the bob is written on top of pixels not masked out, the underlying pixel is inverted. With the right palette, some colors can become the shaded versions of the others when the background images has its bits flipped when merged with the bob.
mc6809e is offline  
Old 07 December 2013, 20:58   #7
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
even with only one mask and separate blits for each bitplane to draw a bob, a single blit could still be used for restoring background graphics.
Mrs Beanbag is offline  
Old 03 August 2024, 07:10   #8
DiabloV
DarkN3mo
 
DiabloV's Avatar
 
Join Date: Jan 2021
Location: FRANCE
Posts: 45
Hello

After a lot of headaches , I've finally managed to come up with a mask blending routine.

Here's an example.

Don't hesitate to tell me if I'm doing something wrong.

Now, that's all well and good, but I need to know what I do when I move the bob to refresh what was behind it?

What's the best technique?

https://mega.nz/file/cLlgVaLb#uG8iZ3...ZCPgbGV8MF6dIc

Last edited by DiabloV; 05 August 2024 at 08:27.
DiabloV is offline  
Old 10 August 2024, 09:56   #9
buzzybee
Registered User
 
Join Date: Oct 2015
Location: Landsberg / Germany
Posts: 533
I use triple buffering for Reshoot R and Reshoot Proxima 3, as this allows me to blit interleaved objects without having to store background bitmap data for each blitted objects, each frame.

The digest of how it works:
  • FrameBufferA: This bitmap contains background data with blitted objects combined. This buffer is on display
  • FrameBufferB: At the start of the frame, this contains background data and blitted object. First step: Restore background to empty state by copying clean background data from BufferC. For efficiency you would only partially restore background where blitted objects were drawn, using stored object blit feed data from the former blitter object process. After restoring, BufferB contains a clean background image. BufferC is now available for blitting objects. While blitting objects to BufferC, you would store object blit feed data (source adress, target adress, size, modulus) for efficient background restore in the next frame.
  • FrameBufferC: This contains empty background state only / no blitted objects at the start of the frame

You need to rotate these three buffers with each frame: BufferA becomes BufferB, Buffer B becomes BufferC, BufferC becomes BufferA and so on. Rotation is achieved non-expensive by swapping memory pointers.

This works with static and scrolling environments. It's fast but heavy on memory as you need three framebuffers. Therefore it's well suited to AGA-chipsets with 2 MB Chipmem.

If speed is not so much a concern, you can streamline the background restore process by simply copying the complete bitmap instead of partially restoring it.
buzzybee is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Raw Interleaved Graphics Hungry Horace Coders. General 12 28 January 2023 23:30
BPLxMOD for interleaved bitmaps phx Coders. Asm / Hardware 12 02 June 2012 22:47
Bitmaps in FASTRAM and blitting - C++ NovaCoder Coders. General 22 01 December 2010 23:40
Bitmaps Brothers Djay request.Old Rare Games 22 23 November 2003 21:18

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 00:17.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.25931 seconds with 13 queries