pygfx icon indicating copy to clipboard operation
pygfx copied to clipboard

Make a logo for overlay with a mesh

Open hmaarrfk opened this issue 1 year ago • 4 comments

image

I wanted to learn about meshes, and so I figured I would help Almar with a suggestion I made offline.

You guys killed me with your gradient. I got all the coordinates by writing down the numbers from the svg using inkscape. You even had one for the blue....

I don't really like it since I wish it was pixel perfect. I also want to make it easier to use in the examples. currently, I still feel it adds too many lines of code in the example.

I wish I was able to make it a point material, and then we could just place it anywhere, and ensure that it is pixel perfect on the GPU. All gradients included. That would require a custom shader, but it would be pretty cool!

hmaarrfk avatar Jun 08 '24 02:06 hmaarrfk

I guess you could render it as a sprite via a texture. But obviously your approach is going to look crisp, no matter what. Cool stuff!

Korijn avatar Jun 08 '24 10:06 Korijn

One challenge I faced with rendering logos with transparency as images is that it really depends on the blend mode to not hide the stuff behind the transparent region. I'm hoping that with a mesh this is less of a concern.

hmaarrfk avatar Jun 08 '24 11:06 hmaarrfk

The chosen colors mean that it looks great on the many example backgrounds without any outline. image

hmaarrfk avatar Jun 08 '24 13:06 hmaarrfk

The one thing i'm worried about is that the new function

gfx.render_with_logo

removes the call

renderer.render()

or

renderer.flush()

from the examples. For this reason, I didn't want to add this to the tutorial examples. But maybe there is a way to do it well.

hmaarrfk avatar Jun 08 '24 14:06 hmaarrfk