[x3d-public] FloatVertexAttribute ordering

Andreas Plesch andreasplesch at gmail.com
Wed Jan 13 08:54:24 PST 2016


I think I understand now better where the confusion on how
FloatVertexAttributes are mapped to vertices was coming from.

It is because these custom shader vertex atttributes are treated
differently from regular attributes such as colors and normals. In the
colorPerVertex=true case, the mapping of provided colors to provided
coordinates (vertices) uses the coordinate indices (or special color
indices) and not a 1:1 mapping.

While to me this different treatment almost looks like an oversight which
should be corrected, it is probably too late to do so and not worth
introducing an incompatibility.

It brings up if there should be an option for providing custom indices in a
FloatVertexAttributeIndex node, to parallel colorIndex and normalIndex ?
While reuse of a single attribute value to several vertices does sound
useful, I do not know what a use case would be. But having a symmetry of
custom per vertex attributes and standard (color, normal) attributes seems
desirable.

Andreas




On Tue, Jan 12, 2016 at 4:06 PM, Andreas Plesch <andreasplesch at gmail.com>
wrote:

> FloatVertexAttribute ordering is expected to follow coordinate ordering:
>
>
> http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/shaders.html#Pervertexattributes
>
>
> http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/shaders.html#FloatVertexAttribute
>
> But there was some confusion if indices when provided are used instead:
>
> https://github.com/x3dom/x3dom/issues/596
>
> This would not make much sense but I had to read the spec. a couple of
> times.
> Should the relevant sentence in the spec.:
>
> "Per vertex attributes are mapped 1:1 to each vertex value."
>
> be more explicit ?
> Perhaps:
>
> "Per vertex attributes are mapped 1:1 to vertex coordinates."
>
> -Andreas
>
> --
> Andreas Plesch
> 39 Barbara Rd.
> Waltham, MA 02453
>



-- 
Andreas Plesch
39 Barbara Rd.
Waltham, MA 02453
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20160113/8ca13a3e/attachment-0001.html>


More information about the x3d-public mailing list