New games every week!
JSE - Skewing.. Blog
3rd August 2021
I tried adding a bunch of effects into the engine, yesterday, but..
Yikes!!

-=-=-

A lot of Javascript's canvas effects are fun to see working, but boy do they drain the FPS!
I had the site doing plain grayscale embossing of sprites. At half the framerate.
Adding random noise to the screen. At half the framerate.
Adding a circle of light.. At half the framerate.
And much more besides.

All lovely effects, but all SO slow!!
And I've already got the engine adding random noise to the screen at full speed, so that's completely useless.
I can also draw a bunch of alpha'd ovals to produce a circle of light, likely full speed, too.
And the emboss thing only worked based on the direction of light you've hardcoded into the .html file, making it entirely useless.

And it all, of course, depends on your browser.

So, no. All of that stuff got rejected for being entirely useless.
If I was using WebGL for everything, that'd give me much more options, but it would also drain your battery faster. Also, by default, it isn't actually enabled on a lot of mobile devices, so would break the site in multiple ways.

Ho hum..

Meanwhile..



At the very least, I got Skew working on text and sprites. SetSkew x,y
It currently isn't uploaded as I'm trying to work out how to get it working on shapes. .. I'm not too hopeful that that'll work, if I'm honest.

Also, as with all things, your results will be browser dependant.
Some browsers it slows down. Other browsers, the way I tweaked the draw routines, it's actually a little bit faster.
Go figure.

I did notice one thing, yesterday, though, in that if you scale and rotate and skew and alpha, all at the same time, the framerate once again plummets.
Maybe don't do that!!

I'll probably upload the skew command later today. Still needs a bit of tweaking, though.

Meanwhile, Meanwhile...



IT BURNS!!!

// OMG - it splodid! // by Jayenkai // Created 2021/8/2 Symbol 0,"06_0_0T0@b9080.9T90?98b0,80_08"; Graphics 1920,1080,2 AntiAlias On scry=0-128 Repeat SeedRnd SetBlend "Normal" g=Rnd(0.22,0.26) CLS 50,30,20,g Gosub Flame SetBlend "Dodge" SeedRnd 37171 SetAlpha 0.4 SetSize 8,8 scry=scry-6 For r=0 to 10 x=Rand(0,1024)+(Sin(Mills()*0.006*(r+4))*140)+(r*378) y=Rand(0,1024)+(scry*((r*0.3)+0.3))+(r*200) WrapBG x,y Next SetBlend Normal SetParticleSize 64 Flip Forever .Flame SetBuffer BG SetBlend "Burn" SetCol 0,0,0,0.08 Rect 0,0,1024,1024 ResetDraw SetBlend "Light" SetAlpha 0.3 for m=0 to 16 h=Rnd(0,30) s=Rnd(0.7,1) x=Rand(0,1024) y=Rand(0,1024) for n=0 to 16 InkRot h,s,Rnd(0.3,0.6) Oval x+Rnd(-8,8),y+Rand(-8,8),Rand(6,12),Rand(6,12),128 next next SetBuffer FG return

Views 90, Upvotes 16  
Daily Blog , Jse
New games every week!
Site credits : All of the above : Jayenkai
(c) Jayenkai 2023 and onwards, RSS feed 4

Blog - JSE - Skewing.. - AGameAWeek