April 18, 2024, 01:04:13 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


layers

Started by kryton9, September 15, 2006, 03:53:35 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kryton9

Does anyone have an idea of how layers, as in Photoshop, are handled?

That is, that it can have an invisible background and also the opacity of the overall layer can be adjusted separately.
In addition, you can easily change the order of the layers thus effecting their ability to appear on top of other layers.

Can this sort of thing be written in Aurora in its first Beta release?

Parker

Photoshop draws the bottom layer first, and subsequent layers next. As for transparencies, if layer 2 is 50% transparent, the pixel that is shown is 50% original pixel + 50% layer 2 pixel. However you have to take into account separate red, green, and blue values. So it actually looks something like this:

output_pixel = redraw( orig_pixel, .5 ) + redraw( layer2_pixel, .5 );

redraw( pixel, percent ) =
    red( pixel ) * percent +
    green( pixel ) * percent +
    blue( pixel ) * percent;

The red(), green(), and blue() functions use bit shifts to take a certain part of the pixel out.

I don't know if this can be done natively with the 2D pak though.

kryton9

Thanks Parker for a quick reply. I know I would have to set aside memory for the resolution of the image for each layer, a screen buffer if you will. Then go through and calculate the final actual screen as you mentioned, I am not sure if this can all be done in the current version of Aurora.

J B Wood (Zumwalt)

"with" Aurora and "in" Aurora are two different things, you can do anything "with" Aurora, what we can do "in" Aurora natively with built in methods is a different story

Ionic Wind Support Team

Use the 3D sprite class which supports PNG transparency.

the 2D library (there are no paks here) uses DirectX 7 as the base since that is the last official DirectDraw interface that Microsoft supported.  And DX7 doesn't support hardware alpha transparency, it is all done in software.
Ionic Wind Support Team

kryton9

I thought about 3d sprites, but I need to be able to draw dynamicaly to them then. Will think about it and see if I can come up with anything.