<div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr">Ryan Joseph <<a href="mailto:ryan@thealchemistguild.com">ryan@thealchemistguild.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
> On May 1, 2018, at 9:56 PM, Michael Van Canneyt <<a href="mailto:michael@freepascal.org" target="_blank" rel="noreferrer">michael@freepascal.org</a>> wrote:<br>
> <br>
> You must do<br>
> gl := TJSWebGLRenderingContext(canvas.getContext('webgl'));<br>
> <br>
> because getContext can return various classes depending on the argument.<br>
<br>
Ok so getContext is method of TJSElement I guess.<br>
<br>
Btw I’ve been reading and I don’t see WebGL examples using interlaced vertex data like I suggested in my record question. Rather they all seem to be using different buffer objects for each type of vertex attribute (position, color, texture coord etc…).<br>
<br>
Can anyone confirm WebGL just doesn’t support this? OpenGL heavily relies on the idea of pointers with byte offsets but perhaps JavaScript just can’t support that so they opted for 0-offset single type arrays in all cases. That would be too bad though since it makes laying out data more difficult.<br></blockquote></div><div dir="auto"><br></div><div dir="auto">WebGL supports interleaved data, see e.g. <a href="http://learnwebgl.brown37.net/rendering/interleaved_buffers.html">http://learnwebgl.brown37.net/rendering/interleaved_buffers.html</a> .</div><div dir="auto"><br></div><div dir="auto">In general, WebGL is capable of rendering e.g. glTF 2, which allows to use interleaved data in various configurations, PBR etc. So it's quite powerful:)</div><div dir="auto"><br></div><div dir="auto">Many thanks for the WebGL unit! (I will play with it once I catch some breath at other work :) ).</div><div dir="auto"><br></div><div dir="auto">Regards,</div><div dir="auto">Michalis</div></div>