Sun, 10/10/2021 - 20:33
Forums:
Hello Friends,
I want to use clipping planes with hatching. Capping works but hatching style is not applied, only solid capping is rendered no matter what I set to SetCappingHatch.
Code:
Handle(Graphic3d_ClipPlane) plane = new Graphic3d_ClipPlane();
plane->SetCapping(true);
plane->SetCappingHatchOn();
plane->SetCappingHatch(Aspect_HS_GRID_DIAGONAL); //<--- No matter what I pass here, nothing changes. See image.
plane->SetCappingColor(Quantity_NOC_CYAN3);
plane->SetEquation({a, b, c, 0});
plane->SetOn(true);
view->AddClipPlane(plane);
Thank you for your help.
Attachments:
Mon, 10/11/2021 - 12:43
Which OpenGL setup are you using?
Mon, 10/11/2021 - 21:28
Hi Kirill, Thank you for your answer. It works in DRAW, but it doesn't in my simple code
I have no "special" opengl setup:
But I am using Dear ImGui, maybe the ImGui backend changed some opengl parameter? In that case, what should I search for?
Another strange thing is that colors appear too light, for example Quantity_NOC_BLACK is rendered as gray.
Thank you.
Mon, 10/11/2021 - 23:00
As I can see, you are wrapping OpenGL context created by GLFW. Could you please share a portion of code used for GLFW creation?
Tue, 10/12/2021 - 00:59
Sure, for glfw init:
And for Occt:
Thank you for your help.
Tue, 10/12/2021 - 09:55
As far as I understand hint
implicitly tells GLWF to create a Core Profile, at least on Linux platform where Mesa implementation usually provides Core Profile of higher versions than Compatible Profiles.
You may print OpenGL context information using the following code snippet:
Hatching presentation in OCCT currently relies on obsolete OpenGL functionality, which is unavailable in Core Profile. You have the following options:
Tue, 10/12/2021 - 19:32
Thank you very much Kirill,
deactivating those lines make it work.
One question, the hatch makes the cross section semitransparent, is there a way to make it not transparent?
Tue, 10/12/2021 - 21:26
But this is the whole point of hatching ;). What do you expect instead?
If you need a usual opaque capping - consider using textures, like the one coming with "Dimensions" Draw Harness sample.
Wed, 10/13/2021 - 12:12
Hello, I just tried the capping example in Draw and the hatch are displayed so small that they are visible only by zooming a lot.
I am on OCC 7.5.0, windows 10.
Any idea ?
Best regards.
Jerome.
Wed, 10/13/2021 - 15:54
Hello Jerome, are you running Linux under virtualization on Windows (which one then?), or you are testing a native Windows build? What shows OpenGL info for your setup?
Thu, 10/14/2021 - 09:50
Hi Kirill and thanks for your answer.
I am on a native windows x64 build with VS2019 and with a 'old' nvidia quadro K2200.
Open GL extensions viewer tells I am OK for OpenGL 4.6 but maybe you need more/other info ?
Jerome.
Thu, 10/14/2021 - 10:27
This is strange that you observe this behavior with Dimensions sample in Draw Harness on such configuration. I've seen similar effect only when using Angle library (OpenGL ES implementation over Direct3D) instead of a desktop OpenGL. You may call "vglinfo" in Draw Harness at the end of script to see actual OpenGL configuration.
Thu, 10/14/2021 - 11:17
What I do not understand is that I am sure it worked in previous OCC version as I remember found this example very nice (maybe 7.3.0).
Here are the vglinfo you asked for:
OpenGL info:
GLvendor: NVIDIA Corporation
GLdevice: Quadro K2200/PCIe/SSE2
GLversion: 4.6.0 NVIDIA 391.25
GLSLversion: 4.60 NVIDIA
Max texture size: 16384
Max FBO dump size: 16384x16384
Max combined texture units: 192
Max MSAA samples: 64
Viewport: 768x768
GPU free memory: 3546 MiB
GPU memory: 4096 MiB
ResolutionRatio: 1
Thanks.
Thu, 10/14/2021 - 13:15
Kirill, I finally rebuilt OCC and it works... only the edges of the clip shapes are not visible but I suppose it is related to a drawer in clip plane or in clipped shape...
Thanks for your time.
Best regards.