Texture on surfaces

Does anyone know how to make textures stick to say something like the ground but to make them stick and match the surface it touches.

The best way I can think of explaining this is say a texture is put on a small hill and it matches… like putting a Sticker on the side of the wall if im being clear.

you would need to know what texture was on the face it was on, and use the uv cords I think, but someone who knows more will undoubtedly be along soon.

If you mean placing a decal, the BGE doesn’t support this kind of effect, at least not one that is purely shader based.

The way to do it would be to create a planar object (with a texture using an alpha map), and projecting and aligning it to the ground when a weapon is fired.

Hi! I’m not sure I understood the question but if you want to project a plane on a surface an align it according to the surface normal, you can take a look here: http://jordansautron.wix.com/infomaniac#!logic-editor (bullet script - FPS script video (in french sorry but I think it’s easily understandable)). It uses a raycast, and finds a hit point and a hit normal to correctly align the projected plane along the surface… Sorry if I misanterstood the question

No that wasn’t what I was looking for but thank you anyway.

You should therefore supply an example that clearly demonstrates what you are looking for. Better you do this that relying on everyone else having to use their mind reading powers

Il put this aside for now its a bit difficult to explain but thanks guys

Il try to explain it much easier

Pretend the box art of the games are the texture and the Plane, Terrain etc… is the box now the image is placed on the image flat but it has a curved area “Or the spine” and it folded along.

That’s kind of what I ment by Sticker you can stick a sticker to the side of your computer and be on the front and side.

Pretend the Lava is a texture and the mountain is the terrain or surface.

Attachments


Also sorry for the attachment on my last post I have no Idea how I did that.

you can use a second uv layer overlay,

but I don’t know if you can adjust that in game

The small handful of functions that the BGE gives you for adjusting UVmaps in realtime means that it won’t be easy to actually create effects like a lava texture advancing across a landscape.

There is also the bge.texture API, but I’m not sure if that too can do much if you want to say, do anything more than applying a filter or something to an existing image texture. The only way where you can for sure have control is to dive into the use of custom GLSL scripts, and doing that is a bit more difficult than simply using Python.