FreeCAD / FreeCAD/FreeCAD

Lighting artifacts after exiting Sketcher from Hidden Line or No Shading mode - VBO normals become uniform

Open
#29,076 4 comments 0 reactions 0 assignees View on GitHub
Mod: Sketcher Status: Needs confirmation Topic: Draw Style
Dominant language
C++
Stars
33.6k
Forks
6k
Avg merge
3d 15h
Merged PRs (30d)
196

Description

### Problem description

I've discovered a rendering bug where faces lose their correct normal information after exiting sketch edit mode when the view was previously in Hidden Line or No Shading display mode with VBO enabled.

### Workbench affected?

Part Design

### Steps to reproduce

1. Enable 'Use OpenGL VBO' in preferences
2. Create a Part feature based on a sketch (e.g., Pad, Pocket, etc.)
3. Set the view display mode to "Hidden Line" or "No Shading"
4. Enter sketch edit mode (double-click the sketch)
5. Exit sketch edit mode
6. Switch the display mode to "Shaded", "Flat Lines", or "As Is"
7. Rotate the view to observe the lighting

before edit sketch
Image

after do 1-7 steps above
Image

### Expected behavior

The 3D model should display with correct per-face lighting, where each face has its own normal direction and responds correctly to light sources.

### Actual behavior

- All faces have the same brightness/color
- When rotating the view, all faces change brightness uniformly together
- At certain viewing angles, all faces become completely black
- The lighting appears as if all faces share the same normal vector (likely the default normal (0,0,1))

## Important Notes:
- Disable Use OpenGL VBO in preferences, the problem does NOT occur
- This issue ONLY occurs when entering/exiting sketch edit mode from Hidden Line or No Shading display modes
- If you enter/exit sketch edit mode from other display modes (Shaded, Flat Lines, Wireframe), the problem does NOT occur
- Simply switching display modes without entering sketch edit mode works correctly

### Development version About Info (in Safe Mode)

```shell
OS: Windows 11 build 26200
Architecture: x86_64
Version: 1.2.0dev.20260401 (Git shallow)
Build date: 2026/04/01 04:43:57
Build type: Release
Branch: (HEAD detached at 33dcd31f5)
Hash: 33dcd31f5e2175e7dcdfd3caf1d9d86440919bfc
Python 3.11.15, Qt 6.8.3, Coin 4.0.8, Vtk 9.3.1, boost 1_86, Eigen3 3.4.0, PySide 6.8.3
shiboken 6.8.3, xerces-c 3.3.0, IfcOpenShell 0.8.2, OCC 7.8.1
Locale: Chinese/China (zh_CN)
Stylesheet/Theme/QtStyle: FreeCAD.qss/FreeCAD Dark/
Navigation Style/Orbit Style/Rotation Mode: Blender/Rounded Arcball/Window center
Logical DPI/Physical DPI/Pixel Ratio: 96/151.219/1.25
```

### Last known good version (optional)

```shell

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.