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

Flickering and No display, in the Intel HD Graphics #73

Open
tictac1234 opened this issue May 30, 2022 · 11 comments
Open

Flickering and No display, in the Intel HD Graphics #73

tictac1234 opened this issue May 30, 2022 · 11 comments
Labels
4.0 bug Something isn't working needs verification

Comments

@tictac1234
Copy link

Flickering occurs in the Example program.

This is my environment ↓
キャプチャ2

Black flicker, After that nothing is displayed...
B

At first the graphics appear fine, but while resizing the window by dragging, there is a black flicker, After that it turns black and nothing appears.
(I have not rewritten anything in the program.)

My image is that the buffer is running out of write space.

As long as you have time, I would appreciate your investigation.
Thank you.

@NogginBops NogginBops added bug Something isn't working needs verification 4.0 labels Jul 15, 2022
@lrjohn
Copy link

lrjohn commented Jul 22, 2022

I had a similar issue. Only getting black screen in the control, but no flickering on resize. I have Intel UHD Graphics 620 and NVIDIA GeForce MX 130. I usually disable NVIDIA card to conserve battery power while I work. When I enabled the card it works fine. GameWindow (without using GLWpfControl) however works perfectly fine while my NVIDIA card is disabled.

@clbsoft
Copy link

clbsoft commented Jul 28, 2022

I have tested the example on many different graphics chips. I have found that it does not work (black screen) on:
Intel HD Graphics 400
Intel HD Graphics 4400

I does however work on these:
Intel HD Graphics 520
Intel HD Graphics 620

@pjdevs
Copy link

pjdevs commented Aug 12, 2022

I'm experiencing a similar issue.
On Intel HD Graphics 620, some meshes are flickering very fast while it calms down when triggering some events (don't know if it is related) like clicking on the control, moving the camera with the mouse, etc.
On Intel UHD Graphics 630, it starts with a black screen but comes back when resizing the window, the control starts blocking if no events are triggered but you can have a chance to get it back by clicking everywhere, the control is frozen when clicking and dragging.
I tested the same program on both cards with an OpenTK GameWindow and it works fine.

NB : The WPF control works fine on a laptop GTX 1060

@Sicheng-Wei
Copy link

Similar issue.
When using Intel Xe graphics, the ExampleScene using OpenGL 2.1 is OK. However, once I switch to OpenGL 3.3+, the fragment shader seems useless.
Also, when applying my own shaders (texture mapping), only getting black screen.
NV card works fine.

My triangle code is as below, the color should be rgb(1.0f, 0.8f, 0.6f), but it shows white.

GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
float[] vertices = {
    -0.5f, -0.9f, 0.0f,
     0.5f, -0.5f, 0.0f,
     0.0f,  0.5f, 0.0f
};

int VAO = GL.GenVertexArray();
int VBO = GL.GenBuffer();

// VAO Binding
GL.BindVertexArray(VAO);

// VBO Binding & vertices to GPU Buffer
GL.BindBuffer(BufferTarget.ArrayBuffer, VBO);
GL.BufferData(BufferTarget.ArrayBuffer, sizeof(float) * 9, vertices, BufferUsageHint.StaticDraw);

// VBO Binding & vertices to GPU Buffer
GL.VertexAttribPointer(0, 3, VertexAttribPointerType.Float, false, 3 * sizeof(float), 0);
GL.EnableVertexAttribArray(0);

// Vertex Shader
string vertexShaderSource = "#version 330 core\nlayout (location = 0) in vec3 aPos;\n\nvoid main()\n{\n    gl_Position = vec4(aPos.x, aPos.y, aPos.z, 1.0);\n}";
int vertexShader = GL.CreateShader(ShaderType.VertexShader);
GL.ShaderSource(vertexShader, vertexShaderSource);

// Fragment Shader
string fragmentShaderSource = "#version 330 core\nout vec4 FragColor;\n\nvoid main()\n{\n    FragColor = vec4(1.0f, 0.8f, 0.6f, 1.0f);\n} ";
int fragmentShader = GL.CreateShader(ShaderType.FragmentShader);
GL.ShaderSource(fragmentShader, fragmentShaderSource);

// Attach Shader to Program
int shaderProgram = GL.CreateProgram();
GL.AttachShader(shaderProgram, vertexShader);
GL.AttachShader(shaderProgram, fragmentShader);
GL.LinkProgram(shaderProgram);
GL.UseProgram(shaderProgram);

// Draw Triangle
GL.DrawArrays(PrimitiveType.Triangles, 0, 3);

// Clear Buffers
GL.DeleteVertexArray(VAO);
GL.DeleteBuffer(VBO);
GL.DeleteProgram(shaderProgram);

image

@BoyBaykiller
Copy link

@Sicheng-Wei You forgot to call glCompileShader after glShaderSource.
There is a feature called OpenGL Debug Output which would have told you abot this error.

@tictac1234
Copy link
Author

Thank you everyone for the validation.
But is there any idea to fix this problem...?

@Sicheng-Wei
Copy link

@BoyBaykiller Thanks a lot, it actually solves my problem. It's my code's bug. I will figure out more about debug output problems.

@IscanderAbdullah
Copy link

IscanderAbdullah commented Jun 22, 2023

I had a flickering issue when using OpenGL versions 3.2, 3.3 with different Intel graphics cards (Intel UHD, Intel Iris Plus, Intel Iris Xe). But with OpenGL 3.0 everything worked fine. I didn't even change the shader code, I just ran GlWpfControl with the new OpenGL version settings. Also everything is working when some not existing OpenGl official version is set, like v3.6. I suppose it's a graphics card driver issue.

@softwareantics
Copy link
Contributor

I'm also experiencing this issue with Intel UHD Graphics on my machine. I've tested this on a different machine with an RTX 3080 and the issue does not persist.

I think some further investigation is required.

@softwareantics
Copy link
Contributor

A bit of digging:

I updated my drivers, the issue still persisted. I ran the example project and rendering was fine. I then changed the ContextProfile from Core to Compatability - and it works for me.

@NogginBops
Copy link
Member

Interesting!
The specification for NV_DX_interop does say "OpenGL 2.1 is required." so I guess that could be interpreted as a need for a compatibility context. My guess is that this is a intel driver limitation, maybe some flag or codepath in the driver isn't being taken when not in compatibility mode.

Maybe we should open an issue on the intel driver issue tracker to see if this is intentional.

softwareantics pushed a commit to softwareantics/FinalEngine that referenced this issue Apr 17, 2024
- Capped NUnit, OpenTK and Moq to their respective versions
- Downgraded OpenTK to 4.3.0 for editor integration - see opentk/GLWpfControl#73
- Renamed TagComponent to Tag
- Removed FinalEngine.Rendering.Components
- Transform now implements IEntityComponent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.0 bug Something isn't working needs verification
Projects
None yet
Development

No branches or pull requests

9 participants