Search the Community

Showing results for tags 'material'.



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 89 results

  1. Hi, I am trying to load an obj file into a scene. The mesh loads fine, but the MTL file (which is in the same directory as the OBJ) doesn't load so the mesh basically has no texture. I am not sure why. In the documentation it says that babylonjs should load it automatically. What am I missing? Thanks for the help!
  2. Merge Two Grounds.

    Hi All, I am using Babylonjs to create map these days. Basically, I have two layers, one layer is tiledmap, which is a png image, another is semantic map, which is a svg file. The size of two map is almost same. So I just create two grounds whose materials are created by the png image and the svg file and put them at the same position. If I make them locate at different heights, one ground will hide another. If I make them locate at the same heights, they cannot merge perfectly, at some angle you can see svg materials clearly, and png materials at some other. My problem is how to merge these two grounds perfectly?
  3. Rim Effect

    HI everybody! Is it possible to add a rim effect on mesh like in this image : Thanks, Pichou
  4. I generate a Ribbon from a path array which looks like in the attached image. I assign a single color material to the mesh, now I would like to add an another material/color to the center "strip". How can I achieve it. or did I have to create 3 separate paths (left , center, right) ?
  5. In this exemple : http://www.babylonjs-playground.com/#IAZTI#26 I put a probe reflection into the ReflectionTexture of the PBRMaterial of the wood object. I can see the probe reflection in the wood but i dont understand why my albedo is now black, any advices?
  6. Hi, We have a few questions concerning the cameraExposure and cameraContrast properties on PBRMaterial. Have these properties been lost during the update to 3.1 ? It would be something like this : https://playground.babylonjs.com/#JRCQTE#2 Here, the spheres have the same contrast and exposure. I think it was not the case before. Also, we love the new workflow for PBR (specular glossy and metallic roughness), but it does not expose this property at all. Is there a way to achieve this kind of result with the new workflow ? note : we kinda did it through material["_imageProcessingConfiguration"].contrast = v; But it tends to cause WebGL warnings (INVALID_VALUE: uniformBlockBinding: invalid uniform block index) and randomly overexpose our scene. Thanks a lot for your help ! We'd take any info you have about this properties, Best regards,
  7. Material Not Correct in Latest BJS

    You can clearly see the problem by viewing the latest and stable versions in the playground Latest Version https://www.babylonjs-playground.com/index.html#YDO1F#18 Stable Version https://www.babylonjs-playground.com/indexstable#YDO1F#18
  8. Hi all, in order to improve the performance of a scene built dinamically, I'm facing this problem: is it possible to have one material, to which is applied one texture, using different uScale e vScale depending on the mesh to which that material is applied? I need this because I have a 3d model of a city with many street segments, each segment having quite different length from each others. Now, those segments are textured: if I use the same uScale for them all, the road texture would appear "stretched" or "shrinked" depending on the length of the segment on which the material is applied, while I want it to appear uniform. I can bypass this problem assigning one different material for every street segment and setting uScale according to its length, but in the end the amount of materials and textures grows dramatically and scene performance falls down at 3 - 4 fps. Any ideas of how reducing the number of materials? Those are the actual stats for a mid-sized city: Total meshes 7309 - Total vertices 170688 - Total materials 7309 - Total textures 3834 Any ideas on how to solve this? Thanks in advance, cheers
  9. Hey. While working with PBR materials i have noticed that the name and id are not applied when cloning the material. Instead it uses it's parent name and id. For comparison here is the cloning snippet for the standard material and PBR materials, where the id and name are not reset prior to returning. StandardMaterial.prototype.clone = function (name) { var _this = this; var result = BABYLON.SerializationHelper.Clone(function () { return new StandardMaterial(name, _this.getScene()); }, this); result.name = name; result.id = name; return result; }; PBRMetallicRoughnessMaterial.prototype.clone = function (name) { var _this = this; return BABYLON.SerializationHelper.Clone(function () { return new PBRMetallicRoughnessMaterial(name, _this.getScene()); }, this); }; Correct me if I am missing something. Thanks
  10. PBR Gradient

    Hello, is it possible to create a PBR Gradient Material?
  11. Hi, I created material, based on Simple material (diffuse map, bump, specular map). Worked fine till point I tried to reuse one material for instance and non instance meshes. Can it be done from technical side? I have mesh that I use to create instances and I have other mesh that just use same material, as soon I add material to non instance mesh my instance meshes disappear on camera movement. Similar as in this tread but my material is not frozen.
  12. When i recreate texture or material, clone/dispose created more one texture (clone logic incorrect material.texture.clone() and material._texture.clone()) example https://www.babylonjs-playground.com/indexstable#Y48SUQ this is very important for dynamic scene, please fix source ** I tryed run in this latest version and saw what recreate correctry, but i not undersend how... and other -- i see what canvas2D will be not suported in future? I see GUI, this is very cool feature, but GIU can't do many tasks... Tell me whether it is possible to work with canvas2d in babylon.js 3.0, or will the support be returned in the future?
  13. url:https://forreall.cn/3ds/app/debugcloud/ This is a simple and efficient material debugging tool that allows you to upload your own model, and then export the unique identification of the url, like "babylonjs - playground", some of the above function on existing tools, such as: https://github.com/ssatguru/BabylonJS-EditControl, and now, it supports the material properties of very little, but we will extend the content later. You can simply modify the properties below PBRSpecularGlossinessMaterial 、PBRMetallicRoughnessMaterial 、 StandardMaterial 、light Here's a video demonstration
  14. I am new to Babylon and I have some knowledge about unity shaders but I am not sure how can I create shaders for Babylon, can any one suggest me any tool or any link which can help me to design or create some beautiful Shaders for Babylon. as BabylonJs Object's material, as we have shader forge available for unity, can any one suggest me a tool for WebGL shader create tool? that will be your good help for me, I am getting frustrated and need extream help from Babylonjs Community.
  15. I have a cube with a simple texture...how can the textures in the faces have the same rotation? For example, the front face is rendered ok(lines are vertical), but the sides are rotated(lines are horizontal), I want them all with the lines vertical, like the original texture. http://www.babylonjs-playground.com/#LS6QNX Thanks!
  16. Hi, I have issue with model imported from 3d max. Its just plane with normal map and color on top. (Simple material is part of MultiMaterial and is applied to all models). When I try to launch it in the game, first two models that are in centre of scene work as expected, but for other color is not applied (they are black), but normal map is working as expected. I found out that if I set camera radius so that all models are in camera viewport at the beginning , than color is working, also changing some props on the material , bring color back. (probably because of re-render). Any ideas what could cause it? Thanks.
  17. Hello This is my first Time in this forum. I am doing a scene with babylon js and I am using water material for some elements, when the mesh is created in code with createGround function it works fine, but when I import scene from blender, and add water material to any mesh, the result is not the expected. some one know what is the process to do that. thanks
  18. Hello, I have a little Problem with my Mirror Material. I cant get the Blur to work. If I try to blur the reflections in this playground Example http://www.babylonjs-playground.com/#EKFLA#13 by adding the lines: mirrorMaterial.reflectionTexture.blurKernel = 64; mirrorMaterial.reflectionTexture.blurRatio = 1; everything works fine. But If i try it in my own Scene nothing happens (changing the Values has zero Effect). Does anybody have an idea why it works in the playground but not in my scene?
  19. Hi, what would be the best way to crate lamp like mesh, that is half transparent and is lightened from inside (emits light). Thanks.
  20. PBR issue

    Hi, just pulled newest version of babylonjs and got some problems with PBR material for chrome, it is just black and don't use environment texture from scene anymore. Texture is created in code: this.scene.environmentTexture = new HDRCubeTexture( "environment.hdr", this.scene, ); Material is inside babylon json file part of multi material, { customType: "BABYLON.PBRMaterial", name: "material name", id: "material-id", microSurface: 0.9, reflectivity: [0.8, 0.8, 0.8], albedo: [0.02, 0.02, 0.02], environmentIntensity: 0.5, } Something changed in serialisation of material or I am missing some props in json? as it worked before Also texture is loaded.
  21. Change material colour

    Hi everyone, I need help. Could someone write for me function 'myFunction' which changes the colour of the material. I don't know in which place I need add this. Commented function setTimeot change the colour. When I added function 'myFunction' in this place i have error 'myFunction is not defined'. Do you have good tutorials for the beginners? <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html" charset="utf-8"/> <title>Babylon - Getting Started</title> <!-- link to the last version of babylon --> <script src="js/babylon.2.5.js"></script> <link rel="stylesheet" href="css/style.css"> </head> <body> <canvas id="renderCanvas"></canvas> <div> <button onclick="myFunction()">Click me</button> </div> <script> window.addEventListener('DOMContentLoaded', function() { // your code here var canvas = document.getElementById('renderCanvas'); var engine = new BABYLON.Engine(canvas, true); var createScene = function() { // create a basic BJS Scene object var scene = new BABYLON.Scene(engine); // create a FreeCamera, and set its position to (x:0, y:5, z:-10) var camera = new BABYLON.FreeCamera('camera1', new BABYLON.Vector3(0, 5,-10), scene); // target the camera to scene origin camera.setTarget(BABYLON.Vector3.Zero()); // attach the camera to the canvas camera.attachControl(canvas, false); // create a basic light, aiming 0,1,0 - meaning, to the sky var light = new BABYLON.HemisphericLight('light1', new BABYLON.Vector3(0,1,0), scene); // create a built-in "sphere" shape; its constructor takes 4 params: name, subdivisions, radius, scene var sphere = BABYLON.Mesh.CreateSphere('sphere1', 16, 2, scene); // move the sphere upward 1/2 of its height sphere.position.y = 1; // create a built-in "ground" shape; its constructor takes 5 params: name, width, height, subdivisions and scene var ground = BABYLON.Mesh.CreateGround('ground1', 6, 6, 2, scene); // Define a material var material = new BABYLON.StandardMaterial("std", scene); material.diffuseColor = new BABYLON.Color3(0.5, 1, 0.5); //setTimeout(function(){ material.diffuseColor = new BABYLON.Color3(0.5, 1, 2); }, 3000); // Apply the material sphere.material = material; // return the created scene return scene; } var scene = createScene(); engine.runRenderLoop(function() { scene.render(); }); window.addEventListener('resize', function() { engine.resize(); }); }); </script> </body> </html>
  22. Hi, I'm trying to reproduce ocean shader like this one: https://jbouny.github.io/fft-ocean/#day I know we have waterMaterial in Babylon (which is gorgeous!) but not quite what I'm after: it only works with windForce/windDirection which looks like you're constantly moving or as if water is constantly flowing. I've tried to use shader which you can find at https://github.com/jbouny/fft-ocean but it's just waaaay over my head! First of all, I can't figure out how to split it into vertex/fragment shaders to use in Babylon. Any shader/GLSL gurus out there, any help hugely appreciated!
  23. PBR Breaking Changes

    Hello, After one year of the PBR Material, we collected most of the required feedback to make it Awesome. But unfortunately, this will go with some breaking changes.. I am really not happy to integrate them but they are for the best and I will fully document them. Knowing our backward compatibility Philosophy in BJS, I just want to give a long time ahead with our plan to ensure this will cause the lowest level of disruption on your projects. Strikeout tasks have been completed. First thing, is the migration of the current PBRMaterial in MaterialsLibrary under the name LegacyPBRMaterial to ensure that the ones among you relying on it can continue to find the current version as of today. This will not be fully maintained but mainly keep for reference during the time everybody migrates to the newer/greater one. Only urgent fixes will be addressed on it. As nobody seems to rely on them, the overloaded values used for debug but taking quite a big amount of code will be removed from the material. All the scalar values will be multiply by their respective maps like albedoColor * albedoTexureSampled (currently it is totally inconsistent and depends of the channel) The different channels will be renamed to map with the GLTF nomenclature (At least I will not have anymore issues in naming :-) ) to allow an easier adoption of BJS and less ramp up for everybody. For example, the material microsurface will be named back to glossiness and reflectivity to specular... All the Maths issues and bugs presents in the material will be fixed. The environment blur will be fixed through offline and/or loadtime GPU generation. (This should be compatible with browser not supporting both FullFloat and Texture LOD) A migration from full float to LUV is in our minds for the environment to allow the use of none full float buffers with HDR compatibility. UBO, Push Mode and the full sets of greatest new features will be added to the new version. A new light type will be created to ensure an easier management of the intensity value in PBR mode. I should not forget a lot here and I hope you understand the future change. This is planned to happen during this month so do not hesitate if you have any feedback, think about any blockers or other evolution you would like to see in. As a consolation gift for the breaking change, I can propose to add the pbr exporter in 3dsMax or blender ?
  24. Alpha Map in Video

    I'm trying to use a video to set the alpha information on a standard material. The video displays fine(passed into the diffuse) but can't figure out how to pass this into the alpha with correct results. My code.. Ref: http://doc.babylonjs.com/tutorials/materials scene.seaPlane = BABYLON.Mesh.CreateGround("ground1", 36,36, 2, scene); var mat = new BABYLON.StandardMaterial("mat", scene); var videoTexture = new BABYLON.VideoTexture("video", ["textures/waterRing.mp4"], scene, true, true); mat.diffuseTexture = videoTexture; mat.diffuseTexture.hasAlpha = true; mat.useAlphaFromDiffuseTexture = true; scene.seaPlane.material = mat; videoTexture.video.play(); There is no explicit alpha channel in my video file, so perhaps this is where I'm going wrong? Maybe it's better to render the video out as a sequence of pngs Thanks,