Texture Stencils

Hey, I found something on the apricot blog that interested me, Texture Splatting using GLSL in the BGE. It looked very nice, so I decided to check it out. I made a simple plane with a few textures put on with the stencil set up and everything, and it looks good in the 3d window and the render, but the UVMaps go a little loopy in the GE. Run on an Apricot Version.

Here is the tutorial,
Here is the blendfile.
Screenshots below.

Thanks in advance,
~The Red Hand.

Attachments



looks cool… I like the way the grass goes between the paving. What build are you using? Have you tried using a newer build to see if the problem has been fixed?

I wander if we can use them stencils with normal maps? Now that would be cool… an interesting… :wink: you could then use the same mask/stencil to mix the bumps from the stones with the grass…

Yes. You can do it with normal maps. I’ve tried. It’s pretty awesome - well, in the render window. I’m running the newest build I can find. I’m pretty sure it has something to do with the way I’m setting it up, but maybe not.

EDIT: Here, to prove it… (Render - but when bug is fixed, same can be done in the GE)


Looks awesome, I could never figure it out.

well you can get the newest ones from here… usually…

http://www.zoo-logique.org/3D.Blender/index.php3?zoo=com

just look for the link that says apricot… they are windoze builds tho…

Hi!

its only working with two textures? It would be nice if it were possible to mix more textures together…

You probably can, but it would require more stencil maps, and more textures. This was just a test to demonstrate my problem.
@Kirado: Yes, I do believe that the build I have was aquired from Zoo-logique. I’ll check later to make sure I have the latest. They come out so often that it’s often a drag to constantly have to upgrade.

They come out so often that it’s often a drag to constantly have to upgrade.
lol… that’s for sure…

Edit
… just tested with the second newest version I get the same result… I suggest submitting it to the bug tracker?

Obviously a multiple UV set bug…

Yes looks like a bug

Seems to work if the uv coords don’t go beyond 0 and 1?

Are you using node stencils?

I found if you have 2 materials put together each with a different UVlayer for the first texture slot it works, though I never went beyond layer one.

@Cyborg Dragon: No, they aren’t node stencils, and they use 1 material.

I provided a .blend… :eek:

I can’t get it to work with the “x repeat, y repeat” feature. It is hard to make a full map like this without that. I’m using this build:

Okay, so I was dinking around with this and so far it is… amazing, to say the least. I want to use tileable grass, dirt, and stone textures in combination with the stencils. So I made 2 different UV’s, one for stencils, one for tileable textures and assigned them accordingly. Everything looks peachy in the viewport, but when I press P, the stencils are using the wrong UV. Why?! I have it set in the materials… under Map Input, “UV” then assigned it the stencils UVs. Here is a screenshot:


left = viewport
right = in-game

anyone know how to fix this?

That tutorial is awesome btw. Thanks for sharing it with us!

it’s must be a bug… someone stick it on the the bug tracker pls. :wink: or are you UV’s going out of the 0-1 range as well? But the thing is… people would use the having a texture going out of the 0-1 range to tile the texture larger or smaller.

Rozzy, this isn’t a tutorial. I’m having the same problem you’re having. I’m trying to find out how to fix it… :wink:

Okay. So this is a definite bug. Thnx guys.

Grrr… this sucks. I can’t make any levels for my game until this gets fixed…

Just wanna make sure, someone allready put this on the bugtracker, right?

well you can make it a node material and adjust the tiling in the nodes… and not the UV’s… makes it a bit harder tho… might be able to adjust the size in the standard materials… etc.

Well, I’m trying to go simple and not use nodes - they slow down blender by a bit. I’m doing the texture stencils with none of the other GLSL-only features such as the per-pixel shading, Shaders, Ramps, Nodes, and the others. Just the extra textures.

So does it work when you adjust the scale under the materials tabs… instead of scaling the UV’s?