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

Masking in TileSheets #101

Closed
thomasuster opened this issue Aug 17, 2013 · 4 comments
Closed

Masking in TileSheets #101

thomasuster opened this issue Aug 17, 2013 · 4 comments

Comments

@thomasuster
Copy link
Member

I'm building a game and we're pretty invested in TileSheets. We really need TileSheet masking.

I tried editing OpenGLContext.cpp using information from this stackoverflow post but was unable to get things working.
http://stackoverflow.com/questions/5097145/opengl-mask-with-multiple-textures

image

I don't care too much about the workflow, you guys will probably have the best understanding on what's most appropriate. I'd be okay with something as high level as...
drawTiles(graphics, tileData, flags | Tilesheet.IS_MASK);
where the first tile is treated as the mask and all remaining tiles are masked.

Or as low level as specifying the glBlendFuncSeparate xor glBlendFunc per tileData.

@willemrosenthal
Copy link

This would be insanely helpful. I've hit a mask wall repeatedly- Please add it!

@delahee
Copy link
Contributor

delahee commented Mar 13, 2014

you can use stencil buffer to do this

@thomasuster
Copy link
Member Author

Hey @delahee . I googled "OpenFL stencil buffer" and got back OpenGL stuff. Stencil buffer isn't in OpenFL right?

@delahee
Copy link
Contributor

delahee commented Mar 14, 2014

hmmm let me look ... yes it has : https://github.com/openfl/openfl-native/blob/master/openfl/gl/GL.hx

the openfl is a pretty confusing name for googl levensthein so you might want to look in github code directly.

Good luck !

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

No branches or pull requests

3 participants