amorgan Posted July 5, 2017 Share Posted July 5, 2017 Hello all, I found this tutorial for, what seems like, a good way to create terrain textures in blender: https://www.youtube.com/watch?v=p4Dt2S6uMGM My question is about exporting this type of texture. If you don't watch the video, what is being done is a UV Map is being created, and a material with several tiled textures. There is also a stencil layer that masks layers of tiled textures. This seems to work great, since you get the benefit of a tiled textured. My questions are about how the current Blender Export to Babylon JS (4.6.1) works and if there is another way. I have not found this information yet. 1) When exporting this type of material with multiple textures, they seemed to get baked into a [filename]_[meshName]_TEXTURE.jpg. Not ideal, but this can work for now, but I am having troubles specifying the output resolution. Is there any documentation or tutorials on this? 2) Is there a way to achieve the method above without baking the textures? Such as blending different textures, if so is there documentation on this? I'm not currently trying to do infinite terrains, so I'm trying to work within this problem set at hand. Thank you, amorgan Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted July 5, 2017 Share Posted July 5, 2017 A blending material could be a great feature, but I don't know if this can be easily add to the exporter : I guess this require writing a specific shader, to assign to the terrain once exported, in javascript. Maybe someone already done that in playground, but I could'nt find a test scene. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 5, 2017 Share Posted July 5, 2017 1) UScale & VScale are specified for export the same way as in the video, see. Not sure this will really remove the blur for large terrains. There is not much substitute for 4K textures, except for the infinite terrain project or repeatable textures. 2) Blending is baking, just time displaced. Even if you were trying to code something for an exporter, BJS actually needs to support it. A BABYLON.StandardMaterial can use multiple textures: Diffuse, bump, etc, but you can only assign one to each type. Personally, I think this ability would only slow the scene down to do it every frame when it only needs to be done once. You might be able to perform the bake on the Javascript side, before it is set to material.diffuse. I am not sure what an HTMLImageElement is capable of. Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted July 5, 2017 Share Posted July 5, 2017 6 minutes ago, JCPalmer said: 2) Blending is baking, just time displaced. Are you sure that baking can't be avoid by writing a dedicated shader ? Example in Unreal engine, I'm almost sure that these 3 mixed textures keep tiling like classic diffuse textures, and their influence is defined by vertex colors. But maybe in the engine side it is baked at each frame ? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 5, 2017 Share Posted July 5, 2017 It is absolutely possible, but BABYLON.StandardMaterial is a shader of course. You would have to write your own either with instance ShaderMaterial & specifying the vertex & fragment shaders. There is also the newer CustomMaterial in MaterialsLibrary. Not sure how that works. These are very low level tools though. V!nc3r 1 Quote Link to comment Share on other sites More sharing options...
amorgan Posted July 5, 2017 Author Share Posted July 5, 2017 @JCPalmer 1) I'm not sure if that's what I need. The baked texture that gets created on export is what is low resolution. 2) I see that BabylonJS 3.0 has a terrainMaterial ( https://doc.babylonjs.com/extensions/terrain ) which might be what I want. I wonder if that could be used for the exporter. I'm trying to explore terrainMaterials, but further conversation around achieving this in the exporter is welcomed. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 5, 2017 Share Posted July 5, 2017 This material has serialize tags, so technically it could be put in a JSON file. Coming from Blender, know which texture goes to which in JSON would be a challenge. Then you would UI to indicate to process as this not a standard material. As you own personal fork in the exporter, you might be able to take some short cuts. I have no interest in this area. Quote Link to comment Share on other sites More sharing options...
amorgan Posted July 6, 2017 Author Share Posted July 6, 2017 Can anyone else help provide clarity on how to change the exported texture resolution on export from Blender when it creates a baked texture? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted July 6, 2017 Share Posted July 6, 2017 You are changing the question. There is UI at the mesh properties to change from the default of 1024. Here is an old picture. Quote Link to comment Share on other sites More sharing options...
amorgan Posted July 6, 2017 Author Share Posted July 6, 2017 @JCPalmer I'm sorry if I rubbed you the wrong way, but this was definitely my first question. So maybe there was a misinterpretation from the start. Anyway, I appeared to have an old version of the exporter that did not have these settings, even though the version I had showed 4.6.1. Thanks for helping out, the Procedural Texture / Cycles Baking "Texture Size" was what I was looking for. In regards to my second question, I will most likely need to look into the new TerrainMaterial in BJS 3.0 or come up with a custom solution. Thank you, amorgan Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.