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

ImGui images are rendered in OpenGL as textures with wrapping always set to GL_REPEAT #24

Open
BenTalagan opened this issue Jan 22, 2025 · 2 comments

Comments

@BenTalagan
Copy link

To my understanding, and to what I've observed when one creates Images with ReaImgui and when they are rendered through OpenGL (for example with DrawList_AddImage), the created textures always use GL_REPEAT as the wrapping mode, whereas it could have been as well GL_CLAMP_TO_BORDER or GL_CLAMP_TO_EDGE.

It seems to me that generally speaking, for Reaper applications (contrary to video games for example), the probability of using wrapping textures is lower than using non-wrapping textures. This can easily lead to artifacts on the edges ; cf a generated texture (created and saved with LICE) :

Image

And the corresponding ReaImGui rendering with DrawList_AddImage (the image is converted from LICE, and streched to fit the window's width ):

Image

We can see on the two borders extrapolation artifacts due to wrapping (the right border is bleeding on the left border which should be completely black, and the right border is slightly deemed because the left part of the image is black).

While it's not at all a priority and not at all critical, maybe the default choice could be another wrapping mode, or this could be decided with a flag.

@BenTalagan BenTalagan changed the title ImGui images are rendered in OpenGL as textures with wrapping set to GL_REPEAT ImGui images are rendered in OpenGL as textures with wrapping always set to GL_REPEAT Jan 22, 2025
@cfillion
Copy link
Owner

It's an intentional choice to make tiled backgrounds easy ("Use values below 0.0 or above 1.0 to tile the image." in the documentation). But a flag to allow controlling the wrapping mode is a good idea.

@BenTalagan
Copy link
Author

Perfectly clear ! Thanks for your answer. 👍

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

2 participants