Is there a plan to support something like SpriteIlluminator 2D dynamic lighting?

309 views
Skip to first unread message

Adam Harte

unread,
Feb 4, 2015, 10:59:07 PM2/4/15
to haxef...@googlegroups.com
I have been wanting to play with 2d lighting in my Flixel games for a while now, and there doesn't seem to be any easy method of doing this.

Is it possible that someone is working towards supporting something like this: https://www.codeandweb.com/spriteilluminator

That would be so amazing!

Tembac

unread,
Feb 4, 2015, 11:47:18 PM2/4/15
to haxef...@googlegroups.com
I think this has to be added to Openfl before it can be added to Flixel.

Adam Harte

unread,
Feb 15, 2015, 3:31:14 PM2/15/15
to
Hmm, what has OpenFL got to do with it? I thought Flixel does not even use OpenFL's rendering system. So if it is just a case of loading the assets, then that should not be a problem in Flixel.

It is just a shame that dynamic lighting is already offered in all the main 2d game libraries (e.g. Unity, cocos2d, SpriteKit, CoronaSDK, and LibGDX).

Seanw265

unread,
Feb 16, 2015, 6:25:49 PM2/16/15
to haxef...@googlegroups.com
That would be fantastic! However I think we would need to be very careful with performance with something like that -- consider flash completely out of the picture. That strikes up another problem which is that currently the C++ targets don't have access to most blendmodes (only multiply, screen, and add I believe). And from what I understand, shader support is basically out of the question. I just don't know how it would work.

All that being said, I'd love to see it implemented!

Ohmnivore

unread,
Feb 17, 2015, 12:03:14 AM2/17/15
to haxef...@googlegroups.com
Shaders work fantastically in flixel's dev branch. There's an example in flixel-demo's dev branch as well.

Chii Chan

unread,
Feb 17, 2015, 5:14:02 AM2/17/15
to haxef...@googlegroups.com
when you say flixel, do you mean actual flixel, or haxeflixel? I m assuming haxeflixel, since this is the forum for it, but...

Ohmnivore

unread,
Feb 17, 2015, 8:45:42 AM2/17/15
to haxef...@googlegroups.com
HaxeFlixel :)

Valerio Santinelli

unread,
Feb 17, 2015, 10:26:55 AM2/17/15
to haxef...@googlegroups.com
Is there a release date planned for the new version? ;)

Ohmnivore

unread,
Feb 17, 2015, 12:30:32 PM2/17/15
to haxef...@googlegroups.com
I don't know but you can always just set it up on haxelib: http://haxeflixel.com/documentation/install-development-flixel/

Seanw265

unread,
Feb 18, 2015, 9:51:46 AM2/18/15
to haxef...@googlegroups.com
Well I stand happily corrected!

John Girvin

unread,
Feb 25, 2015, 7:52:55 PM2/25/15
to haxef...@googlegroups.com
What's the name of the shader demo?

Ohmnivore

unread,
Feb 26, 2015, 9:04:43 AM2/26/15
to haxef...@googlegroups.com

John Girvin

unread,
Feb 26, 2015, 10:08:44 AM2/26/15
to haxef...@googlegroups.com
Great, thanks. Are shaders just for full screen effects or can they be applied to individual sprites too?

Ohmnivore

unread,
Feb 27, 2015, 12:28:18 AM2/27/15
to haxef...@googlegroups.com
I don't know really. I've never actually tried shaders or looked at source code with shaders. I'm pretty sure there's a way though since the shader most likely acts on a BitmapData.

Ohmnivore

unread,
Feb 27, 2015, 12:38:28 AM2/27/15
to haxef...@googlegroups.com
Okay so I looked at the source, and flixel uses this class for a lot of the shader code: http://www.openfl.org/documentation/api/openfl/gl/GL.html .
Notice the "static function bindBitmapDataTexture(texture:BitmapData):Void" function? I think you might be able to do something with it if you pass your FlxSprite's pixel property. I don't fully understand flixel's shader code yet, so i can't help any more than that yet.


On Thursday, February 26, 2015 at 10:08:44 AM UTC-5, John Girvin wrote:
Reply all
Reply to author
Forward
0 new messages