|
| 1 | +--- |
| 2 | +type: map |
| 3 | +title: "tools/coin/compare.sh renders a fixed scene set with both viewer builds (#166 stage 2); pitfalls of the harness" |
| 4 | +area: wx-viewer |
| 5 | +paths: [tools/coin/compare.sh, tools/coin/compare.py, tools/coin/viewer-scenes.C, tools/coin/scenes, src/wxviz/viewer/SceneScript.C, include/wxviz/SceneScript.H, src/apps/builder/Builder.C, src/inv/wxinv/SoWxRenderArea.C] |
| 6 | +issues: [166] |
| 7 | +--- |
| 8 | +`SceneScript` (wxviz) runs a text script (`style`, `labels`, `select`, `mo`, |
| 9 | +`nmvect`, `nmstep`, `gtstep`, `snap`, `thumb`) against an SGViewer. Two |
| 10 | +callers: `viewer-scenes` (built-in XYZ systems, EXCLUDE_FROM_ALL target) and |
| 11 | +the Builder, when `ECCE_VIEWER_SCENE=<script>` and `ECCE_VIEWER_SCENE_OUT=<dir>` |
| 12 | +are set (inert otherwise; it renders in a second 480x480 viewer on the |
| 13 | +Builder's scene graph, then closes). `compare.py` drives both on a private |
| 14 | +Xvfb and writes `vendored.png/coin.png/diff.png` per scene plus a contact |
| 15 | +sheet of pairs that differ after removing the vendored build's constant |
| 16 | +colour offset (#83), estimated per pair as a per-channel median. |
| 17 | + |
| 18 | +Traps found building it: |
| 19 | +- `snap` reads the canvas with `glReadPixels` through |
| 20 | + `SoWxRenderArea::setFrameCallback` (called before the buffer swap). The |
| 21 | + Builder's own canvas is only as big as the pane layout leaves it (181x671 |
| 22 | + headless), hence the second viewer. |
| 23 | +- `SoOffscreenRenderer` (the thumbnail path) cannot make a GLX context on |
| 24 | + Coin under Xvfb ("Couldn't create GLX context"), (stage 3a fixed this with an EGL context, see the ECCE_USE_COIN entry). The vendored class |
| 25 | + crashes inside Mesa when destroyed, so the driver keeps one and `_exit`s. |
| 26 | +- Atom labels are drawn in the foreground colour (black on the default black |
| 27 | + background until `ForegroundCmd` runs) and need `FL_FONT_PATH` pointing at |
| 28 | + `data/client/fonts/` (with a trailing slash) when the Builder wrapper's |
| 29 | + `ecce_env` is not used. |
| 30 | +- A selected atom shows only if it goes through the viewer's `SGSelection` |
| 31 | + node (`getSelectionPath` + `ChemDisplayPath` + `merge`); filling |
| 32 | + `m_atomHighLight` alone changes nothing on screen. |
| 33 | +- The vendored build's offset is about +41 on every channel for lit |
| 34 | + surfaces, not only green; compare after a per-channel correction. |
| 35 | +- `IsoValueCmd`'s "Value" is a log10 slider value (10^Value is the isovalue); |
| 36 | + passing 0.05 puts the surface above the field maximum and draws nothing. |
| 37 | +- Normal-mode indices are 0-based and the fixture has 3 modes; an index past |
| 38 | + the table gives zero displacement, not an error. |
| 39 | +- `SO_NODE_INIT_CLASS`'s third argument is the PARENT's name, looked up |
| 40 | + with `SoType::fromName`. `PropSGFragment` passed its own name, which gave |
| 41 | + a type outside the SoNode tree: Coin aborted on it, the vendored core |
| 42 | + left null action methods (crash in `SoSearchAction`). Fixed; it is now |
| 43 | + registered from `SGContainer::initClass()`, so every app that builds a |
| 44 | + container scene gets it. |
| 45 | +- `IsoLib` wrote a leading end-of-strip `-1` in `coordIndex`; Coin takes it |
| 46 | + for an erroneous polygon and draws nothing. Skipped under `OIV_COIN`. |
| 47 | + (`#ifdef __coin` blocks elsewhere in `moiv` are dead: nothing defines it.) |
| 48 | +- Stage 3b findings (each one a visible difference, found by diffing GL state |
| 49 | + per frame with `tools/coin/gltrace.c`): |
| 50 | + - Coin's render action starts in BLEND, Open Inventor's in SCREEN_DOOR; MO |
| 51 | + lobes (alpha 0.5) were blended onto black = half brightness. Set in |
| 52 | + `SoWxRenderArea`'s constructor. |
| 53 | + - Coin's `SoCylinder::GLRender` sends the state's grey diffuse on every |
| 54 | + call, overwriting `ChemUnitCylinder`'s per-bond `glColor3fv`, and uses 20 |
| 55 | + slices where Open Inventor uses 16. The SOCYLINDER branch (the Builder's |
| 56 | + default style) now draws the Open Inventor geometry itself. |
| 57 | + - Coin's `SoSceneManager::setWindowSize` sizes only the GL action; the |
| 58 | + handle-event action stayed 400x400, so `SGSelection`'s ray pick missed |
| 59 | + every atom at 480x480. Real picking in a Coin Builder was broken. |
| 60 | + - Coin leaves `GL_POLYGON_STIPPLE` on after a stippled lobe; `ChemDisplay` |
| 61 | + (glColor, no lazy-element alpha send) then drew atoms half missing. |
| 62 | +- Scene commands `pick`, `drag` (SoEvents built in code and sent to the |
| 63 | + scene manager, so SoHandleEventAction -> SGSelection -> processMotion run; |
| 64 | + a listener copies `Builder::motionChanged`), `redraws` (frames per scene |
| 65 | + change, no forced paint), `vizthumb`, `transparency`. Text results are |
| 66 | + compared by `compare.py`. `snap` forces a paint, so it cannot show #99. |
| 67 | +- Not defects: Coin's stipple pattern for alpha 0.498 has 16 more set bits |
| 68 | + per 1024 (1.6% more lobe pixels; the ~1650 isolated pixels in mo5); |
| 69 | + SORTED_OBJECT_BLEND orders two equidistant lobes differently (ESP maps are |
| 70 | + one opaque surface); the vendored build shows no normal-mode vectors on the |
| 71 | + first paint after `nmvect` (stale until the next camera change) and Coin |
| 72 | + does, so Coin is right. |
0 commit comments