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
    • Facebook Instant Games
    • Coding and Game Design
  • Frameworks
    • Phaser 3
    • Phaser 2
    • Pixi.js
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered

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

  1. My idea is to "project" a cubic texture from a given point as Google Streetview or Matterport do? The idea is that this kind of shader should look like projected texture not like reflection as CUBIC_MODE does. I've made several test like using refraction with IOR (it looks promising!) but the projection is always done from camera position. Any tip on this? Thank you in advance!
  2. Hello, I am using babylonjs to implement a 3D visualizations inside my app. The app allows a user to define a scene in a 2D view. The scene is static in the 3D view - meshes cannot be moved, edited etc. A user can interact with objects using mouse - selection by click, hover on mouse move, double click to open in another view. In my opinion the most natural way to present that something is happening when user moves mouse is to change meshes’ colors. Everything works well (50-60 fps) when there isn't much meshes – 300-400. Unfortunately, performance drops down when the scene becomes more complex – about 4k meshes. I’ve already tried improving performance by using: mesh instances (cause a lot of them have the same texture and vertex data) - unfortunately I haven't found a way to color a mesh instance on mouse selection. I found a method set/updateVerticesData but VertexData.ColorKind cannot be updated when mesh instances are used (an error occurs when I try to set argument makeItUnique to true) mesh clones - it works like I expected because clones do not share material, but the performance problem still exists solid particle system - when I started implementing and saw the results I was amazed and thought that I found a solution. But then I realized that I cannot use particles as parents for other meshes. Am I right? I’ve prepared a playground showing my problem. On the left-hand side of the scene (3 boxes) is my real use case. It shows how I use mesh parent system. On the right-hand side there are rendered boxes that represent objects in my scene. https://playground.babylonjs.com/indexStable.html#U0KFSU#5 I am afraid that I am bound to CPU due to having a lot of transparent textures and a lot of meshes. When I was profiling my scene a lot of CPU time was spent on recognizing which meshes are active (I freezed activemeshes on the scene by calling scene.freezeActiveMeshes()). Now i get around 12/13 FPS (measured with Chrome DevTool/Rendering and FPS meter feature), CPU usage (in windows task manager) is around 35%, GPU usage (in windows task manager) 19%. Is there anything else I can do to have at least 25-30 FPS and still react to mouse operations? Thank you in advance for any suggestions 😟
  3. Hi, I'm taking a rather big bite here since I haven't really used TypeScript before, and I have very limited experience with JS and node in general. So I'm not really sure where the fault lies, but I'm pretty sure it's something stupid easy. The problem I have is this: Uncaught TypeError: Cannot read property '_environmentBRDFTexture' of undefined at Function.e.GetEnvironmentBRDFTexture (babylon.js:1) at t [as constructor] (babylon.js:1) at t [as constructor] (babylon.js:1) at new t (babylon.js:1) at t.Creation.createMaterial (Creation.ts:28) This error appears any time I try to create a new PBR material - happens with any PBR material. Specific line from where the error originates is simply this: var material: PBRMetallicRoughnessMaterial = new PBRMetallicRoughnessMaterial(name,GLOBAL.scene); StandardMaterial works just fine. I am using webpack with ts-loader to bundle the JS, as well as TypeScript Compiler, for verification only. My webpack.config.js is pretty much copy-paste from the docs: const path = require('path'); module.exports = { entry: { app: './src/game.ts' }, output: { path: path.resolve(__dirname, 'build'), filename: 'game.js' }, resolve: { extensions: ['.ts', '.tsx', '.js'] }, devtool: 'source-map', plugins: [ ], module: { rules: [{ test: /\.tsx?$/, loader: 'ts-loader', exclude: /node_modules/ }] } } And this is my tsconfig.json: { "compilerOptions": { /* Basic Options */ "target": "es5", "module": "commonjs", "noResolve": false, "noImplicitAny": false, "removeComments": true, "preserveConstEnums": true, "sourceMap": true, "experimentalDecorators": true, "isolatedModules": false, "lib": [ "dom", "es2015.promise", "es5" ], "declaration": true, "outDir": "./tscverify", "strict": true, "types": [ "babylonjs", "babylonjs-gui", "babylonjs-materials" ], } } Help?
  4. 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!
  5. Is it possible to set the bump height of a standard material like on the water material? Thanks, Pichou
  6. Hartha

    Coloring backface

    Hi, How I can color the mesh backface only, the mesh maybe has a texture or not. Thanks in advance.
  7. While importing meshes designed in software like Autocad and Blender, I noticed that the color of a previously imported mesh is getting applied to many meshes that are later imported. Then I realized that that this is due to conflicting material IDs. Is there a way to modify material ID of an imported mesh or is there any other solution to this problem?
  8. Dong

    waterMaterial

    I love BABYLON , I encounter a troble about waterMaterial.It often appear some black edges at some angle of camera. I can't find what cause it. lights: there are two lights ,hem and point. but the waterMaterial still black when I adjust the lights camera: arcRotate,target is (0,0,0),and the bigger the beta ,the darker the water renderList:[skybox]
  9. Hi everybody ! I'm importing .obj files in my application, and I want to change their color. However, the color seems to be changed when the page is loading, but when it's finally loaded the mesh still has its basic grey material (so while the whole scene is loading we can see the mesh being pink for half a second and then takes back its basic color/texture/material). I've seen something about UV maps etc.. but I checked it in Blender and it is activated when I import into obj. Here's a pg trying to reproduce my problem ( first you will need to help me importing my object into the pg because it doesn't seem to be working, I can't see it on scene); I added a skull.babylon to show that the code I provide is supposed to work : https://www.babylonjs-playground.com/#V9KE7I#7 Thanks for your time !
  10. I was unable to transform mesh instance if the original mesh had a shader material. Is this a bug? I have created a playground example using box mesh. If you open the debug -> mesh panel, you realize there are 6 meshes, but only 5 are displayed. This is because one of the instances in the second row was not transformed properly. On the other hand, clones of meshes with shader material can be transformed properly. https://playground.babylonjs.com/#B2NZ1M#1
  11. I'm glad I discovered babylonjs. I'm testing on different browsers and I have a color rendering problem with the stable version and FireFox only. Normally we should see a red sphere and a green sphere. ■ SandBox : https://www.babylonjs-playground.com/indexstable#ZM9G4E#3 ■ Demonstration Video : Thank you for your help and bravo for this framework.
  12. pichou

    Rim Effect

    HI everybody! Is it possible to add a rim effect on mesh like in this image : Thanks, Pichou
  13. Hello, No bug, no issue today ! I was just wondering about the choice of linking materialDefines to subMeshes, rather than directly on materials themselves. Does that mean that two subMeshes could have the same material, but different defines ? As the material updates the defines depending on its own properties (not the properties of the subMesh), I can hardly see how it's possible. I would love to see an example of this if you have one. I mean, I'm missing something. I'm quite sure this choice has been made for a good reason. But I don't get why. Thanks for your help !
  14. Are vertex colors and materials compatible? I've created a playground based on the custom mesh playground to illustrate the issue: http://www.babylonjs-playground.com/#VKBJN#160. If no material is attached, I get an interpolation of the colors over the triangle. If the material is attached to the mesh in line 42 the triangle is black and it appears to use only the colors of the material. My ultimate goal is to use a point cloud with vertex colors and a material. Thanks, Jess
  15. Hi everyone, I know it's possible and advised to use InstancedMesh when several meshes share the same geometry and the same material. Is there some recommended optimization to do when two meshes share the same geometry but have different materials ? For example with this case : http://playground.babylonjs.com/#T4Z2V9#1 (here VertexData object is already loaded) Is there something better than two calls to "applyToMesh" ? Like obj1.geometry = obj2.geometry, this kind of thing... (my question is based on the fact that Unity explicitly share the same geometry across objects, even when Materials are different. But perhaps it's only done to optimize data packing / loading and has no impact at runtime...) (I'm fairly sure I have already found this question somewhere, but can't remember the answer nor find where it was...) Thanks a lot for your inputs ! Have a nice day,
  16. Hello, I'd would like access to any mesh through my loader for change a texture map , but the log output 2 times the same model : https://bin.fuelphp.com/snippet/view/OJ Is it my script which run 2 times or what version I should use ?
  17. trollolloo

    meshes get same material

    I'm using BabylonJS V3 with Blender 2.79 to create product visualizations. Many times, it is necessary for me to define more complex shaders in the JS code. I'm using lines like scene.meshes[1].material.emissiveColor = new BABYLON.Color3(1, 0, 0); to define the shaders after export. Usually every mesh can get it's own shader this way. Unfortunately, I can't get it to work somehow. Even in small test scenes (one red icosphere, one green cube, a hemi lamp and a camera), both objects get the same material. When trying to change the appearance like shown above, both meshes change color. When I navigate the camera, so that one object isn't visible, the right material gets loaded (green, in my sample scene). Here is a small video of the strange behavior: https://imgur.com/a/zYlLT Both blender meshes have individual datablocks and individual materials. No duplication, instancing ... Do the mesh indices change, when a mesh gets unloaded? Where could I have made the mistake? In blender or in my .js? I am greatful for every hint!
  18. Sebavan

    Glow Layer

    Hello, It has been a while I did not introduced a new feature in BJS so as the higlight layer was famous, let s introduce the glow layer: http://www.babylonjs.com/demos/glowlayer/ Documentation is available here: https://doc.babylonjs.com/how_to/glow_layer
  19. Hello folks, i try load an .obj file and modify the material/texture scaling. Loading goes well, but not scaling of the textures When i try to access the material object i get a undefined error. meshes[0].material is undefined, in the screen shot you can see the property is there. I dont know what i do wrong // first param: ["myMesh1", "myMesh2"] // https://doc.babylonjs.com/how_to/load_from_any_file_type BABYLON.SceneLoader.ImportMesh("", "./assets/temp/house/", "restaurant.obj", game.scene, function (meshes, particleSystems, skeletons) { // do something with the meshes and skeletons // particleSystems are always null for glTF assets //console.log(meshes, particleSystems, skeletons); console.log(meshes[0]); });
  20. negrant

    Material Color

    Hi all, I want to ask about StandartMaterial, if I add to material a ambientColor or a diffuseColor or a specularColor it means that this colors mix with material.texture colors in every frame, or just at once and then new colors saves somewhere in buffer. Need to know this for performance, if all colors mixes every frame I think this bad for performance and I will be find some other ways. Thanks : )
  21. Hey everyone! Is there a way to add a smooth transition when changing the material of a mesh? Thanks, Pichou
  22. Hi, Is it possible to control image format export for 3d max materials (force jpg, png for example) somehow? As for physics material (pbr) it produces png right now for me even without any transparency. Thank you in advance.
  23. hi, anyone knows why changing the value of "pointSize" doesn't influence the size of points of a shaderMaterial? shaderMaterial.pointsCloud = true; shaderMaterial.pointSize = 10;
  24. pichou

    Chrome Material Issue

    Hey everyone, I have something weird happening with the game I develop. See in this test page : http://test.wazana.io/ ( it is a special preview for you! ) The materials of the units and buildings are flashing. I observed this behavior only on chrome (working normal on IE, Edge and Mozilla) and not on all computers I tested (maybe there is a problem with a specific version of chrome). I use BABYLON.MultiMaterial on units and buildings because they always have 2 colors so one material for each color. But when it flashes on Chrome, this is either one color or the other on the entire mesh. I put a video attached which show the bug in case you don't see it on the test page. (weird video format but playable with VLC) Bye, Pichou chromematerialbug.webm
  25. Hi all, I found something weird while optimizing my code: I was using InstancedMesh as much as possible, and switched all my materials to ShaderMaterial. And then boom, everything disappeared. After a bit of research, it seems instanced meshes will simply not be drawn when their source has a ShaderMaterial assigned. Playground repro: http://www.babylonjs-playground.com/#TWDEA#6 Uncomment lines 40 to 44 to see for yourself. It's actually a bit more complex than that: when you assign a shader material to it, even the source mesh disappears if it has been instantiated (?), but only if its instances are in the field of view. I'm currently looking at BJS code and ANGLE_instanced_arrays doc (the extension used for drawing instanced meshes), but I thought I'd come here to fish for ideas... FYI these are two errors I noticed in the log when this problem showed (errors not always there): drawElementsInstancedANGLE: at least one enabled attribute must have a divisor of 0glDrawElementsInstancedANGLE: attempt to draw with all attributes having non-zero divisorsThanks