Skip to content

Conversation

@m-reuter
Copy link
Member

@m-reuter m-reuter commented Sep 4, 2025

Top lights are brighter than and bottom lights, leading to different brightness for triangles facing down. This helps create some shadows and depth, for example on folded brain images.

However, this is less desired for shapes like the empty corpus callosum, where one can see the lower surface from above. Also the top surface is not bright enough as it is missing light from the headlight. This can usually be improved substantially by increasing the ambient light (it is 0 by default), e.g. to a value of 0.3 or 0.4. We now add a parameter to adjust this value in the shader.

This way also the inside of the triangles are lighted. 
It could however lead to too bright lights, so that weights of the lights may need to be adjusted.
@codecov
Copy link

codecov bot commented Sep 4, 2025

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 4.97%. Comparing base (81af7f1) to head (183975b).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
whippersnappy/core.py 0.00% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main     #48      +/-   ##
========================================
- Coverage   4.98%   4.97%   -0.02%     
========================================
  Files          6       6              
  Lines        883     885       +2     
  Branches     127     127              
========================================
  Hits          44      44              
- Misses       836     838       +2     
  Partials       3       3              
Flag Coverage Δ
unittests 4.97% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@m-reuter m-reuter marked this pull request as draft September 4, 2025 20:00
@m-reuter m-reuter changed the title Modify lighting calculations to use abs for dot products Permit setting ambient light Sep 10, 2025
@m-reuter m-reuter marked this pull request as ready for review September 10, 2025 14:55
@m-reuter m-reuter requested a review from Copilot September 10, 2025 14:55
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds ambient light control to the OpenGL shader system to improve visibility of surfaces viewed from above. The change allows users to adjust ambient lighting strength from the default value of 0.0 to enhance brightness of surfaces that would otherwise appear too dark due to the directional lighting setup.

  • Added an ambient parameter to control ambient light strength in the shader
  • Refactored lighting calculations to use weight arrays for cleaner code organization

m-reuter and others added 3 commits September 10, 2025 16:59
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@m-reuter m-reuter merged commit 8d83c2a into main Sep 10, 2025
29 checks passed
@m-reuter m-reuter deleted the m-reuter-lights branch September 10, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants