Jump to content


  • Content Count

  • Joined

  • Last visited

  1. All fixed problem in this commit https://github.com/mariuszekpl/WebGL-smart-pascal-samples/commit/b339adcb8004dbdcaffbeffe95f3201a47d700f0 Problem was also in this construction (in few places) var Norms: TVertices; // array of Vector3 ... Norms.Push([0.0,0.0,1.0]); this construction should add 1x Vector3 but add 3xFloat
  2. My solution for this BUG: Declare JWebGLContextAttributes before InitializeWebGL; type JWebGLContextAttributes = class alpha,stencil,premultipliedAlpha,preserveDrawingBuffer,antialias,depth: boolean; end; This generate correct JS, identical like in old version Next error is in TTextDemoFragment.GetVertexData in line: Data.Normals.Push(N[I]); Good news! After remove all "Fragments.Push(TTextDemoFragment" project works
  3. I try run Biotopia sample but I have JS error: ReferenceError, JWebGLContextAttributes is not defined I compare old version from http://smartmobilestudio.com/SmartDemo/TheSmartContest2013-1/Biotopia/index.html with my generated code. Old version var attr=new Object(); attr.alpha=false; attr.stencil=false; attr.premultipliedAlpha=false; attr.preserveDrawingBuffer=false; attr.antialias=true; attr.depth=true; gl=TW3CustomGraphicContext.GetHandle$(Canvas$1).getContext("experimental-webgl",attr); Current version var uj1 = null; uj1 = new JWebGLContextAttributes(); uj1.alpha = fa
  4. My first test: procedure TForm1.W3Button1Click(Sender: TObject); var http1: JXMLHttpRequest; mView: JArrayBufferView; begin http1 := JXMLHttpRequest.create; http1.responseType := "arraybuffer"; // !!! without this don't work !!! http1.onload := lambda // W3Memo1.Text := http1.responseText; asm console.log("log test"); var arrayBuffer = http1.response; if (arrayBuffer) { var byteArray = new Uint8Array(arrayBuffer); for (var i = 0; i < byteArray.byteLength; i++) { console.log("one char!"); } } mVi
  5. I see WebGL has texImage2D overload metod 5x "texImage2D" with different types image. In samples SMB (Biotopia\BinaryFile.pas) i found how to load image file to texture. But I have raw data (not png, jpg etc... only part of memory). But this sample based on TW3Image How load part of memory to texture ? How use this version procedure texImage2D( target : GLenum; level : GLint; internalformat : GLenum; width : GLsizei; height : GLsizei; border : GLint; format : GLenum; aType : GLenum; pixels : JArrayBufferView); overload; How load file from se
  • Create New...