Jump to content

[solved] Blender Exporter and Materials with multiple textures


amorgan
 Share

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

@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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...