Skip to main content
Topic: 3D Gerber Viewer (Read 103411 times) previous topic - next topic

Re: 3D Gerber Viewer

Reply #30
After changing the 1.4 to 1.5 I can start the application.  That's one huge leap forward. :-)

The bottom of the window is showing a lot of flickering hash - see the attached screenshots.

And when I try to load some gerbers it crashes.

Code: [Select]
cannot guess type of file C:UsersMatsDocumentseagleCurrentLedgerLedger.pro
cannot guess type of file C:UsersMatsDocumentseagleCurrentLedgerLedger.gpi
loading C:UsersMatsDocumentseagleCurrentLedgerLedger.GML
outline found
loading C:UsersMatsDocumentseagleCurrentLedgerLedger.GBO
loading C:UsersMatsDocumentseagleCurrentLedgerLedger.GBL
loading C:UsersMatsDocumentseagleCurrentLedgerLedger.GBP
loading C:UsersMatsDocumentseagleCurrentLedgerLedger.GTS
loading C:UsersMatsDocumentseagleCurrentLedgerLedger.GBS
loading C:UsersMatsDocumentseagleCurrentLedgerLedger.GTL
loading C:UsersMatsDocumentseagleCurrentLedgerLedger.GTO
loading C:UsersMatsDocumentseagleCurrentLedgerLedger.GTP
generating outline
milling
tesselating top
rasterizing top_copper
grbv: C:UsersMatsDesktopGerber Viewerlua5.2nb.lua:149: C:UsersMatsDesktopGerber Viewerlua5.2boards.lua:1049: INVALID_FRAMEBUFFER_OPERATION_EXT
stack traceback:
        [C]: in function 'error'
        ...ersMatsDesktopGerber Viewerlua5.2glCheckError.lua:10: in function 'CheckError'
        C:UsersMatsDesktopGerber Viewerlua5.2boards.lua:1049: in function 'render_image'
        C:UsersMatsDesktopGerber Viewerlua5.2boards.lua:1493: in function 'generate_image'
        C:UsersMatsDesktopGerber Viewerlua5.2boards.lua:1537: in function 'generate_images'
        C:UsersMatsDesktopGerber Viewerlua5.2boards.lua:1743: in function 'gen_texture'
        C:UsersMatsDesktopGerber Viewerlua5.2boards.lua:1829: in function 'gen_top_texture'
        C:UsersMatsDesktopGerber Viewergrbv.lua:340: in function 'load_board'
        C:UsersMatsDesktopGerber Viewergrbv.lua:622: in function 'reload'
        C:UsersMatsDesktopGerber Viewergrbv.lua:659: in function <C:UsersMatsDesktopGerber Viewergrbv.lua:657>stack traceback:
        [C]: in function 'error'
        C:UsersMatsDesktopGerber Viewerlua5.2nb.lua:149: in function 'resume'
        C:UsersMatsDesktopGerber Viewerlua5.2nb.lua:244: in function 'run'
        C:UsersMatsDesktopGerber Viewergrbv.lua:670: in main chunk
        [C]: in ?

Re: 3D Gerber Viewer

Reply #31
[quote author="Stuff4Pi"]Still not working on a Windows 7 64 bits machine.[/quote]
I tried. It does not work on my Windows 7 64 bits machine, either.

Re: 3D Gerber Viewer

Reply #32
@matseng: Can you give me a link to the Gerber files that are not working? It can be in private if you prefer (you have my email address). The bottom flickering may be cause by some invalid out of bounds video memory access, but I've never seen that.

@john932: Can you copy and paste the error you get? Press Ctrl-C when the error popup is active, and then press Ctrl-V while writing a message on the forum (ideally within code tags).

Re: 3D Gerber Viewer

Reply #33
@veryevil: I just uploaded a new version (tagged 20130809T2109) that should fix your problem.

Re: 3D Gerber Viewer

Reply #34
It crashes as soon as I load any set of gerber files.... I attach one set to this post.
[attachment=0]
Code: [Select]
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:UsersMats>cd Desktop

C:UsersMatsDesktop>cd "Gerber Viewer"

C:UsersMatsDesktopGerber Viewer>grbv.com
OpenGL:
        vendor: Intel
        renderer: Intel(R) HD Graphics Family
        version: 3.1 (3.1.0 - Build 8.15.10.2462)
        GLSL: 1.4 (1.40  - Intel Build 8.15.10.2462)
cannot guess type of file C:UsersMatsDocumentseagleCurrentLedgerLedger.gpi
cannot guess type of file C:UsersMatsDocumentseagleCurrentLedgerLedger.dri
loading top mesh from cache
rasterizing bottom_copper
loading C:UsersMatsDocumentseagleCurrentLedgerLedger.GBL
grbv: C:UsersMatsDesktopGerber Viewerlua5.2nb.lua:149: C:UsersMatsDesktopGerber Viewerlua5.2boards.lua:1049: INVALID_F
RAMEBUFFER_OPERATION_EXT
stack traceback:
        [C]: in function 'error'
        ...ersMatsDesktopGerber Viewerlua5.2glCheckError.lua:10: in function 'CheckError'
        C:UsersMatsDesktopGerber Viewerlua5.2boards.lua:1049: in function 'render_image'
        C:UsersMatsDesktopGerber Viewerlua5.2boards.lua:1493: in function 'generate_image'
        C:UsersMatsDesktopGerber Viewerlua5.2boards.lua:1537: in function 'generate_images'
        C:UsersMatsDesktopGerber Viewerlua5.2boards.lua:1743: in function 'gen_texture'
        C:UsersMatsDesktopGerber Viewerlua5.2boards.lua:1829: in function 'gen_top_texture'
        C:UsersMatsDesktopGerber Viewergrbv.lua:340: in function 'load_board'
        C:UsersMatsDesktopGerber Viewergrbv.lua:622: in function 'reload'
        C:UsersMatsDesktopGerber Viewergrbv.lua:659: in function <C:UsersMatsDesktopGerber Viewergrbv.lua:657>
stack traceback:
        [C]: in function 'error'
        C:UsersMatsDesktopGerber Viewerlua5.2nb.lua:149: in function 'resume'
        C:UsersMatsDesktopGerber Viewerlua5.2nb.lua:244: in function 'run'
        C:UsersMatsDesktopGerber Viewergrbv.lua:670: in main chunk
        [C]: in ?

C:UsersMatsDesktopGerber Viewer>

Re: 3D Gerber Viewer

Reply #35
I got it to run on my desktop PC (AMD CPU with integrated graphics), but it is quite slow. However on my four years old notebook I can't get it to work. The error message I get has stayed the same for the last revisions:

Code: [Select]
---------------------------
Gerber viewer
---------------------------
C:UsersferdinandDesktopGerber Viewerlua5.2nb.lua:149: ...erdinandDesktopGerber Viewerlua5.2enginerender.lua:72: ...DesktopGerber Viewerlua5.2enginedisplayshader.lua:72: GLSL compilation error:
while compiling ./shadersentity_textured.glsl:
ERROR: 3:69: 'texture' : no matching overloaded function found (using implicit conversion)
ERROR: 3:69: '=' :  cannot convert from 'const float' to '4-component vector of float'

stack traceback:
[C]: in function 'error'
...DesktopGerber Viewerlua5.2enginedisplayshader.lua:72: in function 'compile'
...DesktopGerber Viewerlua5.2enginedisplayshader.lua:179: in function 'load'
...DesktopGerber Viewerlua5.2enginedisplayshader.lua:227: in function 'new'
...rdinandDesktopGerber Viewerlua5.2enginedisplay.lua:233: in main chunk
[C]: in function 'xpcall'
...erdinandDesktopGerber Viewerlua5.2enginerender.lua:67: in function 'display'
...erdinandDesktopGerber Viewerlua5.2enginerender.lua:125: in function <...erdinandDesktopGerber Viewerlua5.2enginerender.lua:100>
(...tail calls...)
stack traceback:
[C]: in function 'error'
...erdinandDesktopGerber Viewerlua5.2enginerender.lua:72: in function 'display'
...erdinandDesktopGerber Viewerlua5.2enginerender.lua:125: in function <...erdinandDesktopGerber Viewerlua5.2enginerender.lua:100>
stack traceback:
[C]: in function 'GetExitCodeThread'
...sferdinandDesktopGerber Viewerlua5.2enginegui.lua:424: in function <...sferdinandDesktopGerber Viewerlua5.2enginegui.lua:422>
stack traceback:
[C]: in function 'error'
C:UsersferdinandDesktopGerber Viewerlua5.2nb.lua:149: in function 'resume'
C:UsersferdinandDesktopGerber Viewerlua5.2nb.lua:244: in function 'run'
C:UsersferdinandDesktopGerber Viewergrbv.lua:670: in main chunk
[C]: in ?
---------------------------
OK 
---------------------------

Running it on the command line reveals that my GPU only supports GLSL 1.2 - that might be part of the problem.

Re: 3D Gerber Viewer

Reply #36
@matseng: Your Gerber files work just fine here, so it's probably a problem related to OpenGL hardware and drivers capabilities. I've just uploaded a new version (tagged 20130811T2036) which adds a check just before the error you get, and which may give me a more relevant feedback. Unfortunately I don't understand what the problem is yet, so I don't know what to fix.

@ferdinandk: GLSL 1.2 comes with OpenGL 2.1, which is rather old and lacks many feature that I may have used (sometimes inadvertently). Targeting such a platform would require extensive changes, and may be easier to do with a separate renderer. I don't have time for that at the moment, but it's all in Lua if someone is willing to give it a try. The two main pieces are the Gerber files rasterization (in boards.lua) and the rendering loop (in display.lua). These two files could be rewritten using only OpenGL 2.x APIs and GLSL 1.2 shaders. I can give a lot of explanations and some help if needed.

As for the slowness on your desktop PC, can you be more precise? Is the loading too long? Is the framerate low once loaded? Is the mouse manipulation of the board unresponsive?

Re: 3D Gerber Viewer

Reply #37
I know, I know my notebook's hardware is quite dated. This is the most up-to-date driver Intel released, so I'm stuck. My Lua knowledge is minimal and I've never worked with OpenGL, but maybe I will give it try.
On my desktop machine (using version grbv-20130808T2148-64bits.zip) grbv completely blocks one of two cores (100% CPU load). So everything get rather unresponsive :) Trying the most current version (grbv-20130811T2036-64bits.zip) it even utilizes both cores to their fullest.

Re: 3D Gerber Viewer

Reply #38
I have a similar GPU on my laptop, I tried a couple time to port the renderer so that it runs there, but there is so much missing that I gave up (twice).

Can you create a display.conf file with:
Code: [Select]
display_stats = true
wait for the graph to loop and discard loading spikes, and then take a screenshot?

Then create a render.conf file with
Code: [Select]
vsync = true
restart, wait for another graph loop, and take a second screenshot.

Re: 3D Gerber Viewer

Reply #39
I just tried the settings on my desktop PC and took the following screenshots. I hope that helps.

Re: 3D Gerber Viewer

Reply #40
Nooooooo! :-)  The latest version, 20130811T2036-64bits.zip, is back to crashing on startup again.

Code: [Select]
C:UsersMatsDesktopGerber Viewer>grbv.com
OpenGL:
        vendor: Intel
        renderer: Intel(R) HD Graphics Family
        version: 3.1 (3.1.0 - Build 8.15.10.2462)
        GLSL: 1.4 (1.40  - Intel Build 8.15.10.2462)
grbv: C:UsersMatsDesktopGerber Viewerlua5.2nb.lua:149: ...ersMatsDesktopGerber Viewerlua5.2enginerender.lua:72: ...ats
DesktopGerber Viewerlua5.2enginedisplayfbo.lua:88: INVALID_ENUM
stack traceback:
        [C]: in function 'error'
        ...ersMatsDesktopGerber Viewerlua5.2glCheckError.lua:10: in function 'CheckError'
        ...atsDesktopGerber Viewerlua5.2enginedisplayfbo.lua:88: in function 'new'
        ...rsMatsDesktopGerber Viewerlua5.2enginedisplay.lua:312: in main chunk
        [C]: in function 'xpcall'
        ...ersMatsDesktopGerber Viewerlua5.2enginerender.lua:67: in function 'display'
        ...ersMatsDesktopGerber Viewerlua5.2enginerender.lua:125: in function <...ersMatsDesktopGerber Viewerlua5.2engi
nerender.lua:100>
        (...tail calls...)
stack traceback:
        [C]: in function 'error'
        ...ersMatsDesktopGerber Viewerlua5.2enginerender.lua:72: in function 'display'
        ...ersMatsDesktopGerber Viewerlua5.2enginerender.lua:125: in function <...ersMatsDesktopGerber Viewerlua5.2engi
nerender.lua:100>
stack traceback:
        [C]: in function 'GetExitCodeThread'
        C:UsersMatsDesktopGerber Viewerlua5.2enginegui.lua:424: in function <C:UsersMatsDesktopGerber Viewerlua5.2eng
inegui.lua:422>
stack traceback:
        [C]: in function 'error'
        C:UsersMatsDesktopGerber Viewerlua5.2nb.lua:149: in function 'resume'
        C:UsersMatsDesktopGerber Viewerlua5.2nb.lua:244: in function 'run'
        C:UsersMatsDesktopGerber Viewergrbv.lua:670: in main chunk
        [C]: in ?

C:UsersMatsDesktopGerber Viewer>

Re: 3D Gerber Viewer

Reply #41
I'm currently moving, and my desktop PC is still in a box, so I cannot do much at the moment.

@matseng: This is a surprising error. I'll see what I can do. Did you copy any .conf file you had in the previous version to this one?

@ferdinandk: Can you run the grbv.com version from a command line, and copy and paste the console output (it should tell me what kind of GPU you have)? In addition to that can you tell me what CPU you have, and how much CPU RAM and GPU RAM you have?

Re: 3D Gerber Viewer

Reply #42
I've just released a new version, tagged 20130819T0027. There are only minor fixes, but it will show the actual release names (date-based) on the screenshots and (that's new) in the error popup title bar. So just pressing Ctrl-C and pasting the text here or in an email will include the version information (and CPU architecture).

@matseng: I had another user reporting the exact same problem as yours, I exchanged a few emails with him, and this version includes fixes that solve that problem. However he then has a rendering bug, which you may also get. Unfortunately if you do, I have almost no mean of debugging it since OpenGL reports that everything is fine.

Re: 3D Gerber Viewer

Reply #43
I just uploaded a new version that fixes a rendering bug that appeared as noise all over the window on Intel and AMD hardware. I also made some minor modifications that should help the program run on older/weaker hardware with no support for multisampling (which include for example some integrated GPU in modern Intel CPUs).