English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 03 February 2016, 18:11   #1
nirvan75
Registered User
 
nirvan75's Avatar
 
Join Date: Dec 2015
Location: italy
Posts: 13
Copperbar transparency

Hi guys,

I am experimenting with copperbar (or rasterbar) and I am trying
to understand how to make the following effect (it's from Agony):

http://www.codetapper.com/assets/ago...background.png

That is a static picture of 2 colors (1+transparent) where the copperbar shines through both the 2 colors. In fact you can see it not only through the trasparent color but also through the moon.

In my code, whatever I change, I can see the copperbar in one of the two colors only, depending how I set the displaypalette 0,x value.
So one time is only inside the moon and the rest of the picture is black or viceversa...

I have the feeling that is must be quite simple but my unexperience does not make me go over..

Last edited by nirvan75; 04 February 2016 at 08:40.
nirvan75 is offline  
Old 03 February 2016, 19:01   #2
Shatterhand
Warhasneverbeensomuchfun
 
Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
I am pretty sure this is 1 color + 1 transparent. There's no real transparency, your eyes are being deceived.

Both colors are changed by the copper every N lines, but it's just 2 colors. This is drawn using just one bitplane.

I don't know how to draw one bitmap using one bitplane and other using just the other 2 bitplanes on the same playfield using Blitz. It would be very useful, but I don't think you can do it without going the ASM route.
Shatterhand is offline  
Old 03 February 2016, 21:08   #3
Raislin77it
Zone Friend
 
Raislin77it's Avatar
 
Join Date: Jan 2005
Location: italy
Age: 46
Posts: 244
Quote:
Originally Posted by Shatterhand View Post
I don't know how to draw one bitmap using one bitplane and other using just the other 2 bitplanes on the same playfield using Blitz. It would be very useful, but I don't think you can do it without going the ASM route.
just use the bitplanesbitmap command
Raislin77it is offline  
Old 04 February 2016, 13:52   #4
nirvan75
Registered User
 
nirvan75's Avatar
 
Join Date: Dec 2015
Location: italy
Posts: 13
Quote:
Originally Posted by Shatterhand View Post
I am pretty sure this is 1 color + 1 transparent. There's no real transparency, your eyes are being deceived.

Both colors are changed by the copper every N lines, but it's just 2 colors. This is drawn using just one bitplane.
Hi,

yes, I know the picture is 1 col + transparent and I initialized one bitplane bitmap, but if I use for example the original picture (http://francksauer.com/images/Publis...oundBitmap.png) in my code, it becomes what you can see in the attachment file, which is very different from the original effect.
That's what I meant.
Attached Thumbnails
Click image for larger version

Name:	Schermata 2016-02-04 alle 13.38.36.png
Views:	362
Size:	58.9 KB
ID:	47294  
nirvan75 is offline  
Old 04 February 2016, 15:30   #5
Raislin77it
Zone Friend
 
Raislin77it's Avatar
 
Join Date: Jan 2005
Location: italy
Age: 46
Posts: 244
Quote:
Originally Posted by nirvan75 View Post
Hi,

yes, I know the picture is 1 col + transparent and I initialized one bitplane bitmap, but if I use for example the original picture (http://francksauer.com/images/Publis...oundBitmap.png) in my code, it becomes what you can see in the attachment file, which is very different from the original effect.
That's what I meant.
give me some hours (maybe a day )and i can reproduce the effect on blitz
Raislin77it is offline  
Old 04 February 2016, 16:34   #6
Raislin77it
Zone Friend
 
Raislin77it's Avatar
 
Join Date: Jan 2005
Location: italy
Age: 46
Posts: 244
Quote:
Originally Posted by Raislin77it View Post
give me some hours (maybe a day )and i can reproduce the effect on blitz

here we are
remember to resize your BackgroundBitmap.png and reduce the image to 2 colors and to save it in .iff like this




Code:
;AGONY-like demo
;4-02-2016 Raistlin77it
;2 bitplane color change



#COLOR00= $180
#COLOR01= $182




BitMap 0,320,200,2


LoadBitMap 0,"BackgroundBitmap.iff",0


MyCustomCop$;


;the trick is to change the colour 0 (trasparent) and the colour 1 with the copper every x scanline
; more on the codetapper page http://www.codetapper.com/amiga/sprite-tricks/agony/



MyCustomCop$ = Mki$((44 LSL 8)+$01)+Mki$($FFFE)                ; Wait for scanline 0 ($yyxx)
MyCustomCop$ + Mki$(#COLOR00)+Mki$($059)  ;
MyCustomCop$ + Mki$(#COLOR01)+Mki$($166)  ;

MyCustomCop$ + Mki$((59 LSL 8)+$01)+Mki$($FFFE)                ; Wait for scanline 15 ($yyxx)
MyCustomCop$ + Mki$(#COLOR00)+Mki$($058)  ;
MyCustomCop$ + Mki$(#COLOR01)+Mki$($165)  ;

MyCustomCop$ + Mki$((69 LSL 8)+$01)+Mki$($FFFE)                ; Wait for scanline 25 ($yyxx)
MyCustomCop$ + Mki$(#COLOR00)+Mki$($057)  ;
MyCustomCop$ + Mki$(#COLOR01)+Mki$($164)  ;

MyCustomCop$ + Mki$((79 LSL 8)+$01)+Mki$($FFFE)                
MyCustomCop$ + Mki$(#COLOR00)+Mki$($056)  ;
MyCustomCop$ + Mki$(#COLOR01)+Mki$($163)  ;

MyCustomCop$ + Mki$((89 LSL 8)+$01)+Mki$($FFFE)                
MyCustomCop$ + Mki$(#COLOR00)+Mki$($055)  ;
MyCustomCop$ + Mki$(#COLOR01)+Mki$($364)  ;

MyCustomCop$ + Mki$((99 LSL 8)+$01)+Mki$($FFFE)                
MyCustomCop$ + Mki$(#COLOR00)+Mki$($054)  ;
MyCustomCop$ + Mki$(#COLOR01)+Mki$($464)  ;


; etc etc like 

MyCustomCop$ + Mki$((179 LSL 8)+$01)+Mki$($FFFE)              
MyCustomCop$ + Mki$(#COLOR00)+Mki$($954)  ;
MyCustomCop$ + Mki$(#COLOR01)+Mki$($654)  ;

MyCustomCop$ + Mki$((189 LSL 8)+$01)+Mki$($FFFE)              
MyCustomCop$ + Mki$(#COLOR00)+Mki$($A54)  ;
MyCustomCop$ + Mki$(#COLOR01)+Mki$($544)  ;

MyCustomCop$ + Mki$((199 LSL 8)+$01)+Mki$($FFFE)              
MyCustomCop$ + Mki$(#COLOR00)+Mki$($B43)  ;
MyCustomCop$ + Mki$(#COLOR01)+Mki$($444)  ;

BLITZ


  InitCopList 0,44,256,$31,8,2,02+(Len(MyCustomCop$)/4)


  CustomString 0,0,0,MyCustomCop$                                 ; Place the Custom Copper string




  DisplayPalette 0,0
  CreateDisplay 0




  Repeat



  DisplayBitMap 0,0,0,0


  VWait


  Until Joyb(0)=1 OR  RawStatus($45)    ;


End
Raislin77it is offline  
Old 04 February 2016, 16:35   #7
Shatterhand
Warhasneverbeensomuchfun
 
Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
Quote:
Originally Posted by nirvan75 View Post
Hi,

yes, I know the picture is 1 col + transparent and I initialized one bitplane bitmap, but if I use for example the original picture (http://francksauer.com/images/Publis...oundBitmap.png) in my code, it becomes what you can see in the attachment file, which is very different from the original effect.
That's what I meant.
You are changing just 1 color with the copper. You can change both colors. That's what Agony does.

EDIT: Raislin77it just did it above I believe you can do it using easier commands, but I guess that will work too
Shatterhand is offline  
Old 04 February 2016, 17:11   #8
nirvan75
Registered User
 
nirvan75's Avatar
 
Join Date: Dec 2015
Location: italy
Posts: 13
guys i love you
nirvan75 is offline  
Old 11 April 2016, 11:53   #9
Anakirob
Unregistered User
 
Anakirob's Avatar
 
Join Date: Nov 2005
Location: Tasmania
Age: 42
Posts: 893
Quote:
Originally Posted by Shatterhand View Post
I don't know how to draw one bitmap using one bitplane and other using just the other 2 bitplanes on the same playfield using Blitz. It would be very useful, but I don't think you can do it without going the ASM route.
I'm a bit rusty but I seem to recall BitplanesBitmap command allows you to manipulate individual bitplanes.
Anakirob is offline  
Old 11 April 2016, 12:54   #10
Predseda
Puttymoon inhabitant
 
Predseda's Avatar
 
Join Date: Mar 2007
Location: Tromaville
Age: 46
Posts: 7,538
Send a message via ICQ to Predseda
Franck Sauer perfectly described how he created those effects for Agony on his website

http://www.francksauer.com/index.php...games/10-agony
Predseda is offline  
Old 11 April 2016, 14:00   #11
Amigajay
Registered User
 
Join Date: Jan 2010
Location: >
Posts: 2,881
Quote:
Originally Posted by Predseda View Post
Franck Sauer perfectly described how he created those effects for Agony on his website

http://www.francksauer.com/index.php...games/10-agony
Thanks for that good read! I see he does a signed poster too Oo tempting!
Amigajay is offline  
Old 11 April 2016, 14:11   #12
Predseda
Puttymoon inhabitant
 
Predseda's Avatar
 
Join Date: Mar 2007
Location: Tromaville
Age: 46
Posts: 7,538
Send a message via ICQ to Predseda
I spent several hours reading his srory through all those games and hardware he created with Yves Grollet and others, his successes and failures. That site is just awesome, written with a passion and a lot of knowledge is behind. Of course - Unreal and Agony is the most interesting content of that site for us, but I recommend everyone to read the whole story, from the early games to present.
Predseda is offline  
Old 13 June 2016, 19:21   #13
Trachu
Registered User
 
Join Date: Dec 2015
Location: Poland
Posts: 189
Thanx guys for explanation, but i have more complicated question regarding this game and 3 depth plane effect.
First of all this game is build in Dual playfield mode which means 3 bitplanes on each of 2 planes.
The background plane normally consist of 8 colours but in this game it was splitted on 2 planes - one using 1 bitplane and the second using 2 bitplanes.
I was thinking about this technique and i preetty much know the colours allocation.

Bitplanes - colour register - allocation
000 - 00 - border colour and the deepest background colour.
001 - 01 - Back plane using one bitplane
010 - 02 - Middle plane colour 1
011 - 03 - Middle plane colour 1
100 - 04 - Middle plane colour 2
101 - 05 - Middle plane colour 2
110 - 06 - Middle plane colour 3
111 - 07 - Middle plane colour 3

So whenever something is written in middle plane it covers both background and back plane, however what i dont know is how to make back plane static. It is a part of dual playfield, so whenever we set scroll register it moves all 3 bitplane. How to make one bitplane static in this case.
Trachu is offline  
Old 13 June 2016, 19:51   #14
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
Quote:
Originally Posted by Trachu View Post
So whenever something is written in middle plane it covers both background and back plane, however what i dont know is how to make back plane static. It is a part of dual playfield, so whenever we set scroll register it moves all 3 bitplane. How to make one bitplane static in this case.
Very simple: they just blit the image in the direction of the scroll.
It does not happen every frame and they probably only blit the portions which contain some graphics so as not to have to blit the entire plane.
ReadOnlyCat is offline  
Old 13 June 2016, 19:52   #15
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
Quote:
Originally Posted by Predseda View Post
I spent several hours reading his srory through all those games and hardware he created with Yves Grollet and others, his successes and failures. That site is just awesome, written with a passion and a lot of knowledge is behind. Of course - Unreal and Agony is the most interesting content of that site for us, but I recommend everyone to read the whole story, from the early games to present.
Seconded, I would even say that it is an essential read for any Amiga fan.
ReadOnlyCat is offline  
Old 13 June 2016, 20:06   #16
Trachu
Registered User
 
Join Date: Dec 2015
Location: Poland
Posts: 189
Quote:
Originally Posted by ReadOnlyCat View Post
Very simple: they just blit the image in the direction of the scroll.
It does not happen every frame and they probably only blit the portions which contain some graphics so as not to have to blit the entire plane.
It seems as rather computeexpensive method. Is it really no other way??? Its hard to belive they do it together with so many bobs simultaneus on the screen.

This game deserves the sequell, this time with more colours on the screen.
Trachu is offline  
Old 13 June 2016, 20:51   #17
Cylon
Registered User
 
Join Date: Oct 2014
Location: Europe
Posts: 470
Quote:
Originally Posted by Anakirob View Post
I'm a bit rusty but I seem to recall BitplanesBitmap command allows you to manipulate individual bitplanes.
You are right. I did it this way in my example here.

When performing bitmapscrolling, one has to update alle bitplane pointers to the new offset. By setting those pointers to different offsets you can move the planes independent. BitplanesBitmap cmd let you do this much easier - and makes it possible to create nice RGB fx too.
Cylon is offline  
Old 13 June 2016, 21:01   #18
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
Quote:
Originally Posted by Trachu View Post
It seems as rather computeexpensive method. Is it really no other way??? Its hard to belive they do it together with so many bobs simultaneus on the screen.
Yup. No other way and I think this is indirectly mentioned on Frank Sauer's site.
I was surprised as well that they chose this system when it is so blitter intensive but it is a straight copy, does not happen every frame and does not cover the entire screen surface.

Quote:
Originally Posted by Trachu View Post
This game deserves the sequell, this time with more colours on the screen.
And proper gameplay this time!
ReadOnlyCat is offline  
Old 13 June 2016, 21:17   #19
Trachu
Registered User
 
Join Date: Dec 2015
Location: Poland
Posts: 189
Quote:
Originally Posted by ReadOnlyCat View Post
Yup. No other way and I think this is indirectly mentioned on Frank Sauer's site.
I was surprised as well that they chose this system when it is so blitter intensive but it is a straight copy, does not happen every frame and does not cover the entire screen surface.
Well there is other way around.

Bitplane pointers can only point to another 16px portion of data, so if you would have 16 copies of background, each one moved by 1 px, you would have to only change one bitplane pointer to this other "shifted copy".

If you would have to draw so many huge bobs every frame, it does not matter blitter would have to redraw entire bitplane once every few frames, because every time it does your bobs would not fit into single frame.
Trachu is offline  
Old 13 June 2016, 21:52   #20
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
Yes, having copies is a possibility but given how much memory this would consume it is utterly unlikely.
So, copying they are.
ReadOnlyCat 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
Transparency in ILBM eva support.Other 4 29 June 2015 21:01
Blitz basic 2 Transparency Havie Coders. Blitz Basic 1 08 September 2013 13:55
AGA alpha transparency question diablothe2nd support.Hardware 6 25 July 2013 15:06
My First Copperbar(s) BippyM Coders. Asm / Hardware 35 29 March 2013 22:22
tinymeter transparency Skellionz project.ClassicWB 1 07 August 2011 16:28

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 12:04.

Top

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