Mask for background animations and transparencies

Previous topic - Next topic

Ian Price

Really sorry, but I've still not tried this yet - been working on an animated intro for AquaVenture. It's pretty simple, but it's taken a lot longer than I expected.
I came. I saw. I played.

fuzzy70

Quote from: Ian Price on 2013-Feb-10
Really sorry, but I've still not tried this yet - been working on an animated intro for AquaVenture. It's pretty simple, but it's taken a lot longer than I expected.

No rush Ian. 1st I enjoyed the challenge & 2nd bought up an issue that would be great to get sorted  =D

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

Ian Price

Hi Lee

Just had a look at your code and it's doing what I said in this thread - http://www.glbasic.com/forum/index.php?topic=8906.msg75910#msg75910

QuoteThere is no way to draw a pink (255,0,128) circle onto the black screen unless you build it up out of rectangles.

And...

QuoteYou can use DRAWRECT but that requires multipls squares to draw a circle

So, it's the same solution that I came up with originally.  :D
I came. I saw. I played.

fuzzy70

Sorry Ian I must have misread it as you just needed to make holes that showed whatever underneath while blanking the rest of the screen.

Do you use the same circle routine as mine as I'm sure I saw something about sin/cos which mine does not use (then again that could have been a different topic  :D)

Well even if I/We have failed to reach the required goal at least it has thrown an issue up that should hopefully get resolved  ;)

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

Ian Price

I came up with two routines - the one with SIN and COS was for the POLYVECTOR solution, not the DRAWRECT one (which doesn't use SIN or COS).

My DRAWRECT solution was pretty much the same - just use several rects to draw pink circles onto the black background.

The POLYVECTOR solution used the background screen as a texture and used SIN & COS to draw circles directly onto the screen.
I came. I saw. I played.

fuzzy70

Some form of direct buffer access (while locked) would be nice & could do it with no problems, mem2sprite & sprite2mem are a step in the right direction but suffer a performance hit when they are called.

Ideally of course anything that is drawn be it a rect, sprite or whatever should take into account the transparency  colour.

Lee
"Why don't you just make ten louder and make ten be the top number and make that a little louder?"
- "These go to eleven."

This Is Spinal Tap (1984)

Ian Price

QuoteIdeally of course anything that is drawn be it a rect, sprite or whatever should take into account the transparency  colour.
That's pretty much exactly what I said last year. :(
I came. I saw. I played.

Kitty Hello

In v11 play with alphamode -1 od/or alphatesting values.

erico

Quote from: Kitty Hello on 2013-Feb-11
In v11 play with alphamode -1 od/or alphatesting values.

I did try some of it on my tests Kitty, but could not achieve the desirable results.
I´m away from home (carnaval in brasil!! :D) so can´t give an update on my tries.

I will look into it when I get back home.

erico

and then...a double post! ;/

Did any of the solutions here helped the caanoo port Ian?
What about the blocky ball´s idea?

Maybe a mix of everything can do?

Cheers!

Ian Price

#70
QuoteDid any of the solutions here helped the caanoo port Ian?
No. The speed is still too slow and, as stated, my own methods produced better results. I could probably optimise the code and make it more Caanoo specific, rather than for all devices and it might work then, but I don't think I have time now.  The Pandora is my main focus, but I will continue to work on all versions.

There is one way I can make the Caanoo faster, but that would require the game to be played without scaling. I might try that tomorrow.
I came. I saw. I played.

erico

So scalling is the more taxing issue?

zooming 320x240 polyvectors or same size zoomsprite hooged on caanoo on my old tests.
I did get a bit better speed by using smaller bits though.

Good luck. :good:

Ian Price

Well, I've now got it working at a playable <>45FPS on the Caanoo whether it's light or dark and scaled to fill the screen :D

I've had to sacrifice the water effect in the background, but I can live with that. The only issue I have now is it now crashes after the end of a level, but that shouldn't take too long to identify and sort out.

Need to try the same code on the Pandora to ensure that what I've fixed on one machine doesn't bugger up the other!
I came. I saw. I played.

Kitty Hello

You want a super mario n64 screen fadeout with a circle?
Would be worth a try to draw the black part using polyvectors. It's a bit of a math, but if you draw an outer and an inner circle, its easier. Know what I mean?

Ian Price

#74
No Gernot. Did you look at the video I attached in this post? - http://www.glbasic.com/forum/index.php?topic=8906.msg75906#msg75906    [EDIT] Post #12 - the forum isn't showing the actual post ???

I've already got the halos showing in-game on pc, Pandora and Caanoo. I worked out two routines - one with DRAWRECTs on a black background, the other by using the actual graphic background as a texture in POLYVECTORS. While both worked well, the Pandora and Caanoo both suffered speed loss as a result of using both methods. Just being able to plonk a pink (255,0,128) sprite onto a black background and have the image behind show through would reduce some speed loss.

However, I've now optimised things to a level where the game is comfortably playable on a Caanoo now. The Pandora hasn't improved significantly just a few FPS, but it was always playable anyway.
I came. I saw. I played.