Attribute Node in Object Mode seems to have undocumented limit of 8 attributes in EEVEE, and exhibits unpredictable behaviour when more are used #92448

Closed
opened 2021-10-24 13:19:46 +02:00 by Dave F · 21 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: NVIDIA TITAN X (Pascal)/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 471.68

Blender Version
Broken: version: 2.93.5, branch: master, commit date: 2021-10-05 12:04, hash: blender/blender@a791bdabd0

Short description of error
While using the Attribute node to get float data from Object attributes, there seems to be a limit of 8 attributes, and which 8 you get is not always predictable (leading to some very hard-to-debug behaviour). Perhaps it's related to evaluation order?

Here's a simple bar graph shader with bars linked to the object's custom parameters. As you can see in these screenshots, in Cycles it displays 32 bars (as intended), in EEVEE it only shows 8.
image.png

image.png

I'm not sure if this is a limitation or a bug. I'd love to have more than 8 (this test uses 32, and my shader requires ~60!) but if that's not possible I think the limitation should at least be listed in the manual, perhaps in one of these:

https://docs.blender.org/manual/en/latest/render/eevee/limitations.html or .

Exact steps for others to reproduce the error

  • Load the attached blender file bug_shaderProblemB_001.blend
  • Switch the viewport to Rendered mode
  • The graph should display the first 32 custom object parameters
  • Switch to EEVEE

The graph now displays only the first 8 parameters 😿

bug_shaderProblemB_001.blend

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: NVIDIA TITAN X (Pascal)/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 471.68 **Blender Version** Broken: version: 2.93.5, branch: master, commit date: 2021-10-05 12:04, hash: `blender/blender@a791bdabd0` **Short description of error** While using the Attribute node to get float data from Object attributes, there seems to be a limit of 8 attributes, and *which* 8 you get is not always predictable (leading to some very hard-to-debug behaviour). Perhaps it's related to evaluation order? Here's a simple bar graph shader with bars linked to the object's custom parameters. As you can see in these screenshots, in Cycles it displays 32 bars (as intended), in EEVEE it only shows 8. ![image.png](https://archive.blender.org/developer/F11464373/image.png) ![image.png](https://archive.blender.org/developer/F11464377/image.png) I'm not sure if this is a limitation or a bug. I'd love to have more than 8 (this test uses 32, and my shader requires ~60!) but if that's not possible I think the limitation should at least be listed in the manual, perhaps in one of these: - https://docs.blender.org/manual/en/latest/render/shader_nodes/input/attribute.html?highlight=attribute%20node - https://docs.blender.org/manual/en/latest/render/eevee/materials/nodes_support.html#input-nodes # https://docs.blender.org/manual/en/latest/render/eevee/limitations.html or . **Exact steps for others to reproduce the error** - Load the attached blender file `bug_shaderProblemB_001.blend` - Switch the viewport to Rendered mode - The graph should display the first 32 custom object parameters - Switch to EEVEE # The graph now displays only the first 8 parameters 😿 [bug_shaderProblemB_001.blend](https://archive.blender.org/developer/F11464748/bug_shaderProblemB_001.blend)
Author

Added subscriber: @df-1

Added subscriber: @df-1

blender/blender#92433 was marked as duplicate of this issue

blender/blender#92433 was marked as duplicate of this issue
Author

Interestingly, the EEVEE limit seems to be 8 inputs for Vectors as well as Floats, so by packing the float data into Vec3 you can get 24 values in to the shader, you can see in the screenshot that it handles 24 fine, adding any more doesn't work though
image.png

Interestingly, the EEVEE limit seems to be 8 inputs for Vectors as well as Floats, so by packing the float data into Vec3 you can get 24 values in to the shader, you can see in the screenshot that it handles 24 fine, adding any more doesn't work though ![image.png](https://archive.blender.org/developer/F11465203/image.png)
Dave F changed title from Attribute Node in Object Mode seems to have undocumented limit of 8 float attributes in EEVEE, and exhibits unpredictable behaviour when more are used to Attribute Node in Object Mode seems to have undocumented limit of 8 attributes in EEVEE, and exhibits unpredictable behaviour when more are used 2021-10-24 13:58:56 +02:00

Added subscriber: @RoyTheKoi

Added subscriber: @RoyTheKoi

It's worth noting that the alpha channel is accessible too, providing a maximum of 4 channels per attribute.

If precision is not a big priority there may be a workaround. I just tested a method that allows packing up to three lower precision values into a single float, theoretically allowing 8x4x3 = 96 unique channels of attributes. The float packing method I used here was adapted from this article: http://emmettmcquinn.com/blog/graphics/2012/11/07/float-packing.html

Float Packing Attributes.png
Note that I'm using 3.0 Alpha which is why custom properties can show as colours, though the main idea should still work for 2.93.

It's worth noting that the alpha channel is accessible too, providing a maximum of 4 channels per attribute. If precision is not a big priority there may be a workaround. I just tested a method that allows packing up to three lower precision values into a single float, theoretically allowing 8x4x3 = 96 unique channels of attributes. The float packing method I used here was adapted from this article: http://emmettmcquinn.com/blog/graphics/2012/11/07/float-packing.html ![Float Packing Attributes.png](https://archive.blender.org/developer/F11496988/Float_Packing_Attributes.png) Note that I'm using 3.0 Alpha which is why custom properties can show as colours, though the main idea should still work for 2.93.
Author

Cool, nice data packing @RoyTheKoi! Yes I came to a similar conclusion about RGBA, I'm now packing my data into 8 x RGBA channels set to the Raw Data type, for 32 float channels. I managed to split my single shader into two so it just about works for my use case, otherwise I'd have to either use your packed floats approach or split the packed data between custom attributes and vertex data channels. It's a pretty long-winded workaround but hey if it means I can get back to work then I'm happy :-) Thanks!

Cool, nice data packing @RoyTheKoi! Yes I came to a similar conclusion about RGBA, I'm now packing my data into 8 x RGBA channels set to the Raw Data type, for 32 float channels. I managed to split my single shader into two so it just about works for my use case, otherwise I'd have to either use your packed floats approach or split the packed data between custom attributes and vertex data channels. It's a pretty long-winded workaround but hey if it means I can get back to work then I'm happy :-) Thanks!

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

I can confirm, that there is limit of 8 attributes. Confirming, since this is undocumented limitation.

I can confirm, that there is limit of 8 attributes. Confirming, since this is undocumented limitation.
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

note this limit:

/* Hardware limit is 16. Position attribute is always needed so we reduce to 15.
 * This makes sure the GPUVertexFormat name buffer does not overflow. */
#define GPU_MAX_ATTR 15

Not sure where the others are taken though.

note this limit: ``` /* Hardware limit is 16. Position attribute is always needed so we reduce to 15. * This makes sure the GPUVertexFormat name buffer does not overflow. */ #define GPU_MAX_ATTR 15 ``` Not sure where the others are taken though.
Member
Related [D12969: Eevee: support accessing custom mesh attributes](https://archive.blender.org/developer/D12969)

Added subscriber: @Hetarek

Added subscriber: @Hetarek

Added subscriber: @ChristophWerner

Added subscriber: @ChristophWerner

Is there a way to increase or double the amount of attributes in the future? The current limit can be annoying in production.

Is there a way to increase or double the amount of attributes in the future? The current limit can be annoying in production.

Added subscriber: @Cyrill-Vitkovskiy

Added subscriber: @Cyrill-Vitkovskiy

Added subscriber: @FLEB

Added subscriber: @FLEB
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Aaron Carlisle self-assigned this 2022-10-18 02:44:00 +02:00
Member

This limitation has been documented in rBM9630

This limitation has been documented in rBM9630

It's worth noting that the alpha channel is accessible too, providing a maximum of 4 channels per attribute.

If precision is not a big priority there may be a workaround. I just tested a method that allows packing up to three lower precision values into a single float, theoretically allowing 8x4x3 = 96 unique channels of attributes. The float packing method I used here was adapted from this article: http://emmettmcquinn.com/blog/graphics/2012/11/07/float-packing.html

Float Packing Attributes.png
Note that I'm using 3.0 Alpha which is why custom properties can show as colours, though the main idea should still work for 2.93.

Hi, sorry, is the packing code convertible to Geometry Nodes (no code/drivers)? Thanks. I wanted to implement this but I don't know how to do it

> It's worth noting that the alpha channel is accessible too, providing a maximum of 4 channels per attribute. > > If precision is not a big priority there may be a workaround. I just tested a method that allows packing up to three lower precision values into a single float, theoretically allowing 8x4x3 = 96 unique channels of attributes. The float packing method I used here was adapted from this article: http://emmettmcquinn.com/blog/graphics/2012/11/07/float-packing.html > > ![Float Packing Attributes.png](https://archive.blender.org/developer/F11496988/Float_Packing_Attributes.png) > Note that I'm using 3.0 Alpha which is why custom properties can show as colours, though the main idea should still work for 2.93. Hi, sorry, is the packing code convertible to Geometry Nodes (no code/drivers)? Thanks. I wanted to implement this but I don't know how to do it
Sign in to join this conversation.
No Milestone
No project
No Assignees
11 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-manual#92448
No description provided.