<div dir="ltr">if you can find a way to send a few auxiliary floats per vertex in the vertex array, then maybe the integer part of the float can be the matrix number/index of the matrix in list of matrices you send, and the decimal part the weight.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 16, 2018 at 6:42 AM, Andreas Plesch <span dir="ltr"><<a href="mailto:andreasplesch@gmail.com" target="_blank">andreasplesch@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Primitive restart would be available for webgl2:<br>
<br>
<a href="https://www.khronos.org/registry/webgl/specs/latest/2.0/#NO_PRIMITIVE_RESTART_FIXED_INDEX" rel="noreferrer" target="_blank">https://www.khronos.org/<wbr>registry/webgl/specs/latest/2.<wbr>0/#NO_PRIMITIVE_RESTART_FIXED_<wbr>INDEX</a><br>
<br>
I was also trying to think to think of a way to offload the matrix<br>
multiplications per vertex to the GPU. Instead of just a single world<br>
transformation for each geometry, it would be necessary to have a<br>
transformation matrix per vertex. Hopefully, the uploading of all the<br>
matrices per frame to the GPU would not negate the computional<br>
performance gains.<br>
<br>
-Andreas<br>
<br>
> Date: Sun, 15 Jul 2018 21:10:43 -0600<br>
> From: GPU Group <<a href="mailto:gpugroup@gmail.com">gpugroup@gmail.com</a>><br>
> To: X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a>><br>
> Subject: Re: [x3d-public] HAnim skinned deformation<br>
<div><div class="h5">><br>
> There's a thing in GLES3 if x3dom can detect that availability.<br>
> <a href="https://www.khronos.org/files/opengles32-quick-reference-card.pdf" rel="noreferrer" target="_blank">https://www.khronos.org/files/<wbr>opengles32-quick-reference-<wbr>card.pdf</a><br>
> page 3 > vertex arrays > Primitive Restart<br>
> And I haven't tried primitive restart. You know how IndexedFaceSet has an<br>
> index, with -1 to indicate the end of a face?<br>
> Well that -1 can be the restart index. Then I don't know what I was<br>
> thinking but somehow I thought that related to HAnim, in particular the<br>
> ability to write a shader that works on an indexed face set, rather than<br>
> more basic primitives like triangle fan. And so for HAnim you won't need to<br>
> rebuild triangle fans on every frame - just modify the vertices and normals<br>
> in-place, and re-send the same indexes with -1 to end each face or triangle.<br>
> Hope that idea works, haven't tried it. -Doug<br>
><br>
> On Sun, Jul 15, 2018 at 6:41 PM, Andreas Plesch <<a href="mailto:andreasplesch@gmail.com">andreasplesch@gmail.com</a>><br>
> wrote:<br>
><br>
> > Further observations<br>
> > On Fri, Jul 13, 2018 at 4:36 PM Andreas Plesch <<a href="mailto:andreasplesch@gmail.com">andreasplesch@gmail.com</a>><br>
> > wrote:<br>
> > ><br>
> > > Some partial answers:<br>
> > ><br>
> > > On Thu, Jul 12, 2018 at 8:18 AM Andreas Plesch <<a href="mailto:andreasplesch@gmail.com">andreasplesch@gmail.com</a>><br>
> > wrote:<br>
> > > ><br>
> > > > Before diving into an HAnim skinned deformation for x3dom, there are a<br>
> > few questions:<br>
> > > ><br>
> > > > proto<br>
> > > ><br>
> > > > Is there a proto implementation for skinned deformation, eg. the skin<br>
> > related fields ?<br>
> > ><br>
> > > Boxman has a script which does some skinned deformation:<br>
> > ><br>
> > > <a href="http://www.web3d.org/x3d/content/examples/Basic/" rel="noreferrer" target="_blank">http://www.web3d.org/x3d/<wbr>content/examples/Basic/</a><br>
> > HumanoidAnimation/BoxManIndex.<wbr>html<br>
> > > <a href="http://www.web3d.org/x3d/content/examples/Basic/" rel="noreferrer" target="_blank">http://www.web3d.org/x3d/<wbr>content/examples/Basic/</a><br>
> > HumanoidAnimation/BoxMan.js<br>
> > ><br>
> > > The scene uses native HAnim tags. It may or may not work in x_ite with<br>
> > > HAnim protos.<br>
> ><br>
> > Joe has a native tag BoxMan with test skin deformations.<br>
> ><br>
> > > The script just applies the weights as factors to a transform matrix<br>
> > > which may be quite different from the blending of coordinates. Of<br>
> > > course, the weights can be generated in the first place in such a way<br>
> > > that this application could work.<br>
> > ><br>
> > > > examples<br>
> > > ><br>
> > > > Are there examples in addition to Joes kicking player ?<br>
> > ><br>
> > > There are the Lucy avatars available from seamless3d:<br>
> > > <a href="http://www.seamless3d.com/hanim/" rel="noreferrer" target="_blank">http://www.seamless3d.com/<wbr>hanim/</a><br>
> > > I had view3dscene convert them to xml:<br>
> > > <a href="https://github.com/andreasplesch/x3dom/blob/HAnim_work/test/functional/" rel="noreferrer" target="_blank">https://github.com/<wbr>andreasplesch/x3dom/blob/<wbr>HAnim_work/test/functional/</a><br>
> > HAnim/Lucy_test4.x3d<br>
> ><br>
> > All players I tested which have skinned deformation implemented show<br>
> > the Lucy animation with inverted rotations. The players are:<br>
> > view3dscene 3.18<br>
> > BSContact<br>
> > freewrl 4.0<br>
> > Probably there is a problem with the Lucy example and perhaps how<br>
> > seamless3d exports hanim.<br>
> ><br>
> > > A maria_noscript model was also available at some point but seems lost.<br>
> > ><br>
> > > > skinCoordWeight<br>
> > > ><br>
> > > > This field modulates the transformation applied to the indexed coords<br>
> > by a factor ranging from 0 to 1. It is not quite clear how the factor<br>
> > should be applied. The spec. focuses on the amount of rotation but scaling<br>
> > and translation presumably should also be affected.<br>
> > > ><br>
> > > > Should scaling and translation be weighted ?<br>
> > > ><br>
> > > > The most straightforward way would be to just scale all the components<br>
> > of the transformation matrix. However, that does not work for the<br>
> > rotational components. Is there a recommended way to apply the weights to<br>
> > the complete transformation matrix ? Multiply all the individually weighted<br>
> > field matrixes ? That would be a lot of matrix multiplications, for each<br>
> > coord for each frame of an animation.<br>
> > > ><br>
> > > > skinNormals<br>
> > > ><br>
> > > > The spec. only refers to the skinCoords as being affected by the<br>
> > weighted transform. Presumably the skinNormals also need to be transformed ?<br>
> > > > If so, it seems to make sense to only apply the rotational component,<br>
> > and ignore scaling and translation ?<br>
> > ><br>
> > > Apparently there was some opiniated discussion around normal<br>
> > > generation: <a href="http://seamless3d.com/hanim/hanim_with_hardware_shaders_" rel="noreferrer" target="_blank">http://seamless3d.com/hanim/<wbr>hanim_with_hardware_shaders_</a><br>
> > issues.html<br>
> > ><br>
> > > > Mix of skeletal and skinned bodies<br>
> > > ><br>
> > > > It is possible to have geometry both in the skin and the skeleton<br>
> > (within segments) fields.<br>
> > > > In this case it seems the full transform would be always applied to<br>
> > the segment geometries. That may lead to out of sync movement during<br>
> > animation but such mixed representation may not be intended to be fully<br>
> > supported. How should an implementation deal with such humanoids ?<br>
> > ><br>
> > > May not be a priority to resolve.<br>
> > ><br>
> > > --<br>
> > > Andreas Plesch<br>
> > > Waltham, MA 02453<br>
> ><br>
> ><br>
> ><br>
> > --<br>
> > Andreas Plesch<br>
> > Waltham, MA 02453<br>
> ><br>
> > ______________________________<wbr>_________________<br>
> > x3d-public mailing list<br>
> > <a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a><br>
> > <a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/<wbr>listinfo/x3d-public_web3d.org</a><br>
> ><br>
</div></div>> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <<a href="http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20180715/eeb24df0/attachment.html" rel="noreferrer" target="_blank">http://web3d.org/pipermail/<wbr>x3d-public_web3d.org/<wbr>attachments/20180715/eeb24df0/<wbr>attachment.html</a>><br>
><br>
> ------------------------------<br>
><br>
> Subject: Digest Footer<br>
<span class="">><br>
> ______________________________<wbr>_________________<br>
> x3d-public mailing list<br>
> <a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a><br>
> <a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/<wbr>listinfo/x3d-public_web3d.org</a><br>
><br>
><br>
</span>> ------------------------------<br>
><br>
> End of x3d-public Digest, Vol 112, Issue 17<br>
> ******************************<wbr>*************<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
-- <br>
Andreas Plesch<br>
Waltham, MA 02453<br>
<br>
______________________________<wbr>_________________<br>
x3d-public mailing list<br>
<a href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a><br>
<a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/<wbr>listinfo/x3d-public_web3d.org</a><br>
</div></div></blockquote></div><br></div>