Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shaders on drawTiles (or individual DisplayObjects) #4

Open
jon914 opened this issue Apr 10, 2014 · 5 comments
Open

Shaders on drawTiles (or individual DisplayObjects) #4

jon914 opened this issue Apr 10, 2014 · 5 comments

Comments

@jon914
Copy link

jon914 commented Apr 10, 2014

In a rough sense, what would be involved in supporting shaders on drawTiles()?

Would it require a totally different approach (modifying OpenFL/Lime) or could it somehow be worked into this hands-off approach?

@0proto
Copy link

0proto commented Apr 10, 2014

As far as i know move to shaders (GLSL, you mean?) will, first of all, make the openfl flash target broken, because flash should use the different shader approach (AGAL?) via stage3d. So, yes, it involves the global changes in OpenFL. BTW i've seen bunch of projects which were working on it, for instance https://github.com/wighawag/openfl-stage3d.

@jon914
Copy link
Author

jon914 commented Apr 10, 2014

I'm fine with this not working on Flash. This would be primarily targeted towards standalone games and mobile to a lesser extent.

@MattTuttle
Copy link
Member

As far as I can tell it will require modifications to Lime. See my last response in this topic. http://forum.haxepunk.com/index.php?topic=656.msg2589#msg2589

@0proto
Copy link

0proto commented Apr 10, 2014

Actually there are plans for user-programmable shaders in Lime roadmap - https://github.com/openfl/lime/wiki/Roadmap. So, i guess its a matter of time to get our hands dirty with GLSL stuff :)

@jon914
Copy link
Author

jon914 commented Apr 12, 2014

@MattTuttle - Thanks for linking to that post.

From what I understand, the issue is that with HaxePunk, you're rendering everything to a single surface, so there's no way today to inject OpenGL calls in between because everything's rendered all in one go. You'd need to "flush" (instruct the game to immediately draw) the batched graphics calls to be able to then capture the image data and apply shaders to them. That makes sense.

Suppose that what I'm doing is based on the DisplayList, using individual Sprites (one per "actor"), but I'm still drawing those Sprites using drawTiles. Does that still require a similar approach? I guess what I really want to know is whether I can somehow "capture" a Sprite's image data in render(), so I can apply a shader to it individually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants