Photoshop-like layers blending in JME

I have a task of creating a software to work with images in the same way as Photoshop layers, with the accent on implementing the blend modes. I pick OpenGL for this (namely, JME) because I also need to apply shaders to each layer and later will need to do some 3D graphics too. The whole scene is going to be 2D in orthographic projection and the layers are gonna be just basic quads.

Is this possible to do with JME? If so, what would be the best approach - do I make each layer an individual quad with an individual shader and blend mode, or is it more real to make the entire composition and mixing of all layers and their textures in a single shader? There can be many textures, like 100 of them, so idk, if a single shader could handle it…

Also, I find that OpenGL has these blending modes ( http://www.slideshare.net/Mark_Kilgard/blend-modes-for-opengl ), but they are not directly accessible from JME, so idk how to imitate them…

Thanks

Well will a 100 or them no matter what you do, you could easily run into fill rate limits. that much overdraw will tax many cards quite a bit. I mean it is on the order of 100x overdraw, so that is a lot of pixels per sec on a HD monitor or more. Of course if you don’t need 60FPS or if the total size is quite small it could be ok. But again texture trashing and other things will still tend to be an issue.

In jME i do know you could do as like 100 overlapping billboards. Aka quads that always face the camera. I have not done this but doing your own shaders doesn’t look to hard either.

In opengl there are always limits on how many texures you can have bound. Older times even good cards it was like a max of 16 textures at once for a shader. The latest crop of high end ones i really don’t know. Could be as high as 128 i guess.

1 Like