Canvas Light (WIP)

Talk about making games.

Re: Canvas Light (WIP)

Postby digiot » Fri Feb 20, 2015 4:34 pm

Hblade wrote:IN fact, not using PNG's is probably more resource hungry haha :D

I've read somewhere here, that using larger pngs with transparency costs massive fps !
Hblade wrote:Unlimited sizing without pixelation,...

That has come into my mind, too ! So you can change the size of the light more smoothly,
than using a bunch of premade sizes of pngs. Scaling and rotating functions are not
my thing...


Cheers !
User avatar
digiot
 
Posts: 211
Joined: Sat Mar 17, 2012 2:29 pm
Score: 7 Give a positive score

Re: Canvas Light (WIP)

Postby Hblade » Fri Feb 20, 2015 4:44 pm

I'm working on a release version as we speak =D Also, made something cool... now you can define smoothness based on the size, so can make it barely soft, and super soft :D Lookie:
soft 1.png

soft 2.png
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Canvas Light (WIP)

Postby Jagmaster » Fri Feb 20, 2015 5:31 pm

I remember experimenting with stuff like this.

I had a draw actor function with a sprite that had a soft ring for the light, and it looked like like the image you have above.

however, when I added 2 lights it looked like this ->

Image

I wanted to do this ->

Image

I tried an algorithm with my own sine/cosine circle drawing function (similar to yours) which checked the current pixel, and added the transparency of the previous pixel.
And it tanked the frame rate...


so, I gave up and just went with hard lights for my setup :P

So do you think it's even possible? It was a couple years ago, perhaps I did something completely wrong?
User avatar
Jagmaster
 
Posts: 875
Joined: Sun May 08, 2011 4:14 pm
Location: Not where you think.
Score: 82 Give a positive score

Re: Canvas Light (WIP)

Postby Hblade » Fri Feb 20, 2015 5:44 pm

I actually have a way to fix that just havent gotten around to it yet O: Basically using structs and checking if a pixel is in the spot before it places the pixel =D And if the pixel has a darker opacity value, it places the new one, if not, it does nothing =D This will cause the light to blend together like that, but it's a bit difficult lol O:

EDIT: I see what you're talking about by the performance drop lol O: It seriously does impact it big time haha O:
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Canvas Light (WIP)

Postby bat78 » Fri Feb 20, 2015 8:15 pm

Actually "Hblade's" elipse algorithm looks very similar to Novice's. Not saying the same.

PNG isn't hard for me to implement in my project.
It requires less resource than the bitmap. Currently bitfox supports 3 channeled bmp (RGB).
I could easily make it support 4 channels (RGBA) But why, since gE doesn't understad of bitmap's transparancy?

On the other hand, in v2 I will create x32bit (4 channels) PNG. It consists of a simple header with system-specific information, RLE compression that is very similar to the one I created by myself and the chunks respectively. In bitfox v3 I can also include animated pngs both for reading and writing.
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: Canvas Light (WIP)

Postby Hblade » Fri Feb 20, 2015 8:24 pm

Cool, bat =D
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Canvas Light (WIP)

Postby bat78 » Fri Feb 20, 2015 9:35 pm

Hblade wrote:Cool, bat =D

No it's not. Certainly not for you Hblade. I know you are only interested in games/game development.
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: Canvas Light (WIP)

Postby Hblade » Fri Feb 20, 2015 9:57 pm

I dont know lol. Also, omg I developed a way to do it that doesn't cause lag! O:

(filling circle I mean..)

1280x720:
fast.png
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Canvas Light (WIP)

Postby bat78 » Fri Feb 20, 2015 10:34 pm

The previous one didn't cause any lag?
The future of "Game-Editor" here
User avatar
bat78
 
Posts: 816
Joined: Sun Dec 14, 2008 9:13 pm
Location: Bulgaria, Sofia
Score: 88 Give a positive score

Re: Canvas Light (WIP)

Postby Hblade » Fri Feb 20, 2015 10:37 pm

It did when they got large. But this new method makes it super fast.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Previous

Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron