[Feature Proposal] Vertex Colors on TriangleMesh

Michael Strauß michaelstrau2 at gmail.com
Wed Aug 21 05:50:56 UTC 2024


Vertex colors usually refers to a technique where the vertex format is
enriched with an additional color component, and this color component is
then used in one of the shader stages to affect the computation in some way
(usually by combining it with the texture color).

As you correctly say, this technique is decades-old, it existed even back
in the days of fixed function pipelines.

However, with the introduction of programmable shaders, the structure of
vertices can be freely defined by developers. It seems to me that your
proposed API would pick just one (maybe useful) scenario, and eternally
bake it into JavaFX APIs. What if we get custom shaders one day? Then we
would need a way to customize the vertex format again.

Currently we have two predefined vertex formats:
VertexFormat.POINT_TEXCOORD and VertexFormat.POINT_NORMAL_TEXCOORD.
It doesn't seem obvious to me that the best way forward is to add more
bespoke formats here.

Have you thought about ways how we could allow deverlopers to define custom
formats? Maybe that would also require a new kind of Mesh that can accept
custom data.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/openjfx-dev/attachments/20240821/c8feec61/attachment.htm>


More information about the openjfx-dev mailing list