Giter VIP home page Giter VIP logo

Comments (28)

LiangliangNan avatar LiangliangNan commented on May 18, 2024

Thanks for the suggestion!
This is easy to implement: pass the rectangle to the vertex shader and test if each point lies inside/outside the rectangle in the shader. You probably need the Shader Storage Buffer to retrieve the result.
I may include this in a future release.

from easy3d.

461353349 avatar 461353349 commented on May 18, 2024

It is nice of you!
I hadnot thought that glsl shader could do these.

from easy3d.

461353349 avatar 461353349 commented on May 18, 2024

I uncheck the WITH_UNWIND and WITH_GFLAGS, Because cmake couldnot find the responding files. When I run the example, I couldnot pick the model or the face.
image

from easy3d.

LiangliangNan avatar LiangliangNan commented on May 18, 2024

from easy3d.

461353349 avatar 461353349 commented on May 18, 2024

I have loaded the lastest code and recompiled, But the results are same.

from easy3d.

LiangliangNan avatar LiangliangNan commented on May 18, 2024

Did you have similar issues with other examples? e.g., Ambient Occlusion, Shadow

from easy3d.

461353349 avatar 461353349 commented on May 18, 2024

I think the following examples are OK. But Tutorial_504_SoftShadow couldnot show the model and crash.
image
image

from easy3d.

461353349 avatar 461353349 commented on May 18, 2024

Tutorial_309_PointSelection is OK.
Tutorial_307_ModelPicker and Tutorial_308_FacePicker could show the model, But couldnot rotate the model, Whenever the left mouse clicked, There would show the following the information.
image

from easy3d.

LiangliangNan avatar LiangliangNan commented on May 18, 2024

I could not reproduce the issue. Tests succeeded on 3 different laptops (even on a 12-year old one; both NVidia and AMD graphics cards).

You provided information is not sufficient to figure out the issues. I would suggest you do the following tests one by one and let me know how they are different (for each of the tests). Then I may understand the cause of the issue.

  • Test 1: request a higher version of OpenGL context when creating the viewer.
    On line 37 of picker_viewer.cpp of FacePicker, ask for 4 samples, OpenGL version 3.3, i.e.,Viewer(title, 4, 3, 3) , or without smaples Viewer(title, 0, 3, 3)

  • Test 2: on line 253 of picker_surface_mesh.cpp, change the samples to 4 (so it is the same as you have requested for the viewer), i.e., fbo_ = new FramebufferObject(width, height, 4);

from easy3d.

461353349 avatar 461353349 commented on May 18, 2024

I grab the latest code, update opengl to the latest, and reset vs2017.
Test 1: no difference.
Test 2: information as the following.
image

from easy3d.

LiangliangNan avatar LiangliangNan commented on May 18, 2024

from easy3d.

461353349 avatar 461353349 commented on May 18, 2024

image

from easy3d.

LiangliangNan avatar LiangliangNan commented on May 18, 2024

NVidia and AMD(ATI) GPUs are all OK. Intel Graphics cards are buggy!!!
Tricky because I don't have an intel graphics card.

I added code to print more debug information. Please grab the new code, and on line 57 of "picker.cpp", change #if 0 to #if 1. Run in Debug mode.

#if 0
            fbo_->print_attachments();
            fbo_->print_draw_buffers();
            fbo_->print_read_buffer();
#endif

from easy3d.

461353349 avatar 461353349 commented on May 18, 2024

First I switch Graphics from Intel to NVidia, It is OK!

Then I grab the new code, switch Graphics to Intel, and run in debug mode. At last the program crashes, and I notice the amount of memory the process used has exceeded the physical memory.

image

from easy3d.

LiangliangNan avatar LiangliangNan commented on May 18, 2024

That has no actual information.
I need to look at the console window, to see the debug information.

from easy3d.

461353349 avatar 461353349 commented on May 18, 2024

I0209 18:01:43.709262 640 logging.cpp:83] logger initialized
I0209 18:01:43.721263 640 logging.cpp:84] Executable path: D:\Project\Post\Ope
nGL\Easy3D\Easy3D\Build\bin\Debug
I0209 18:01:43.722263 640 logging.cpp:85] Current working dir: D:\Project\Post
\OpenGL\Easy3D\Easy3D\Build\tutorials\Tutorial_308_FacePicker
I0209 18:01:44.153287 640 viewer.cpp:244] OpenGL vendor: Intel
I0209 18:01:44.155288 640 viewer.cpp:245] OpenGL renderer: Intel(R) H
D Graphics 4600
I0209 18:01:44.157289 640 viewer.cpp:246] OpenGL version requested: 3.3
I0209 18:01:44.159288 640 viewer.cpp:247] OpenGL version received: 3.3.0 - Bu
ild 10.18.14.4294
I0209 18:01:44.161288 640 viewer.cpp:248] GLSL version received: 3.30 - Bui
ld 10.18.14.4294
I0209 18:01:44.163288 640 viewer.cpp:262] Samples received: 4 (4 reque
sted, max support is 8)
I0209 18:01:44.165288 640 viewer.cpp:267] DPI scaling: 1
surface mesh loaded (#face: 25, #vertex: 26, #edge: 51). Time: 96.1ms
I0209 18:01:44.343298 640 renderer.cpp:228] num of vertices in model/sent to G
PU: 26/26
current model: 0, D:\Project\Post\OpenGL\Easy3D\Easy3D\Build\bin/resources/data/
quad_mesh/P.off
------------ Picker Viewer usage ----------
Press the mouse to pick a face

debug : Medium - API - Performance : API_ID_RECOMPILE_FRAGMENT_SHADER performanc
e warning has been generated. Fragment shader recompiled due to state change.
Framebuffer incomplete, attachments must have same number of samples per pixel.
Current framebuffer is bind to framebuffer object 1
color attachment 0:
this attachment is a render buffer
this attachment is a render buffer with name: 1
render buffer width = 960
render buffer height = 800
render buffer samples = 1
render buffer internal format = 0x8058
render buffer actual resolution for the red component = 8
render buffer actual resolution for the green component = 8
render buffer actual resolution for the blue component = 8
render buffer actual resolution for the alpha component = 8
render buffer actual resolution for the depth component = 0
render buffer actual resolution for the stencil component = 0
color attachment 1:
this attachment is empty
color attachment 2:
this attachment is empty
color attachment 3:
this attachment is empty
color attachment 4:
this attachment is empty
color attachment 5:
this attachment is empty
color attachment 6:
this attachment is empty
color attachment 7:
this attachment is empty
depth attachment:
this attachment is a render buffer
this attachment is a render buffer with name: 2
debug : High - API - ERROR : Error has been generated. GL error GL_INVALID_OPERA
TION
render buffer width = 960
render buffer height = 800
render buffer samples = 1
render buffer internal format = 0x8058
render buffer actual resolution for the red component = 8
render buffer actual resolution for the green component = 8
render buffer actual resolution for the blue component = 8
render buffer actual resolution for the alpha component = 8
render buffer actual resolution for the depth component = 0
render buffer actual resolution for the stencil component = 0
GL error:
file: framebuffer_object.cpp
line: 1239
function: easy3d::FramebufferObject::_print_attachment
info: Invalid operation (The specified operation is not allowed in the c
urrent state)
stencil attachment:
this attachment is a render buffer
this attachment is a render buffer with name: 2
debug : High - API - ERROR : Error has been generated. GL error GL_INVALID_OPERA
TION
render buffer width = 960
render buffer height = 800
render buffer samples = 1
render buffer internal format = 0x8058
render buffer actual resolution for the red component = 8
render buffer actual resolution for the green component = 8
render buffer actual resolution for the blue component = 8
render buffer actual resolution for the alpha component = 8
render buffer actual resolution for the depth component = 0
render buffer actual resolution for the stencil component = 0
GL error:
file: framebuffer_object.cpp
line: 1239
function: easy3d::FramebufferObject::_print_attachment
info: Invalid operation (The specified operation is not allowed in the c
urrent state)
there are 8 draw buffers.
draw buffer[0] = GL_COLOR_ATTACHMENT0
draw buffer[1] = GL_NONE
draw buffer[2] = GL_NONE
draw buffer[3] = GL_NONE
draw buffer[4] = GL_NONE
draw buffer[5] = GL_NONE
draw buffer[6] = GL_NONE
draw buffer[7] = GL_NONE
read buffer = GL_BACK
framebuffer not valid
debug : Medium - API - Performance : API_ID_RECOMPILE_FRAGMENT_SHADER performanc
e warning has been generated. Fragment shader recompiled due to state change.
source framebuffer not valid

from easy3d.

LiangliangNan avatar LiangliangNan commented on May 18, 2024

How many samples did you request for the frame buffer?
The log says 1.

from easy3d.

461353349 avatar 461353349 commented on May 18, 2024

I change Viewer(title, 4, 3, 3) and fbo = new FramebufferObject(width, height, 4);_ as you said, then run in debug mode.

------------ Picker Viewer usage ----------
Press the mouse to pick a face

debug : Medium - API - Performance : API_ID_RECOMPILE_FRAGMENT_SHADER performanc
e warning has been generated. Fragment shader recompiled due to state change.
Current framebuffer is bind to framebuffer object 1
color attachment 0:
this attachment is a render buffer
this attachment is a render buffer with name: 1
render buffer width = 960
render buffer height = 800
render buffer samples = 4
render buffer internal format = 0x8058
render buffer actual resolution for the red component = 8
render buffer actual resolution for the green component = 8
render buffer actual resolution for the blue component = 8
render buffer actual resolution for the alpha component = 8
render buffer actual resolution for the depth component = 0
render buffer actual resolution for the stencil component = 0
color attachment 1:
this attachment is empty
color attachment 2:
this attachment is empty
color attachment 3:
this attachment is empty
color attachment 4:
this attachment is empty
color attachment 5:
this attachment is empty
color attachment 6:
this attachment is empty
color attachment 7:
this attachment is empty
depth attachment:
this attachment is a render buffer
this attachment is a render buffer with name: 2
render buffer width = 960
render buffer height = 800
render buffer samples = 4
render buffer internal format = 0x88f0
render buffer actual resolution for the red component = 0
render buffer actual resolution for the green component = 0
render buffer actual resolution for the blue component = 0
render buffer actual resolution for the alpha component = 0
render buffer actual resolution for the depth component = 24
render buffer actual resolution for the stencil component = 8
stencil attachment:
this attachment is a render buffer
this attachment is a render buffer with name: 2
render buffer width = 960
render buffer height = 800
render buffer samples = 4
render buffer internal format = 0x88f0
render buffer actual resolution for the red component = 0
render buffer actual resolution for the green component = 0
render buffer actual resolution for the blue component = 0
render buffer actual resolution for the alpha component = 0
render buffer actual resolution for the depth component = 24
render buffer actual resolution for the stencil component = 8
there are 8 draw buffers.
draw buffer[0] = GL_COLOR_ATTACHMENT0
draw buffer[1] = GL_NONE
draw buffer[2] = GL_NONE
draw buffer[3] = GL_NONE
draw buffer[4] = GL_NONE
draw buffer[5] = GL_NONE
draw buffer[6] = GL_NONE
draw buffer[7] = GL_NONE
read buffer = GL_BACK
debug : Medium - API - Performance : API_ID_RECOMPILE_FRAGMENT_SHADER performanc
e warning has been generated. Fragment shader recompiled due to state change.
Framebuffer incomplete, attachments must have same number of samples per pixel.
Framebuffer incomplete, attachments must have same number of samples per pixel.
target framebuffer not valid
source framebuffer not valid

from easy3d.

LiangliangNan avatar LiangliangNan commented on May 18, 2024

You see the "GL error" is gone. Your GPU requires a new FBO must have the same number of samples as the original FBO. This is now satisfied as required by your GPU (the OpenGL specification/standard doesn't require this).

Now from the log, all attachments have samples 4, but it still says "attachments must have same number of samples per pixel".
Can you request 0 samples for both the viewer and the FBO and post the log here?

from easy3d.

461353349 avatar 461353349 commented on May 18, 2024

I change Viewer(title, 0, 3, 3) and fbo = new FramebufferObject(width, height, 0);_ as you said, then run in debug mode.

------------ Picker Viewer usage ----------
Press the mouse to pick a face

debug : Medium - API - Performance : API_ID_RECOMPILE_FRAGMENT_SHADER performanc
e warning has been generated. Fragment shader recompiled due to state change.
Framebuffer incomplete, attachments must have same number of samples per pixel.
Current framebuffer is bind to framebuffer object 1
color attachment 0:
this attachment is a render buffer
this attachment is a render buffer with name: 1
render buffer width = 960
render buffer height = 800
render buffer samples = 1
render buffer internal format = 0x8058
render buffer actual resolution for the red component = 8
render buffer actual resolution for the green component = 8
render buffer actual resolution for the blue component = 8
render buffer actual resolution for the alpha component = 8
render buffer actual resolution for the depth component = 0
render buffer actual resolution for the stencil component = 0
color attachment 1:
this attachment is empty
color attachment 2:
this attachment is empty
color attachment 3:
this attachment is empty
color attachment 4:
this attachment is empty
color attachment 5:
this attachment is empty
color attachment 6:
this attachment is empty
color attachment 7:
this attachment is empty
depth attachment:
this attachment is a render buffer
this attachment is a render buffer with name: 2
debug : High - API - ERROR : Error has been generated. GL error GL_INVALID_OPERA
TION
render buffer width = 960
render buffer height = 800
render buffer samples = 1
render buffer internal format = 0x8058
render buffer actual resolution for the red component = 8
render buffer actual resolution for the green component = 8
render buffer actual resolution for the blue component = 8
render buffer actual resolution for the alpha component = 8
render buffer actual resolution for the depth component = 0
render buffer actual resolution for the stencil component = 0
GL error:
file: framebuffer_object.cpp
line: 1239
function: easy3d::FramebufferObject::_print_attachment
info: Invalid operation (The specified operation is not allowed in the c
urrent state)
stencil attachment:
this attachment is a render buffer
this attachment is a render buffer with name: 2
debug : High - API - ERROR : Error has been generated. GL error GL_INVALID_OPERA
TION
render buffer width = 960
render buffer height = 800
render buffer samples = 1
render buffer internal format = 0x8058
render buffer actual resolution for the red component = 8
render buffer actual resolution for the green component = 8
render buffer actual resolution for the blue component = 8
render buffer actual resolution for the alpha component = 8
render buffer actual resolution for the depth component = 0
render buffer actual resolution for the stencil component = 0
GL error:
file: framebuffer_object.cpp
line: 1239
function: easy3d::FramebufferObject::_print_attachment
info: Invalid operation (The specified operation is not allowed in the c
urrent state)
there are 8 draw buffers.
draw buffer[0] = GL_COLOR_ATTACHMENT0
draw buffer[1] = GL_NONE
draw buffer[2] = GL_NONE
draw buffer[3] = GL_NONE
draw buffer[4] = GL_NONE
draw buffer[5] = GL_NONE
draw buffer[6] = GL_NONE
draw buffer[7] = GL_NONE
read buffer = GL_BACK
framebuffer not valid
debug : Medium - API - Performance : API_ID_RECOMPILE_FRAGMENT_SHADER performanc
e warning has been generated. Fragment shader recompiled due to state change.
source framebuffer not valid

from easy3d.

461353349 avatar 461353349 commented on May 18, 2024

I am not sure that what I had modified.

from easy3d.

LiangliangNan avatar LiangliangNan commented on May 18, 2024

Weird that you received 1 sample for the FBO. But what are the actual sample of the viewer ?

from easy3d.

LiangliangNan avatar LiangliangNan commented on May 18, 2024

https://answers.microsoft.com/en-us/windows/forum/windows_10-hardware/intel-hd-graphics-4600-incompatibility-issue-in/608bb6da-a88f-48d6-af45-ea490b1e2cbd

From here, it seems it is a known compatibility issue with the HD Graphics 4600 and Windows 10.

I also googled "HD Graphics 4600 bug", too many complaints.
So I believe it is a bug in the display driver. This can also be concluded from the fact that your HD Graphics 4600 GPU requires a new FBO must have the same number of samples as the original FBO.

from easy3d.

461353349 avatar 461353349 commented on May 18, 2024

OK!
I would run opengl in NVidia or AMD(ATI). I think NVidia or AMD(ATI) is basic setup for most computers.
Thanks very much!!!

from easy3d.

LiangliangNan avatar LiangliangNan commented on May 18, 2024

from easy3d.

461353349 avatar 461353349 commented on May 18, 2024

So I just change Viewer(title, 0, 3, 3). conresponding to original code. My OS is win7 SP1.

I0209 18:57:49.095752 4456 logging.cpp:83] logger initialized
I0209 18:57:49.099751 4456 logging.cpp:84] Executable path: D:\Project\Post\Ope
nGL\Easy3D\Easy3D\Build\bin\Debug
I0209 18:57:49.100751 4456 logging.cpp:85] Current working dir: D:\Project\Post
\OpenGL\Easy3D\Easy3D\Build\tutorials\Tutorial_308_FacePicker
I0209 18:58:51.536324 4456 viewer.cpp:244] OpenGL vendor: Intel
I0209 18:58:51.539324 4456 viewer.cpp:245] OpenGL renderer: Intel(R) H
D Graphics 4600
I0209 18:58:51.541323 4456 viewer.cpp:246] OpenGL version requested: 3.3
I0209 18:58:51.543323 4456 viewer.cpp:247] OpenGL version received: 3.3.0 - Bu
ild 10.18.14.4294
I0209 18:58:51.545323 4456 viewer.cpp:248] GLSL version received: 3.30 - Bui
ld 10.18.14.4294
I0209 18:58:51.546324 4456 viewer.cpp:262] Samples received: 0 (0 reque
sted, max support is 8)
I0209 18:58:51.548323 4456 viewer.cpp:267] DPI scaling: 1
surface mesh loaded (#face: 25, #vertex: 26, #edge: 51). Time: 84.6ms
I0209 18:58:51.691331 4456 renderer.cpp:228] num of vertices in model/sent to G
PU: 26/26
current model: 0, D:\Project\Post\OpenGL\Easy3D\Easy3D\Build\bin/resources/data/
quad_mesh/P.off
------------ Picker Viewer usage ----------
Press the mouse to pick a face

debug : Medium - API - Performance : API_ID_RECOMPILE_FRAGMENT_SHADER performanc
e warning has been generated. Fragment shader recompiled due to state change.
Framebuffer incomplete, attachments must have same number of samples per pixel.
Current framebuffer is bind to framebuffer object 1
color attachment 0:
this attachment is a render buffer
this attachment is a render buffer with name: 1
render buffer width = 960
render buffer height = 800
render buffer samples = 1
render buffer internal format = 0x8058
render buffer actual resolution for the red component = 8
render buffer actual resolution for the green component = 8
render buffer actual resolution for the blue component = 8
render buffer actual resolution for the alpha component = 8
render buffer actual resolution for the depth component = 0
render buffer actual resolution for the stencil component = 0
color attachment 1:
this attachment is empty
color attachment 2:
this attachment is empty
color attachment 3:
this attachment is empty
color attachment 4:
this attachment is empty
color attachment 5:
this attachment is empty
color attachment 6:
this attachment is empty
color attachment 7:
this attachment is empty
depth attachment:
this attachment is a render buffer
this attachment is a render buffer with name: 2
debug : High - API - ERROR : Error has been generated. GL error GL_INVALID_OPERA
TION
render buffer width = 960
render buffer height = 800
render buffer samples = 1
render buffer internal format = 0x8058
render buffer actual resolution for the red component = 8
render buffer actual resolution for the green component = 8
render buffer actual resolution for the blue component = 8
render buffer actual resolution for the alpha component = 8
render buffer actual resolution for the depth component = 0
render buffer actual resolution for the stencil component = 0
GL error:
file: framebuffer_object.cpp
line: 1239
function: easy3d::FramebufferObject::_print_attachment
info: Invalid operation (The specified operation is not allowed in the c
urrent state)
stencil attachment:
this attachment is a render buffer
this attachment is a render buffer with name: 2
debug : High - API - ERROR : Error has been generated. GL error GL_INVALID_OPERA
TION
render buffer width = 960
render buffer height = 800
render buffer samples = 1
render buffer internal format = 0x8058
render buffer actual resolution for the red component = 8
render buffer actual resolution for the green component = 8
render buffer actual resolution for the blue component = 8
render buffer actual resolution for the alpha component = 8
render buffer actual resolution for the depth component = 0
render buffer actual resolution for the stencil component = 0
GL error:
file: framebuffer_object.cpp
line: 1239
function: easy3d::FramebufferObject::_print_attachment
info: Invalid operation (The specified operation is not allowed in the c
urrent state)
there are 8 draw buffers.
draw buffer[0] = GL_COLOR_ATTACHMENT0
draw buffer[1] = GL_NONE
draw buffer[2] = GL_NONE
draw buffer[3] = GL_NONE
draw buffer[4] = GL_NONE
draw buffer[5] = GL_NONE
draw buffer[6] = GL_NONE
draw buffer[7] = GL_NONE
read buffer = GL_BACK
framebuffer not valid
debug : Medium - API - Performance : API_ID_RECOMPILE_FRAGMENT_SHADER performanc
e warning has been generated. Fragment shader recompiled due to state change.
source framebuffer not valid

from easy3d.

LiangliangNan avatar LiangliangNan commented on May 18, 2024

OK, Thanks.
You requested 0 samples for the viewer, and you did receive 0.
You requested 0 samples for the FBO, but you received 1. That must be a bug in the display driver of the HD Graphics 4600.

from easy3d.

461353349 avatar 461353349 commented on May 18, 2024

OK, I see!
Thanks a lot. I donnot know these before.

from easy3d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.