Raytracing flickers displayed model

Bug #1778813 reported by Hildo Guillardi Júnior
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Unknown

Bug Description

Using KiCad last Nightly on Ubuntu 16.04, when I use the raytracing and export to PNG file I get a strange partial light effect, like 1/3 of the image is not re-calculated yet (BOTTOM.png file). But in the user interface is all normal (screeen shot).

The strange behavior about is that just happens on BOTTOM side (check the TOP.png) and when I export the first time, the second export without move the camera re-write with a correct file (BOTTOM2.png file).

More packages information:
Application: kicad
Version: 5.0.0-rc2-unknown-f785d27~65~ubuntu16.04.1, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.13.0-45-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.58.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.47.0
    Compiler: GCC 5.4.0 with C++ ABI 1009

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Tags: 3d-viewer
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :
tags: added: 3dviewer
Revision history for this message
Mario Luzeiro (mrluzeiro) wrote :

Is it always reproducible ?
What happen if you do a 3rd export attempt?

This sounds to be an OpenGL double-buffer issue. The 1st export is saving the previous rendered buffer (while the screen is showing the most recent and finished one).

A possible solution would be to make a double draw once the scene is finished or investigate how the mechanism to get the frame works and select it to be the front buffer instead the back buffer.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

In this computer configuration (intel card - core2duo) yes, always happens. Check that there is also a strange border in some exported images.
During the render calculation, in this computer, the 3D image keep flicking until the calculation finished (this appear be related with the strange border, because appear to be a residue of this flicker).

I am testing in other machines now. IN the new ones (Ubuntu also) the only aspect is the big difference between the light on top and bottom view. But I don't now if this is just the normal behavior of the 3D ambiance.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

The 3rd attempt is also normal (as long I keep the camera position).

Revision history for this message
Mario Luzeiro (mrluzeiro) wrote :

All that cases are related with the double buffering. The final pass will render the correct light intensity so its the same issue, you are exporting the previous frame and it should be the latest.

What happen if after the render finish you minimize (or change window) and back again to the 3D Viewer windows and then export?

What do you mean by "keep flicking" ?
It should show progressively the quads being rendered. Just the new quads are added.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

This hypothesis make sense, because this missing calculated part in the file is updated in the screen very quick, like just one algorithm iteration.

The "keep flicking", in some computers here (this reported included) the image appear be resizing between 2 different sizes until the raytracing is calculating. Each screen update it change between the big and the small size.

Check in the file
https://launchpadlibrarian.net/376092683/TOP.png
The small size in that one that is really shown now and the big size is that one in the back, that you can only see as a residue in the borders.

Maybe I could try to get some video after.

Jeff Young (jeyjey)
summary: - Raytracing export ligth problem
+ Raytracing export light problem
tags: added: 3d-viewer
removed: 3dviewer
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote : Re: Raytracing export light problem
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Depending of the angle make better or worst, but always happens in this machine (intel video card).

Revision history for this message
Mario Luzeiro (mrluzeiro) wrote :

That is clearly a double buffer issue.
That is the first time this issue is reported.
Would you mind to try on a different window manager? kde xfce mate.. ?

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Still on 201807270649+0cca1c6~65~ubuntu16.04.1
I have to schedule me self to change my OS and do this kind of test, I will keep this issue opened and on track.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Just to keep tracking, the issue still on
201809051403+f85b147~66~ubuntu16.04.1
after some update on the 3D view code.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :
Revision history for this message
Mario Luzeiro (mrluzeiro) wrote :

apart from the flickering issue, the "bad back illumination" is probably because you have the "floor" option enabled on Raytracing properties. So you are looking on "the shadow side of the board"

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Yes, removing the "add floor" fix the light.

Seth Hillbrand (sethh)
Changed in kicad:
importance: Undecided → Low
summary: - Raytracing export light problem
+ Raytracing flickers displayed model
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Still on version 5.1.0-unknown-8e812c0~82~ubuntu16.04.1 being necessary always export twice the PNG/JPEG file to get a Raytraced image without flicker into (even if the Raytraced image is correct at the KiCad 3D viewer).

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Also, would be interesting add the axis (green, blue, red - XYZ arrows) when in raytracing mode.

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

KiCad bug tracker has moved to Gitlab. This report is now available here: https://gitlab.com/kicad/code/kicad/-/issues/1853

Changed in kicad:
status: New → Expired
Changed in kicad:
importance: Low → Unknown
status: Expired → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.