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

not working #22

Open
vautieri opened this issue Feb 23, 2021 · 4 comments
Open

not working #22

vautieri opened this issue Feb 23, 2021 · 4 comments

Comments

@vautieri
Copy link

Tried it, nothing shows up. I am using nvidia hardware, also tried intel hardware. If I take the fragment shader and start with something higher than 0, I do see the blocks where the text is suppose to be (escape also rotates...). the glyph atlas looks like its working. the other atlas I don't think is working or making its way into she shader??? just a hunch assuming this code is suppose to work. if I take the nodata (0) and change it to something like 4, I do see the numbers in the bitmap saved to disk, so I believe the buffer on the cpu is getting created. IF I leave it at 0, it looks like its an all black texture on the CPU ( I didn't look at every single pixel at 1:1 resolution).

I have a hunch something is going on here with uGridAtlas.. without getting deep into the code .. I am developing on windows, I have a hunch you might be linux.. don't think that matters unless you were getting away with a non conformity with the opengl driver you were using??? (again, could be 1000% wrong, but I am assuming the code you have is suppose to work, so other than a GPU issue, what else would it be)

ivec4 indices1 = ivec4(texelFetch(uGridAtlas, indicesCoord, 0) * 255.0);

// The mid-inside flag is encoded by the order of the beziers indices.
// See write_vgrid_cell_to_buffer() for details.
bool midInside = indices1[0] > indices1[1];
@azsn
Copy link
Owner

azsn commented Feb 25, 2021

Hi! I'm currently developing on Mac, so AMD GPU. I've never tried it on Windows. It's definitely possible I've stumbled across undefined / non-conformant behavior. And because I'm on Mac, my OpenGL version is very old (GL Version: 4.1 ATI-2.11.23) because Apple is dumb. I don't own a physical Windows machine, but I'll see if I can setup the environment and run this in a Windows VM and reproduce the problem. Then I'll try to debug it.

The gridAtlas.bmp that's written to disk should appear nearly solid black in most cases -- the values written are normally very low numbers. bezierAtlas.bmp should be partially solid black but with a bunch of noise at the bottom. Here are my bmps from right when the program opens (before typing anything new) when running directly from the latest commit on master, although I had to convert them to a JPG because github doesn't like bmps, so they're compressed/changed a slightly

gridAtlas.bmp (not actually solid black, zoom in near the bottom)
gridAtlas

bezierAtlas.bmp

bezierAtlas

I'd expect your atlases to match these, because the logic which generates the atlases doesn't depend on OpenGL at all. So if your atlases don't match, that's very strange. But otherwise, it's likely to be some shader or OpenGL configuration mistake.

@vautieri
Copy link
Author

vautieri commented Feb 26, 2021 via email

@azsn
Copy link
Owner

azsn commented Feb 26, 2021

Okay, good to know those parts are working at least. And yeah, debugging fragment shader issues is hard. It will probably be a while before I have time to try to reproduce and debug this myself. If you want to try to debug this more yourself, I think there are some good tools for debugging the OpenGL rendering pipeline. I've never used any of them, but one of the other people who helped me on this project was using a program called "renderdoc" which looked neat. Maybe give it a try?

@azsn
Copy link
Owner

azsn commented Apr 26, 2021

Hey @vautieri , I just merged #23 by @Confucius19 which fixed a bug with the data vData attribute on some hardware. This might be the problem you were experiencing; with this bug, the glyph quads would still be in the right position (hence them showing up when you set a fixed alpha value) but would be invisible because all the glyph data is corrupted. Update to the latest commit and try again, let me know if it works for you now! Thanks

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