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

NPOT causes small visual glitch in naev #11

Closed
MagaTailor opened this issue Nov 1, 2016 · 16 comments
Closed

NPOT causes small visual glitch in naev #11

MagaTailor opened this issue Nov 1, 2016 · 16 comments

Comments

@MagaTailor
Copy link

NPOT textures has to be ticked in the video settings and then:

$ LIBGL_NPOT=2 naev
LIBGL: Initialising glshim
LIBGL:loaded: libGLESv1_CM.so
LIBGL:loaded: libEGL.so
 Naev v0.6.1
 Sea of Darkness
LIBGL: built on Nov  1 2016 21:30:52
LIBGL: Extension GL_OES_point_sprite detected and used
LIBGL: Extension GL_OES_point_size_array detected
LIBGL: Extension GL_OES_framebuffer_object detected and used
LIBGL: Extension GL_OES_packed_depth_stencil detected and used
LIBGL: Extension GL_OES_depth24 detected and used
LIBGL: Extension GL_OES_rgb8_rgba8 detected and used
LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected
LIBGL: Extension GL_OES_depth_texture detected and used
LIBGL: Max texture size: 4096
LIBGL: Texture Units: 8, Max lights: 8
LIBGL: Implementation Read is GL_RGB/GL_UNSIGNED_SHORT_5_6_5
LIBGL: Expose GL_ARB_texture_non_power_of_two extension
LIBGL: Current folder is:/home/odroid
libGL: warning, gles_glBlendFuncSeparate is NULL

leads to clearly visible planet tiles outlines (or whatever that is):
naev-glitch

@ptitSeb
Copy link
Owner

ptitSeb commented Nov 1, 2016

Yes, LIBGL_NPOT=2 expose a function that is not completly supported for now. LIBGL_NPOT=1 is 100% emulated, but not 2 for now. I may work on that, but real support as not been mandatory for anything yet.

@MagaTailor
Copy link
Author

I see, Expose limited NPOT extension sounded as if it might be too limited so I never tried that. My bad! :)

@ptitSeb
Copy link
Owner

ptitSeb commented Nov 1, 2016

Limited NPOT is : can use texture not NPOT, but cannot use Repeat or Mirror on NPOT, and no Mipmap neither.
basicaly what glshim does is can use NPOT texture (by creating a bigger NPOT texture), and so no Repeat or Mirror. Mipmap is supported but can lead to some artifact on the border (as you have already seen). That effect can probably be mitigated for textures with an alpha channel if I upload an empty texture first.

Full NPOT can do whatever they wants. Emulating that on non-NPOT hardware would mean resizing a non-NPOT texture to NPOT, meaning a lot of computational power at each upload, plus some artefact du to the resizing (espcially on SubImage manipulations).

@ptitSeb
Copy link
Owner

ptitSeb commented Nov 1, 2016

I'll close this ticket.

@ptitSeb ptitSeb closed this as completed Nov 1, 2016
@MagaTailor
Copy link
Author

Talking of glitches, just remembered this unrelated mouse pointer problem in TOME:

cursor

LIBGL_NOLUMALPHA makes no difference and capturing the screen normally shows just the regular X-window mouse pointer.

@ptitSeb
Copy link
Owner

ptitSeb commented Nov 1, 2016

did you retry with latest changes (with added Pixmap, PBuffer and multiple glX Context, it may have just solved the issue) ?
I never compile ToME, and didn't look at the code, so no idea how the mouse cursor is built.

@MagaTailor
Copy link
Author

On Tue, 01 Nov 2016 15:25:14 -0700
ptitSeb notifications@github.com wrote:

did you retry with latest changes (with added Pixmap, PBuffer and multiple glX Context, it may have just solved the issue) ?

I was using the latest glshim master and it's still there. Any special options to try?

@ptitSeb
Copy link
Owner

ptitSeb commented Nov 1, 2016

Ah no. I need to look in the code to see how that cursor is built.

@MagaTailor
Copy link
Author

On Tue, 01 Nov 2016 15:55:25 -0700
ptitSeb notifications@github.com wrote:

Ah no. I need to look in the code to see how that cursor is built.

Thanks!

@ptitSeb
Copy link
Owner

ptitSeb commented Nov 4, 2016

@petevine : it turned out it's not a glshim issue, but an SDL2 one. Check my github repo of SDL2, there is push about this: ptitSeb/SDL2@604d108

@MagaTailor
Copy link
Author

Nice find! However, and I hope I'm not misremembering things, the white silhouette wasn't present on real hardware. Could the fix be incomplete?

untitled

@ptitSeb
Copy link
Owner

ptitSeb commented Nov 5, 2016

white silouette is there depending on the theme.

But if you want, you can change the if(alpha==0) by a if(alpha<25) to have something probably better (there are 2 way of putting cursor in X11 in SDL2, and the "legacy" way use something similar).

@MagaTailor
Copy link
Author

Yes, it's much better that way but it still looks artifactishly wide. The white background is not visible on x86/OpenGL 1.5, just a thin blue outline. I fired up my old Athlon box to take this picture :)

untitled2

@ptitSeb
Copy link
Owner

ptitSeb commented Nov 5, 2016

Not much can be done here. It's X11 functions, and it seems they behave differently for machine to machine.
Play with the alpha stuff, put alpha<125 to remove moste of the semi-transparent stuff, or even up to <255 to just discard everything not solid color (but that will probably remove the blue aura too)

@ptitSeb
Copy link
Owner

ptitSeb commented Nov 5, 2016

For the record, here is the original PNG image (for the dark theme)
mouse

@ptitSeb
Copy link
Owner

ptitSeb commented Nov 5, 2016

And here the image for default theme.
mouse

Vera-Firefly pushed a commit to Vera-Firefly/Holy-GL4ES that referenced this issue Jul 11, 2024
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