Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: Texture channel packing for vertex colors #49

Closed
2 tasks done
KirilStrezikozin opened this issue Nov 16, 2023 · 2 comments
Closed
2 tasks done

FEAT: Texture channel packing for vertex colors #49

KirilStrezikozin opened this issue Nov 16, 2023 · 2 comments
Assignees
Labels
feature upgrade for your old lawnmower solved How could you? GPT helped?

Comments

@KirilStrezikozin
Copy link
Owner

KirilStrezikozin commented Nov 16, 2023

This bug report is:

  • not a duplicate
  • implemented/fixed

Describe the bug
Kas.st#8843 initially reported this on Discord. In short, when baking maps to vertex colors with a channel pack set up for these maps, the channel pack is not performed and only the first vertex color bake is saved, others are blank. Reason: channel packing was not implemented for maps baked to vertex colors.

To Reproduce
Steps to reproduce the behavior:

  1. Add 2 maps (e.g. AO and Curvature).
  2. Set bake to Vertex Colors.
  3. Bake.
  4. Only the first map is saved to a new vertex color layer, others are blank, and no channel pack.

Expected behavior
Channel packing for maps baked to vertex colors to work properly.

Screenshots
image
image

Desktop (please complete the following information):

  • Any OS
  • Blender 3.2 and higher
  • BakeMaster 2.0 and higher

Additional context
@kas.st#8843 replied:

I thinking a good approach to fixing the issues are to 1. fix the overwriting of the first vertex attribute => all data is written to the channels, 2. post process packing: create new attribute and copy individual channels. (3. delete 'buffer attributes')

@KirilStrezikozin KirilStrezikozin added the bug your old lawnmower broke down label Nov 16, 2023
@KirilStrezikozin KirilStrezikozin self-assigned this Nov 16, 2023
@KirilStrezikozin KirilStrezikozin added the feature upgrade for your old lawnmower label Nov 16, 2023
@KirilStrezikozin KirilStrezikozin added this to the BakeMaster 2.6.0 milestone Nov 16, 2023
@KirilStrezikozin KirilStrezikozin changed the title BUG&FEAT: Texture channel packing for vertex colors FEAT: Texture channel packing for vertex colors Nov 21, 2023
@KirilStrezikozin KirilStrezikozin added in progress All night I stay not sleeping because I'm thinking about this and removed bug your old lawnmower broke down labels Nov 21, 2023
@KirilStrezikozin
Copy link
Owner Author

KirilStrezikozin commented Nov 22, 2023

Todo:

  • Fix vertex colors bakes are not written correctly. The first layer is overwritten, and others are not filled with data. The active layer should be set and selected.
  • Fix vertex color layers are not created when running the next bake. Vertex color layers are interpreted as images. It is unlikely to be only connected with layer name duplicates. There was no functionality to determine the correct naming of the new vertex color layer, neither respecting the value of bm_props.global_use_bake_overwrite.

@KirilStrezikozin
Copy link
Owner Author

KirilStrezikozin commented Nov 25, 2023

Since vertex color layers are now properly written and saved, the channel packing feature can be implemented for them.
Todo:

  • Add channel packing feature for vertex colors. Mind the suggestion:
  1. post process packing: create a new attribute and copy individual channels. (3. delete 'buffer attributes')

My integration would be:

  1. Create a new attribute Select the 'holder' attribute (like it is done for the regular channel pack with images).
  2. Write individual channels from layers from the channel pack into corresponding RGBA channels of the 'holder' layer.
  3. Delete 'buffer attributes'.
  • Edit Baked Material creation to support vertex color layers.

@KirilStrezikozin KirilStrezikozin added solved How could you? GPT helped? close on release done here, but let's wait for the release and removed in progress All night I stay not sleeping because I'm thinking about this labels Nov 25, 2023
KirilStrezikozin added a commit that referenced this issue Dec 2, 2023
@KirilStrezikozin KirilStrezikozin removed the close on release done here, but let's wait for the release label Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature upgrade for your old lawnmower solved How could you? GPT helped?
Projects
None yet
Development

No branches or pull requests

1 participant