Search the Community

Showing results for tags 'pbr'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • HTML5 Game Coding
    • News
    • Game Showcase
    • 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

Found 59 results

  1. Custom PBR material

    Hello everyone, I've encountered a situation where I need to mix two normal maps for my PBR material. One map is the main texture while the second one is tiled detail texture. Much like Unity does with its standard material. What would be the best way to extend the functionality of the current PBR material ( or at least its PBRBaseSimpleMaterial parent). Amending shader itself and passing a second texture sampler is not a problem for me. I understand I should utilize material library and compile a new material. But should I use existing custom standard material as a basis or there are better ways of doing it? I would love to keep entire PBR shader code in local .fx files instead of replacing custom parts though. I bet many artists working with BJS have encountered similar issue where they'd need to tweak existing material and meddle with the shader code but the process of creating anything custom isn't that clear or intuitive. Any tips would be very helpful! Many thanks in advance. PS readme file for custom standard mat states that it would only work with BJS 3.0.0 and I'm using the latest stable one.
  2. Is there a way to generate custom mipmaps for a texture and save it? For instance, Unity preblurs the mips of a cube map (using specular convolution) in order to accurately simulate roughness.
  3. PBR on iOS

    Hi there: I'm trying to have done a cross-platform development these days. After some problems here and there I have my development running OK on: desktop - windows - web - ff desktop - windows - web - chrome desktop - macosx - web - safari mobile - android - web - chrome mobile - android - hybrid app (cordova) mobile - iOS - web - safari Sadly it doesn't work as presumed on the last platform I'm targeting, of course: mobile - iOS - hybrid app (cordova). Under this last scenario a have several "hard" issues: my PBR materials are completely invisible; and some of my Standard materials (textures on planes) are shown all black. The other Standard material I am using (particle textures) are shown OK. Any help or advice with this? Thanks for your time.
  4. Hello, I would like to convert the material definitions in a .babylon file to the most basic PBR possible. Currently, exported from Blender, I have two materials; bed.Floor & Bed.Wood: "materials":[ { "name":"bed.Floor", "id":"bed.Floor", "ambient":[ 1, 1, 1 ], "diffuse":[ 1, 1, 1 ], "specular":[ 0, 0, 0 ], "emissive":[ 0, 0, 0 ], "specularPower":50, "alpha":1, "backFaceCulling":true, "checkReadyOnlyOnce":false, "maxSimultaneousLights":4 }, { "name":"bed.Wood", "id":"bed.Wood", "ambient":[ 1, 1, 1 ], "diffuse":[ 1, 1, 1 ], "specular":[ 0, 0, 0 ], "emissive":[ 0, 0, 0 ], "specularPower":30, "alpha":1, "backFaceCulling":true, "checkReadyOnlyOnce":false, "maxSimultaneousLights":4 } ], I would like to manually edit this file so that BJS treats this as PBR? But can't work out what to do. Yes, I know I can create new materials in my scene script... but would be grateful if anyone could advise what changes I need to make to the .babylon file by hand? Hope this makes sense! Thank you all.
  5. Hey I'd would like know when the texture is loaded on PBR glTF workflow, I did this code : assetsManager = new BABYLON.AssetsManager(scene); var textureTask = assetsManager.addTextureTask("albedoTexture texture", "assets/test/lambert1_baseColor.jpg", true, false); albedoTextureTask.onSuccess = function(task) { console.log(task.texture); meshes.material.albedoTexture = task.texture; } assetsManager.load(); The material assignation does nothing here thanks
  6. I did a little exercise to update myself on the export in gltf and new Gui : The modeling is done in Blender, the mapping with substance painter and I export everything from Blender with the add-on of kronos: However, I have a question: For the reflection I used the file of Babylon because I can not generate mine. Is it possible to create one from an equilateral texture? I followed what is written in the tutorial: but when I export my map it generates 7 different textures? Someone would have an idea for me to finalize this project. Thank you.
  7. Hi, It seems like in the GlossySpecular workflow, the values of diffuseColor and diffuseTexture are not multiplied together. Then, if you wan't a material with a quite saturated color, like Adding a texture with this green is not the same as setting this green as the diffuseColor. Sample playground is here : Is there a configuration for the PBR Material to get the result we see with a monochromatic texture, without using any texture ? Thanks a lot ! Have a nice day,
  8. PBR, alpha and transparency

    Hi, The last build has some changes in the way PBR Materials are rendered with transparency In the last build, you need to indicate the Material requires transparency (transparencyMode) to have it blended with the background. Seems like in the last stable version it was its default behaviour. Is it intended ? Thanks a lot for your inputs, have a nice day !
  9. Hi, PBRMetallicRoughnessMaterial is extending PBRBaseSimpleMaterial that is extending PBRBaseMaterial. Inside PBRBaseMaterial there is protected property for lightmapTexture but its not exposed inside PBRBaseSimpleMaterial so lightmapTexture can not be used with PBRMetallicRoughnessMaterial. Is that by the design that metallic pbr doesn't have lightmapTexture ? as it is exposed only for PBRMaterial right now. Thanks
  10. Dear people of this awesome forum: Here I am again, looking for some help. My sw development (of course with BJS) uses PBR materials (we are the greatest fans) . The case is that this is a cross-browser multi-platform project. My scene looks great on desktop: MS Windows (Firefox and Chrome / I'm not using/testing MS Explorer, Edge nor Opera) and macOSX-Safari. It also looks impressive on iOS-Safari, but fails to be so fine in Android-Chrome as my geometries are all show in black. I know this is a problem with my code, as the different PBR examples of BJS look perfect in Andorid-Chrome, but,...what a weird one. Any starting point with this? Thanks for your time.
  11. Hello! I have an issue I hope you can help me with. I'll put you in context and hope I can give you enough information. Let's say I have a PBR floor exported with diffuse, rough, metal and normal from 3DSMax with the Babylon plugin, as well as the environment texture for reflections. I would like to put a ball on this floor that casts a shadow over it, but for some reason it isn't working. It does work with a standard material, but not the PBR. Does this have to do with the 3DSMax export? Am I missing something in code? Should I tweak the shader somehow? Thank you for the help in advance!
  12. How to perfectly set up all possible PBR properties (channels and values supported by Babylon PBR material ) in 3D max such that it exports to Babylon perfectly in a manner that uses the full potential of Babylon PBR materials? (Without requiring to set any PBR properties by code or by using ) I am basically looking for best workflow method for producing realistic Babylon scenes (which have PBR materials for all meshes) using 3D Max. Any common pitfalls/suggestions/tips ?
  13. PBR Texture [SOLVED]

    Hello. I exported a Kayak model from Substance Painter 2 as a glTF with the Metallic Roughness configuration. The Kayak has a red/yellow gradient png texture on it. Exporting from Substance Painter 2 gave me Kayak_baseColor.png, Kayak,_normal.png, and Kayak_occlusionRoughnessMetallic.png textures. In my Babylon JS scene, I import the model (Kayak.gltf)and am trying to switch the Kayak_baseColor.png to Lime_baseColor.png on load. The Kayak loads into the scene with it's red/yellow gradient png texture on it, but doens't switch to the lime texture on load.. Am I missing PBR properties? Or are my properties wrong? Thanks. var myKayak2; BABYLON.SceneLoader.ImportMesh("", "models/", "Kayak.gltf", scene, function (newMeshes) { myKayak2 = newMeshes[0]; var LimeTexture = new BABYLON.PBRMetallicRoughnessMaterial("Lime", scene); LimeTexture.albedoTexture = new BABYLON.Texture("models/Lime_b aseColor.png", scene); LimeTexture.metallic = 0; LimeTexture.roughness = 1.0; myKayak2.material = LimeTexture; }); I tried changing the PBR material definition to this but still no luck: var myKayak2; BABYLON.SceneLoader.ImportMesh("", "models/", "Kayak.gltf", scene, function (newMeshes) { myKayak2 = newMeshes[0]; var LimeTexture = new BABYLON.PBRMaterial("Lime", scene); LimeTexture.albedoTexture = new BABYLON.Texture("models/Lime_baseColor.png", scene); LimeTexture.metallic = 0; LimeTexture.roughness = 1.0; myKayak2.material = LimeTexture; });
  14. Hi everyone, I'm facing some issues with the use of ReflectionProbe, may I please request some help ? Here's the use case : Some object is in a room with walls and windows, and I'd like the walls and windows to reflect on the objet. So I add a probe at the object's position, push the walls and windows in the probe renderList. And it works pretty well ! (here, the cube is the object, the balls are the walls and windows...) But in some cases (like in the linked playground), there's some long and synchronous computation when it needs to call ConvertCubeMapTextureToSphericalPolynomial. I think it's correlated to the type of the Material I'm applying the probe texture on... Is there a workaround to avoid this computation ? (beside reducing the texture size ?). On a side note, I have very little knowledge about the concepts of light harmonics, but why does this computation only happens once if the probe is updated each frame ? In advance, thanks a lot for your inputs ! Have a nice day,
  15. PBR and Light Maps

    Hi, Have somebody managed to use light maps with PBR materials? Meshes have UV2 for light map and they reuse 1 lightmapTexture , but somehow it works only for Standard materials, and not PBR, if I remove PBR shadows appear. material.lightmapTexture = // Texture material.lightmapTexture.coordinatesIndex = 1; material.useLightmapAsShadowmap = true; Is that by design? Or I am doing something wrong? Thank you.
  16. In this exemple : 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?
  17. 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 : 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,
  18. Hi everybody: We're trying to use the BJS Editor in order to have PBR materials, as the Exporter (from Blender) doesn´t let use them. Our problem is that the resulting .babylon file generated by BJS Editor seems to include the textures as embedded ("base64String" property), resulting so in a huge .babylon file. In parallel, a clever reusing of textures (as .dds) is not possible, as they are all embedded time after time, with each scene. Is there any alternative to this workflow? Thanks for your time. Best regards. Addendum (real .babylon file excerpt): . . . { "tags": "added", "directIntensity": 1, "emissiveIntensity": 1, "environmentIntensity": 1, "specularIntensity": 1, "disableBumpMap": false, "albedoTexture": { "tags": null, "url": "tubo_basecolor.png", "uOffset": 0, "vOffset": 0, "uScale": 1, "vScale": 1, "uAng": 0, "vAng": 0, "wAng": 0, "isBlocking": true, "name": "tubo_basecolor.png", "hasAlpha": false, "getAlphaFromRGB": false, "level": 1, "coordinatesIndex": 0, "coordinatesMode": 0, "wrapU": 1, "wrapV": 1, "anisotropicFilteringLevel": 4, "isCube": false, "gammaSpace": true, "invertZ": false, "lodLevelInAlpha": false, "lodGenerationOffset": 0, "lodGenerationScale": 0.8, "isRenderTarget": false, "animations": [], "base64String": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAEAAAABAACAIAAAB9wbNAAAAACXBIWXMAAAsTAAALEwEAmpwYAAAgAElEQVR4nOzbQQ0AIRDAwCM5/5YXCTyhyYyCGuiamQ8AA . . ." }, . . .
  19. Is there anyway to fade the albedoTexture of a PBR material, so that I can animate this material to a plain colour? I notice there is an ambientTextureStrength property. but no albedoTextureStrength property. Cheers
  20. PBR in 3d max

    Hi, Some time ago I saw that 3d max export got PBR support, is that right? Any information available on it? (already usable , how to use). Alos will there be why to set global reflection texture on scene, so preview in 3d max will use it? Thanks for great work.
  21. 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); = name; = 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
  22. PBR Gradient

    Hello, is it possible to create a PBR Gradient Material?
  23. I've noticed that the 3D Max exporter - Max has added ability for PBR materials. Is there any guides on how materials in Max need to be setup in order for the PBR materials to work?
  24. pbr occlusionTexture

    Hello, everyone, I used PBR material in one of our scenes, I want to try to get occlusionTexture with 3dsmax, how to operate it?
  25. Hi! I noticed something weird working with reflection texture on IE10 and Microsoft Edge. When using a single image as reflection texture, I get the error "Unable to compile effect", "Invalid arguments passed to function 'texture2D'". Here is a PG reproducing the issue It's working fine on Chrome and Firefox.