Jump to content

Search the Community

Showing results for tags 'submaterial'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 2 results

  1. Hello. My Kayak model has 4 sub materials on it. I have a button called "KayakLime". I'd like this button to change sub material #2 from Peach.png to Lime.png when clicked. Example #1 below works, but it changes the 4 kayak sub materials all to Lime.png. var myKayak2; BABYLON.SceneLoader.ImportMesh("", "models/", "Kayak.gltf", scene, function (newMeshes) { myKayak2 = newMeshes[0]; }); var LimeTexture = new BABYLON.StandardMaterial("Lime", scene); LimeTexture.diffuseTexture = new BABYLON.Texture("models/Lime.png", scene); LimeTexture.diffuseTexture.hasAlpha = false; LimeTexture.backFaceCulling = false; document.getElementById("KayakLime").addEventListener("click",function () { myKayak2.material = LimeTexture; }); Example #2: I thought this click code below would change only sub material #2 to Lime.png. However it turns the kayak invisible. Do I need to add more properties in the LimeTexture material? Or is it something else I'm missing? document.getElementById("KayakLime").addEventListener("click",function () { myKayak2.material.subMaterials[2] = LimeTexture; });
  2. Hi Gang! Many questions. (sorry) **** Does anyone know the history-of or reason-for... https://github.com/BabylonJS/Babylon.js/blob/master/src/Mesh/babylon.subMesh.js#L14 During the creation of a SubMesh, it is automatically placed into the mesh.subMeshes array. Is this somewhat new? Anyone know? MY reason for wanting to know? Visit Kostar's cool Tiled Ground Tutorial... particularly playground demo #5. See line 61, where our friend is pushing newly-created subMesh into the tiledGround.subMeshes array? Well... that's no good. Inserting a console.log near line 65, reports that there are 128 subMeshes in Kostar's 64-tile ground. (double, and we know why) Here is my own clone of Kostar's demo #5 - with console.log line showing 128 count. A little adjustment to line 61, and things start working good, with a count of 64. Maybe Kostar needs a mail. Maybe auto-pushing subMesh upon creation... is a bad idea. Dunno. Anyone know any history? Is auto-pushing subMeshes... something new? Bad? Good? Thoughts? (thx)
×
×
  • Create New...