03 February 2016, 18:11 | #1 |
Registered User
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. |
03 February 2016, 19:01 | #2 |
Warhasneverbeensomuchfun
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. |
03 February 2016, 21:08 | #3 |
Zone Friend
Join Date: Jan 2005
Location: italy
Age: 46
Posts: 244
|
|
04 February 2016, 13:52 | #4 | |
Registered User
Join Date: Dec 2015
Location: italy
Posts: 13
|
Quote:
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. |
|
04 February 2016, 15:30 | #5 | |
Zone Friend
Join Date: Jan 2005
Location: italy
Age: 46
Posts: 244
|
Quote:
|
|
04 February 2016, 16:34 | #6 | |
Zone Friend
Join Date: Jan 2005
Location: italy
Age: 46
Posts: 244
|
Quote:
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 |
|
04 February 2016, 16:35 | #7 | |
Warhasneverbeensomuchfun
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 41
Posts: 3,450
|
Quote:
EDIT: Raislin77it just did it above I believe you can do it using easier commands, but I guess that will work too |
|
04 February 2016, 17:11 | #8 |
Registered User
Join Date: Dec 2015
Location: italy
Posts: 13
|
guys i love you
|
11 April 2016, 11:53 | #9 |
Unregistered User
Join Date: Nov 2005
Location: Tasmania
Age: 42
Posts: 893
|
I'm a bit rusty but I seem to recall BitplanesBitmap command allows you to manipulate individual bitplanes.
|
11 April 2016, 12:54 | #10 |
Puttymoon inhabitant
|
Franck Sauer perfectly described how he created those effects for Agony on his website
http://www.francksauer.com/index.php...games/10-agony |
11 April 2016, 14:00 | #11 | |
Registered User
Join Date: Jan 2010
Location: >
Posts: 2,881
|
Quote:
|
|
11 April 2016, 14:11 | #12 |
Puttymoon inhabitant
|
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.
|
13 June 2016, 19:21 | #13 |
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. |
13 June 2016, 19:51 | #14 | |
Code Kitten
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
|
Quote:
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. |
|
13 June 2016, 19:52 | #15 | |
Code Kitten
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
|
Quote:
|
|
13 June 2016, 20:06 | #16 | |
Registered User
Join Date: Dec 2015
Location: Poland
Posts: 189
|
Quote:
This game deserves the sequell, this time with more colours on the screen. |
|
13 June 2016, 20:51 | #17 | |
Registered User
Join Date: Oct 2014
Location: Europe
Posts: 470
|
Quote:
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. |
|
13 June 2016, 21:01 | #18 | ||
Code Kitten
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
|
Quote:
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:
|
||
13 June 2016, 21:17 | #19 | |
Registered User
Join Date: Dec 2015
Location: Poland
Posts: 189
|
Quote:
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. |
|
13 June 2016, 21:52 | #20 |
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. |
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 |
|
|