On 21/03/20 2:37 am, Jonathon Parker wrote:
Yes. If you look into the thread I have a complete "working" example
https://groups.google.com/d/msg/pyglet-users/h0uVWBjkeBU/67zbZwJcDQAJ
I turn on blend and tried more functions that the one listed and nothing
worked. Do you see anything in the code I missed?
I just looked at the implementation of ImageData.blit_into(),
and I can see what the problem is.
It's NOT an OpenGL drawing operation. It just uses one of the
glTexSubImage* calls to overwrite part of the texture data in
vram. The blending options have no effect on that -- it's just
copying bytes.
To get blending to work here, you'll have to set the texture
up as a rendering target and then use OpenGL drawing operations
to draw into it. I don't know whether pyglet provides any
high-level support for that. There's a post here about doing it
using low-level gl calls:
https://leovt.wordpress.com/2015/10/04/render-to-texture-with-python-3-and-pyglet/
Alternatively, you could do the blending calculations yourself,
using numpy or otherwise, and then blit the result onto the texture.
--
Greg
--
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyglet-users/3320c2f9-2799-6046-3386-5f44dda57416%40canterbury.ac.nz.