Hi, I’m trying to port some (long time) existing code to Unity.
I can see this format https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_vertex_type_2_10_10_10_rev.txt
beeing referenced here Unity - Scripting API: Experimental.Rendering.GraphicsFormat.A2B10G10R10_UNormPack32
but I can’t find how I can use it in the VertexAttributesDeclaration here Unity - Scripting API: VertexAttributeDescriptor
Hi!
Vertex format and Graphics format are two different things. See Unity - Scripting API: VertexAttributeFormat for what’s supported.
Hi aleksandrk.
Yes I understand these are 2 differents things.
Should I understand from your answer that we can’t use as vertexAttribute an item whose format is quite standard for 10 years ?
Yes.
Although the mileage for “quite standard” may vary depending on the platform you’re dealing with
Let me ask around - perhaps it’s on the roadmap to expose it.
Looks like it’s not planned yet. You can submit a feature request for this to be considered.
Thread necro! Well, turns out you can’t use A2B10G10R10_UNormPack32 (nor A2R10G10B10_UNormPack32) for textures either. Trying to create a texture like that from a script fails with “not supported for Sample” usage.
The funny thing? Unity internally does use that format for the backbuffer, for terrain splat maps, etc. etc. The graphics APIs do support it. Just (seemingly) because the format exists as GraphicsFormat, but not the (old) TextureFormat, it deems that you can’t create a texture from C# using this format.
At least in 2022.3 LTS.
(I filed a bug wrt something very similar a year or two ago, but that one got closed with a “it’s feature request, not a bug” – hmm I dunno, if you add enum values that do not actually work for their primary usage, I’d say it’s a bug…)