Background Gradient

Good day.

I have a problem with using background gradient.
You can see it in the picture.

I have 2d XY-rectangle instead background.
I use Ubuntu, Qt widget. What can it be?

 
 
Attachments: 
Kirill Gavrilov's picture

So what exactly wrong on your screenshot?

Nikolay Sorokin's picture

I mean, it should look like a background gradient. Like background in freecad.
And its display should not depend on the rotation of the camera.
I expect this behavior.

occ-> m_view-> SetBgGradientColors (
Quantity_Color (0.5, 0.5, 0.5, Quantity_TOC_RGB),
Quantity_Color (0.3, 0.3, 0.3, Quantity_TOC_RGB),
Aspect_GFM_VER,
Standard_True
);

And earlier, in Ubuntu 16.04, it worked with the occt7.2 kernel.
After switching to Ubuntu 18.04, something has changed, but I'm not sure that the problem is in the operation system.

Correct background on attached screenshot.

Attachments: 
Kirill Gavrilov's picture

Which version of OCCT you are using?
Did you build it yourself, or configured some Launchpad repository?

Nikolay Sorokin's picture

I tried 7.2.0, 7.3.0, which are compiled by myself, and version occt from ubuntu apt-get repo (libocct-*-7.3).

Nikolay Sorokin's picture

Sorry... experiment with ubuntu rep was failed. In realy it was libraries compiled by myself in all variants....

Nikolay Sorokin's picture

But it really doesn't work with libocct-*-7.3 from apt. The bug remains unchanged

Kirill Gavrilov's picture

Have you tried localizing the issue?
Try disabling the code displaying any other object in 3D Viewer to see if something is triggering the issue.

Gradient background is used by many OCCT applications, so that there should be something different in your test case...
If you have built OCCT with Draw Harness, then the following simple test script should display a correct background:

pload MODELING VISUALIZATION
box b 1 2 3
vclear
vinit View1
vdisplay -dispMode 1 b
vfit
vzbufftrihedron
vsetgradientbg 255 0 0 0 0 255 2
Nikolay Sorokin's picture

have done
I think this is not what I should have seen.

Nikolay Sorokin's picture

If i set background early ```vfit``` command, it looks correct. But after ```vfit``` it breaks.
In my app, i have the correct gradient if list of shapes is empty. But box(1,1,1) broke it.

Nikolay Sorokin's picture

Now it seems like...

Attachments: