Search the Community

Showing results for tags 'createinstance'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Coding and Game Design
  • Frameworks
    • Phaser
    • Pixi.js
    • Babylon.js
    • Panda.js
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

Found 4 results

  1. Hi, I have question about creating meshes based on one prototype. I have multiple meshes, that have same geometry but should have different material (color), idea was to create prototype mesh in 3d max, add bump map and export it. Than I found that Mesh class have source mesh, so I passed my prototype mesh into mesh constructor: PG So far everything was working I could create new meshes and change material for them. But problems started when I tried to create instances from new meshes as all instances where moved to same position: PG But if I make clones from meshes they work: PG Was it designed to be used like that, or I am overusing system Maybe there is better way to achieve same result? prototype -> different meshes -> instances. @Deltakosh some ideas there?
  2. Hi, I have issue that elements created with createInstance sometimes don't show up on screen but exist in memory. I managed to make small PG to show issue. There 2 objects are initialised on click. On first click both instances appear but on next one only second instance appear, after many clicks all instances appear. Sometimes helps to change camera angle to see all meshes. Device: Galaxy S4 OS: Android 4.4.2 Browser: Chrome 59.0.3071.125 I have seen similar issue also on desktop devices, that instanced meshes disappear and appear back on camera rotation, but that I couldn't reproduce in PG yet.
  3. Hi, Got error on android device when createInstance is used ,PG. Device: Galaxy Tab 3 WebGl: renderer:"PowerVR SGX 544MP2", vendor:"Imagination Technologies", version:"WebGL 1.0 (OpenGL ES 2.0 Chromium)" Android: 4.4.2 Error: Uncaught TypeError: this._gl.vertexAttribDivisor is not a function at n._bindVertexBuffersAttributes (babylon.js:5) at n.recordVertexArrayObject (babylon.js:5) at t._bind (babylon.js:15) at r._renderWithInstances (babylon.js:12) at r._processRendering (babylon.js:12) at r.render (babylon.js:12) at t.render (babylon.js:13) at t.renderUnsorted (babylon.js:9) at t.render (babylon.js:9) at t.render (babylon.js:8) [.Offscreen-For-WebGL-0x6f7cfc20]GL ERROR :GL_INVALID_ENUM : GetIntegerv: <- error from previous GL command [.Offscreen-For-WebGL-0x6c2ab010]GL ERROR :GL_INVALID_ENUM : GLES2DecoderImpl::ClearWorkaround: <- error from previous GL command
  4. Hello forum! First post here, and I'm starting off with -probably- a newbie question: I'm trying to optimize an experiment that uses a lot of textured planes, cloned with createInstance, but I'm getting weird z-sorting issues - as you can see here: http://rocketclowns.com/canvas/babylon2/ The leaves are created with createInstance, like this: var leavesMaterial = new BABYLON.StandardMaterial("leavesTexture", scene); leavesMaterial.diffuseTexture = new BABYLON.Texture("textures/viny_leaves.png", scene); leavesMaterial.diffuseTexture.hasAlpha = true; leavesMaterial.useAlphaFromDiffuseTexture = true; var leaves = BABYLON.Mesh.CreatePlane("plane", 75.0, scene); leaves.scaling.y = 0.71; leaves.material = leavesMaterial; for (var l = 0; l < 128; l++) { var newLeavesInstance = leaves.createInstance("iLeaves" + l); newLeavesInstance.position.x = 32 + Math.random() * 96; newLeavesInstance.position.z = Math.random() * 256; } Am I overlooking something that causes the weird z-sorting behaviour? Many thanks in advance