Blender texturing using a stencil and repeated textures


#1

I am trying to create a simple terrain.

The terrain is a single quad plane consisting of one asphalt and one grass texture.

I am using a black and white stencil in Blender. Asphalt shows on black, grass shows on white (see screenshot).

When I export to FBX using the recommended export settings, I am unable to get the textures to show correctly in HiFi.

Help!

Here’s the .blend:

https://drive.google.com/open?id=0B6o7Mi2AKJ1PRENSZ3dWWjI0VXM


#2

First problem i see is the material. Avoid the Material.001 dot in the name. Not sure if it still a problem but replace that for underscore

Hopw does it show in high fidelity ?
I see only one UV map , so that cannot be the problem.

The textures are not included in the blend file so i cannot see what else could be wrong.

Try it again with this settings in materials.


#3

Sorry… Packed the textures into the .blend. Also changed the settings as per the suggestion. Additionally, I renamed the material.

The .blend file at the URL above should reflect all of these changes.

This is what I see in HiFi:


#4

Sorry not in front of my PC, Is the model UV unwrapped? stencil information will not get transferred over in the FBX file, only texture maps. Also looks like your first texture slot is empty, all 3 -5 PBR textures need to be filling up the first slots with no empty slots in between.

Also, are you exporting with the paths ‘copy’ option selected in FBX export ?


#5

The first slot is empty @whyroc
What seems to be lost or missing is the UV map you painted everything on and then assigned to the mesh.


#6

@whyroc, I’m not using PBR texturing.

First texture slot issue was because I had a normal map there that I removed. I moved the other 3 texture slots up.

I think the key issue here is “stencil information will not get transferred over in the FBX file

Short of separating faces in the mesh, is there some other way to go about achieving the effect of mapping asphalt and grass textures?

Related, I tried baking the textures, but because the mesh is huge, the baked texture looked awful at scale.

The .blend file is updated at the link above.

FBX export options set as per HiFi export recommendations (see below)

Latest settings result in the below in HiFi.

Close-up

Interestingly, the grass texture is showing through (scaled 1000x).


#7

You’re gonna have to duplicate the mesh, move it up on the Z axis by 1 or 2 units, and give it a transparent stencil texture. This will create the effect you want, at the cost of double the triangle count.

The other way is to simply bake everything combined into one giant texture. This is not the ideal or optimized way to do things, but it will get you what you want. For terrain, you’re gonna need a very, very big image for that… 4096x4096 at minimum.


#8

@PetVal… I’m OK with double triangle count, as using texturing to do what I want will result in far fewer polys than splitting the mesh precisely along those paths.

I’m not sure I know how to add a transparent stencil texture if “stencil information will not get transferred over in the FBX file

Is there any chance you could sketch out the process?

Many thanks!


#9

Do you stamp on UV-map aka texture ?
And after your done, save the texture to disk. and dlete all materials and make a new one with that UV map assigned. That sounds the ormal flow for me.


#10

@Richardus.Raymaker, unfortunately, I don’t understand what you mean by “stamp on UV-map aka texture”.

Are you referring to baking all textures, saving the resulting texture, and then applying that baked texture to the mesh?


#11

I am also experimenting with terrain, since we are limited to one UV per section is has its limitations.

There are techniques for faking the far away lands with a large mesh(es) placed away from the main physical terrain so you will never actually go there. These can generally be painted and not need to repeat as the color is far away. You can add some mesh detail like trees etc to the far away lands for extra effect.

You can also logically connect sections of smaller terrain together if you kind of ‘round off’ the edges on the meshes. This is a really good technique actually as you keep the texture size down and you can duplicate the object in-world which helps with instancing (not sure?)

I would recommend using PBR materials generated specifically for Hifi, I find that If you can add a realistic effect to terrain, it takes away from the impression of repeating textures , so for really big physical terrain its possible to do a passable repeating ground with one set of textures.

To overlay something, if the terrain is relatively flat you can get a large alpha ‘splat’ type image on a simple non physical plane, and lay it just above the terrain (this will certainly need to be a PBR albedo texture with alpha channel baked in)

-W


#12

This terrain is the base layer for a university campus. I have plans to fake some things that will be in the distance, but the entire campus will be a model that can be explored.

I have a detailed and fairly complicated mesh that is geographically correct in terms of GIS data. To separate that mesh for texturing is impractical, as it would take far too much time.

PBR is new to me, so generating materials specifically for HiFi is currently outside my knowledge and skills. I am learning, but as you know, HiFi documentation is often vague, outdated, and incomplete.

I’m afraid I am not following this:

To overlay something, if the terrain is relatively flat you can get a large alpha ‘splat’ type image on a simple non physical plane, and lay it just above the terrain (this will certainly need to be a PBR albedo texture with alpha channel baked in)

Would you please elaborate?

Thanks!


#13

Sorry for not being more clear, what I meant was that the texture you are currently using as a stencil, will be used as a plain ol’ texture like any other, just one that happens to be transparent so that it appears to blend onto anything below it. A lot of old videogames did this, for example the dirt trails in the terrain of Hyrule Field in Zelda 64 were actually partly-transparent meshes floating just a tiny tiny bit above the grass.

Since we do not have support for multiple UVs here, we are forced to use old techniques like this.


#14

@PetVal

OK, sure, that’s the direction I’m heading. I’m old skool!


#15

that’s what I meant too, thanks


#16

I’ve run into complications.

I’m working on a Mac and clearly there is a bug in Interface. I first noticed it on the teleporter models. Their textures render incorrectly on Mac. The alpha transparencies render as black.

I’m having the same issue now.

I created the linked FBX below and imported it on a PC and on a Mac. Transparencies appear correctly on the PC. They do not show on the Mac. They are black.

https://drive.google.com/open?id=0B6o7Mi2AKJ1PZUcyaEtoUEx4Rlk

There are a number of other bugs with the latest Mac version of Interface, as well, such as the tabs on the edit panel not working.


#17

= need PBR albedo texture (which contains the alpha/transparency) , you can create an alpha channel on a .png in photoshop for a quick approach.


#18

Transparent PNG texture but still need albedo?

I’m confused as to why the model renders correctly on PC but not Mac.

I see the same problem with transparent textures on models on The Mac version of Interface, but I do not see the problem in the PC version. I think I will move my workflow to PC.

I need to up my PBR chops. Until this week, PBR meant Pabst Blue Ribbon.


#19

Almost correct. but texture painting you do after baking. When ready with painting you save that uv texture with everything painted on it. That you apply to the object.


#20

@Richardus.Raymaker, thanks for the clarification.

That’s another approach that I tried, but, again, the limitation of texture size continues to be a problem.

It seems that given the limitations of HiFi, particularly only being able to use one UV map, I am going to have to separate the mesh and apply textures accordingly… unless I can come up with some clever work-around. Any ideas are much appreciated!

Thanks.