Skip to content

Added an option to apply ambient occlusion (AO) blending with vertex colors#624

Open
Micheus wants to merge 2 commits intodgud:masterfrom
Micheus:mv/ao-add-blend-mode
Open

Added an option to apply ambient occlusion (AO) blending with vertex colors#624
Micheus wants to merge 2 commits intodgud:masterfrom
Micheus:mv/ao-add-blend-mode

Conversation

@Micheus
Copy link
Collaborator

@Micheus Micheus commented Nov 13, 2025

To enable a different action via the application menu, the CTRL modifier key was used to trigger a secondary option for the AO command. This is a useful feature for those who paint vertex objects for use in games.

NOTE:
Added an option to apply AO blending with vertex colors. Thanks to boggers and DevEarley for the suggestion

@Micheus
Copy link
Collaborator Author

Micheus commented Nov 13, 2025

VertexColor+AO- blending

@dgud dgud requested a review from Copilot December 2, 2025 14:45
@dgud
Copy link
Owner

dgud commented Dec 2, 2025

I have let co-pilot review this, fix stuff that seems valid and write when your are done, or nothing needs fixing.
It is wrong often.

Copy link

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 pull request adds an option to blend ambient occlusion (AO) with existing vertex colors rather than replacing them. The blend mode is activated by holding the CTRL modifier key when executing the ambient occlusion command, providing game developers with more flexibility when painting vertex objects.

Key changes:

  • Added blend_edge_color/4 function in wings_va.erl to blend colors instead of replacing them
  • Implemented blend/2 function in wings_color.erl to handle color blending logic with support for both grayscale (multiplicative) and color (averaging) blend modes
  • Modified wpc_ambocc.erl to detect CTRL modifier and conditionally apply blending instead of replacement

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/wings_va.erl Added blend_edge_color/4 function and blend_color/3 helper to support blending vertex colors with new colors instead of replacing them
src/wings_color.erl Added blend/2 function with support for grayscale (multiplicative) and RGB (averaging) color blending modes
plugins_src/commands/wpc_ambocc.erl Modified menu text to show CTRL modifier option, added ESDL include, and updated ambient_occlusion to accept Mix parameter for conditional blending

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…colors

To enable a different action via the application menu, the CTRL modifier key
was used to trigger a secondary option for the AO command. This is a useful
feature for those who paint vertex objects for use in games.

NOTE:
Added an option to apply AO blending with vertex colors. Thanks to boggers
and DevEarley for the suggestion
@Micheus Micheus force-pushed the mv/ao-add-blend-mode branch from 9b7f90f to 837a476 Compare December 16, 2025 22:47
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