English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 14 December 2022, 18:35   #1
leonard
Registered User
 
leonard's Avatar
 
Join Date: Apr 2013
Location: paris
Posts: 133
Half-brite mode

Hi!

I'm thinking about half-brite mode to improve image conversion but I have few questions.
First of all, I think it's not supported on all A500 right? Doesn't work on OCS?

Second, I get that a grey color like $fff will produce a new color between $777 and $888.
But what if input color is $eee? will half-brite version be exactly the same as an original $777 color?
leonard is offline  
Old 14 December 2022, 18:48   #2
Jobbo
Registered User
 
Jobbo's Avatar
 
Join Date: Jun 2020
Location: Druidia
Posts: 386
All A500's support EHB. Only some early US A1000's don't.

I always thought the half-brite colors were still 4bit per channel, it just takes the original values and halves them, rounding down.

It's probably just shifting them down in the hardware.
Jobbo is offline  
Old 14 December 2022, 18:49   #3
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
Half-bright works on all A500, only the very early produced A1000s are without it.
Both $f and $e are mapped to $7 (basically right-shift once, or integer div by 2).
a/b is offline  
Old 14 December 2022, 22:42   #4
Estrayk
Registered User
 
Estrayk's Avatar
 
Join Date: Apr 2015
Location: Spain
Posts: 511
That's right, as the above guys have said, very few units of the first A1000 sold in the USA in 1985 (the ones that came with ks1.0) do not support HB. So you could say that 99.99% of the world's Amigas support it.
Estrayk is offline  
Old 16 December 2022, 00:11   #5
leonard
Registered User
 
leonard's Avatar
 
Join Date: Apr 2013
Location: paris
Posts: 133
ok so basically it doesn't "create" new colors. It just avoid to use all of them in the palette? Like there is no color in between $000 and $111 when using halfbrite on $111 value.
It's just that is you need a complete greyscale palette, you don't need all colors from $000 to $fff, you just need 8 values, and there 8 "halfbrite" values
$000,$222,$666,$888,.. $eee
So it's totally useless if you want to improve the 4bits per color component. Damn
leonard is offline  
Old 16 December 2022, 04:02   #6
Jobbo
Registered User
 
Jobbo's Avatar
 
Join Date: Jun 2020
Location: Druidia
Posts: 386
Yeah, EHB is not as awesome and you were hoping!

I haven't considered how to determine the best possible palette when converting an image to EHB but it seems like it'd be challenge.

Also, I'm sure you're aware of the flickering techniques common in some newer ST games and in Batman Rises and Transhuman?

It'd be interested to see how far EHB can be pushed with similar flickering tricks.
Jobbo is offline  
Old 16 December 2022, 05:22   #7
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
Yeah, if you were to use a HB mode to display a greyscale image you would end up with something like:
00: 000
01: fff
02: eee
03: ddd
04: ccc
05: bbb
06: aaa
07: 999
08: 888
09: 333
0a: 222
0b-1f: free
"Auto-generated" HB colors would then be:
20: 000
21: 777
22: 777
23: 666
24: 666
25: 555
26: 555
27: 444
28: 444
29: 111
2a: 111
You would need all the 8-f color components (since HB color components can only be 0-7), plus whatever is missing. So it's not really a fifty-fifty scenario.
a/b is offline  
Old 16 December 2022, 10:37   #8
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,502
If anyone cares, reason why EHB can't create "half colors": Denise has 3x4-bit digital RGB output pins and EHB logic is inside Denise. It can't create more than 16*16*16 = 4096 colors.
Toni Wilen is offline  
Old 16 December 2022, 11:36   #9
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,119
I've often wondered what the main reason for EHB was. Was it just that having 64 colour registers would take too much silicon?
Karlos is offline  
Old 16 December 2022, 13:38   #10
chb
Registered User
 
Join Date: Dec 2014
Location: germany
Posts: 439
Quote:
Originally Posted by Karlos View Post
I've often wondered what the main reason for EHB was. Was it just that having 64 colour registers would take too much silicon?
Yes, pretty much. An additional set of 32 12-bit registers needs about 32*12*6=2304 transistors, which was substantial at that time.
I guess they had 6 bitplane dma channels for dual plafield and ham anyway, so someone had a clever idea to get 64 colors on the cheap.
chb is offline  
Old 17 December 2022, 12:56   #11
leonard
Registered User
 
leonard's Avatar
 
Join Date: Apr 2013
Location: paris
Posts: 133
Quote:
Originally Posted by Jobbo View Post
I haven't considered how to determine the best possible palette when converting an image to EHB but it seems like it'd be challenge.
I'm playing around with a brute force search, take a while even on my 16 threads AMD CPU. At the end I discovered the palette is important in HAM but *not* so much. Like, you could even have a completly black palette (so just using HAM delta colors), and you can easily recognize the picture (obviously with plenty of typical horizontal ham glitchs). Then, adding colors in the palette one by one improve the image. ( I brute force the color adding one by one in the palette by lowering an average "color match score" over the complete picture)

Quote:
Originally Posted by Jobbo View Post
Also, I'm sure you're aware of the flickering techniques common in some newer ST games and in Batman Rises and Transhuman?
yeah Atari has some really nice tech to display high color recently, also using color flickering ( like flickering $333 and $444 is kinda creating a in between color). I thought about using that in my HAM converter but don't know how to properly add this feature in my brute force search right now

Quote:
Originally Posted by Jobbo View Post
It'd be interested to see how far EHB can be pushed with similar flickering tricks.
You mean without HAM mode? Like, standard OCS 5 bitplans, but with EHB active, so having "kinda" 64 colors palette? I don't know, could be interesting to try.
leonard is offline  
Old 17 December 2022, 12:57   #12
leonard
Registered User
 
leonard's Avatar
 
Join Date: Apr 2013
Location: paris
Posts: 133
Quote:
Originally Posted by Toni Wilen View Post
If anyone cares, reason why EHB can't create "half colors": Denise has 3x4-bit digital RGB output pins and EHB logic is inside Denise. It can't create more than 16*16*16 = 4096 colors.
thanks for technical detail! this definitely kills all my hopes of having more than 4096 colors without using flickering technics
leonard is offline  
Old 17 December 2022, 13:56   #13
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,741
Quote:
Originally Posted by leonard View Post
thanks for technical detail! this definitely kills all my hopes of having more than 4096 colors without using flickering technics
"flickering technics" are temporal dithering and it is commonly used by modern display technology... so there should be plenty of papers and patents on this in web.

btw as Amiga video DAC a.k.a. Vidiot produce B/W in analog domain so on CVBS Amiga output there is more than 16 levels of gray.

Forget to add about neat software using "dynamic" to number of colors, sadly it is only for Atari ST(E) and Windows http://www.leonik.net/dml/sec_pcs.py - but using same methodology should be straightforward in Amiga.

Last edited by pandy71; 17 December 2022 at 14:03.
pandy71 is offline  
Old 17 December 2022, 14:07   #14
duga
Registered User
 
Join Date: Nov 2010
Location: Sweden
Posts: 528
Quote:
Originally Posted by leonard View Post
I'm playing around with a brute force search, take a while even on my 16 threads AMD CPU. At the end I discovered the palette is important in HAM but *not* so much. Like, you could even have a completly black palette (so just using HAM delta colors), and you can easily recognize the picture (obviously with plenty of typical horizontal ham glitchs). Then, adding colors in the palette one by one improve the image. ( I brute force the color adding one by one in the palette by lowering an average "color match score" over the complete picture)



yeah Atari has some really nice tech to display high color recently, also using color flickering ( like flickering $333 and $444 is kinda creating a in between color). I thought about using that in my HAM converter but don't know how to properly add this feature in my brute force search right now



You mean without HAM mode? Like, standard OCS 5 bitplans, but with EHB active, so having "kinda" 64 colors palette? I don't know, could be interesting to try.
Isn't that how it's done in at least one Amiga Doom port? https://aminet.net/package/game/shoot/ADoom-1.3
duga is offline  
Old 17 December 2022, 15:14   #15
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,119
I had an idea years ago that I never tried beyond a simple mockup because I had AGA. The idea was to take a 320*256 image using 15bpp palette and to display it interlaced with every pixel split vertically and spreading the LSB difference between them, one halve with all channels rounded up, the other rounded down. To improve the effect the idea was to alternate the low and high halves in a typical checker board fashion and finally to invert the whole thing every frame. It looked like it might have legs for static images at least.
Karlos is offline  
Old 19 December 2022, 09:20   #16
sandruzzo
Registered User
 
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,281
Quote:
Originally Posted by chb View Post
Yes, pretty much. An additional set of 32 12-bit registers needs about 32*12*6=2304 transistors, which was substantial at that time.
I guess they had 6 bitplane dma channels for dual plafield and ham anyway, so someone had a clever idea to get 64 colors on the cheap.
Maybe a trick to switch palette like Aga, could have been possible..
sandruzzo is offline  
Old 19 December 2022, 10:52   #17
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by Estrayk View Post
That's right, as the above guys have said, very few units of the first A1000 sold in the USA in 1985 (the ones that came with ks1.0) do not support HB.
I bought a PAL Piggyback-board A1000 with Kickstart 1.2 and US keyboard in the first half of 1987 here in Germany. It had a ceramic Denise without EHB mode.
So there are problably more A1000s affected.
phx is offline  
Old 19 December 2022, 15:50   #18
Estrayk
Registered User
 
Estrayk's Avatar
 
Join Date: Apr 2015
Location: Spain
Posts: 511
Quote:
Originally Posted by phx View Post
I bought a PAL Piggyback-board A1000 with Kickstart 1.2 and US keyboard in the first half of 1987 here in Germany. It had a ceramic Denise without EHB mode.
So there are problably more A1000s affected.
Is weird because in Spain the A1000's that were sold in 1986 with kickstart 1.1 had EHB. That is why I assumed what I said.
Estrayk is offline  
Old 19 December 2022, 16:38   #19
Jobbo
Registered User
 
Jobbo's Avatar
 
Join Date: Jun 2020
Location: Druidia
Posts: 386
What does a machine without EHB do when code tried to display an image in EHB?

Does it just look like it's ignoring the 6th bitplane?
Jobbo is offline  
Old 19 December 2022, 17:58   #20
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by Jobbo View Post
Does it just look like it's ignoring the 6th bitplane?
This.
ross 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
which game made the best use of half bright mode? donnie Retrogaming General Discussion 66 18 April 2022 15:31
Good explanation why half-brite is too slow for game engines? ImmortalA1000 Coders. General 43 25 July 2021 17:51
Converting a given palette to Extra Half-Brite roondar Coders. General 19 11 July 2020 06:33
Query about Extra Half-Brite (EHB) Foebane Amiga scene 15 13 September 2015 12: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 16:17.

Top

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