Ryan Joseph <r...@thealchemistguild.com> wrote: > > > > On May 1, 2018, at 9:56 PM, Michael Van Canneyt <mich...@freepascal.org> > wrote: > > > > You must do > > gl := TJSWebGLRenderingContext(canvas.getContext('webgl')); > > > > because getContext can return various classes depending on the argument. > > Ok so getContext is method of TJSElement I guess. > > 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…). > > 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. >
WebGL supports interleaved data, see e.g. http://learnwebgl.brown37.net/rendering/interleaved_buffers.html . 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:) Many thanks for the WebGL unit! (I will play with it once I catch some breath at other work :) ). Regards, Michalis
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal