Jump to content
Jagware
rush6432

Tranparency and RMW bit

Recommended Posts

rush6432    0

I havn't found many examples and or much documentation on this topic. I have searched and found a thread or two here but it ends up partially in french through the thread. Seems i missed the boat on this topic completely...

 

Anyhow, can anyone fill me in a little on how the transparency feature works using RMW and or what the rules might be when creating images that use this function or bit set in the object on the obj list? my guess is that getting transparency is only really achieved through RMW bit and CRY coloring or can the RMW bit be used with RGB successfully?

 

Ive seen the Blobs.bin example which i think zerosquare?! or someone else has created (correct me if im wrong on the author) looks to be using several bitmaps overlayed using this feature...

Share this post


Link to post
Share on other sites
GT Turbo    5

Hello,

 

I think Matmook has done transparency in RMV mode in LB (Laddybugged), i think he can help you. About french documentations or examples if you want translations, just ask, some here are french :)

 

GT :poulpe:

Share this post


Link to post
Share on other sites
SCPCD    0
my guess is that getting transparency is only really achieved through RMW bit and CRY coloring or can the RMW bit be used with RGB successfully?

RMW makes :

ADDSAT4 PIXC, LBC

ADDSAT4 PIXR, LBR

ADDSAT8 PIXY, LBY

 

and if I remind correctly all composent of LB pixel (C, R and Y) are signed.

 

On RGB pix this will have strange result :)

Share this post


Link to post
Share on other sites

Rush, CRY/trans works like this

 

Take any colour in CRY mode, and apply any other in CRY mode, and watch it turn purple.

 

It's pretty simple really. Although using RGB and just setting purple to start with is a lot quicker.

Share this post


Link to post
Share on other sites
Tyrant    0
Take any colour in CRY mode, and apply any other in CRY mode, and watch it turn purple.

 

I think the idea is that you pick your palettes quite carefully and use muted colours for the background, to avoid everything saturating at a specific colour.

 

Has anyone used it on an RGB image though, and what happens? Does it still try to saturate to 4/4/8 boundaries?

Share this post


Link to post
Share on other sites
Zerosquare    10
Take any colour in CRY mode, and apply any other in CRY mode, and watch it turn purple.

 

It's pretty simple really. Although using RGB and just setting purple to start with is a lot quicker.

It's too bad there isn't a "Like" button is this forum :D

 

Here are a few pitfalls about RMW mode :

 

- it is not alpha-blending. You can't control the level of opacity. So, in general, you won't be able to use it for e.g. antialiased sprites.

 

- it cannot do "real" shadows/translucency effects either, because it's additive, not multiplicative. For example, blocking 50% of the light would turn (100,100,100) into (50,50,50), and (40,40,40) into (20,20,20). RMW can only subtract a fixed quantity, so there's no pixel value that would result in correct colors.

 

- it only works in CRY mode. You can use it on RGB sprites, but it will blindly apply the same algorithm, which doesn't make any sense given how the RGB pixels are encoded ; the only thing you'll get are corrupted colors.

 

- the C, R and Y are signed offsets, so their range is cut in half. For example, assuming you have a black baground, you can't turn it light gray (192,192,192) with a single RMW object ; the best you'll be able to do is (127,127,127) ; the same goes for turning a white background black. (You can "cheat" by drawing two RMW sprites on top of each other, though.)

 

- since the calculations includes saturation, if you overlap several RMW objects, the order matters.

 

- the C and R offsets are independent from the Y offset, so even if the Y offset is small or zero, the C and R can cause large changes in hue. Unless you're Jeff Minter, that makes colored RMW sprites not very useful.

 

If you want to make a white spotlight effect in RMW :

- take a greyscale picture

- convert it into CRY with whichever converter you prefer

- read the file, divide each Y value by two (so that you won't get wraparound errors), and zero out the C and R parts.

Share this post


Link to post
Share on other sites
Matmook    1

I use RMW bit for "shadows" in CRY mode. I make a simple picture in low colors. I then convert it to an .S file using tga2cry (in 1/2/4bit/pixel) mode.

Next step is to edit this .S file to alter the colormap information and remove the "color" component C and R...

And finaly I make some test using different Y value depending of the background (to avoid saturation effects).

 

Share this post


Link to post
Share on other sites
rush6432    0
I use RMW bit for "shadows" in CRY mode. I make a simple picture in low colors. I then convert it to an .S file using tga2cry (in 1/2/4bit/pixel) mode.

Next step is to edit this .S file to alter the colormap information and remove the "color" component C and R...

And finaly I make some test using different Y value depending of the background (to avoid saturation effects).

 

 

Thanks guys for the information. very informative. Ill have to tinker with it when i get some more free time.

 

The jag dev manual mentions a mixed mode rgb/cry video mode?? $6C7 when pushed into VMODE seems to be 16bit rgb 320x240ish and $4C7 seems to be cry

cry 16bit 320x240 is there a mixed mode like the manual states where you can have cry objects and rgb objects in the same list and display properly or is it just one or the other? I havent looked at the manual in some time so i may have to sometime soon, but figured someone might know off hand.

Share this post


Link to post
Share on other sites
Zerosquare    10
is there a mixed mode like the manual states where you can have cry objects and rgb objects in the same list and display properly or is it just one or the other?
Yes, there's a mixed RGB/CRY mode where you can use both CRY and RGB objects in the same list. In fact it's per-pixel, so you could even have a sprite using CRY for some of its pixels and RGB for others. The downside is that you lose one bit color precision, which is used to select between CRY and RGB modes : in RGB mode it's the LSB of the green channel (so you get 5:5:5 RGB instead of 5:6:5) ; in CRY mode, it's the LSB of the Y part (so you get 128 levels of brightness instead of 256).

Share this post


Link to post
Share on other sites
Matmook    1
is there a mixed mode like the manual states where you can have cry objects and rgb objects in the same list and display properly or is it just one or the other?
Yes, there's a mixed RGB/CRY mode where you can use both CRY and RGB objects in the same list. In fact it's per-pixel, so you could even have a sprite using CRY for some of its pixels and RGB for others. The downside is that you lose one bit color precision, which is used to select between CRY and RGB modes : in RGB mode it's the LSB of the green channel (so you get 5:5:5 RGB instead of 5:6:5) ; in CRY mode, it's the LSB of the Y part (so you get 128 levels of brightness instead of 256).

In which context we could use a bitmap made of RGB and CRY pixel ? :blink:

Share this post


Link to post
Share on other sites
Zerosquare    10

I don't think it's really useful to use both modes in the same sprite, at least I can't see any case where it would help.

 

After all the Jag is a console where you can do many things you don't need, and can't do many things you need :D

Share this post


Link to post
Share on other sites
Matmook    1
After all the Jag is a console where you can do many things you don't need, and can't do many things you need :D
:lol:

 

Share this post


Link to post
Share on other sites
GT Turbo    5
After all the Jag is a console where you can do many things you don't need, and can't do many things you need :D
:lol:

 

Yes +1 for Zero :)

 

 

 

GT :poulpe:

Share this post


Link to post
Share on other sites
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×