Texture on a textured terrain
Blitz3D Forums/Blitz3D Beginners Area/Texture on a textured terrain
| ||
mmm... i want to place a texture on a textured terrain... like a circle to indicate what unit i have selected... how can I? |
| ||
You mean like a sprite? I don't understand i think |
| ||
Yes, now i'm sure. You have to make a sprite. Well, maybe there's another possibillity. I'm also not to good in blitzbasic |
| ||
Here it is an example: ![]() As you can see under the main character there is a circle that is not a sprite... |
| ||
Yes, i understand. I'm german so I've problems with the speech. I would make it with a sprite. And if u want to put screenshots in the forum, just copy the url in your post, without any "[img]" |
| ||
yeah sorry for the image :D |
| ||
After EntityTexture you can put a "index" parameter, that indicates which level of the entity is textured. So you could apply the new texture using EntityTexture Terrain, texture2, 0, 1. If you want to move it, try using PositionTexture. |
| ||
yeah but the texture is repeated for the whole extension of the terrain! i don't want that! |
| ||
Then, use ScaleTexture texture, TerrainSize(terrain), TerrainSize(terrain) |
| ||
it's the same! the only difference is that the pieces of textures are smaller! |
| ||
Ah, so that is going into the right direction, then! Maybe try entering values yourselve, ie. ScaleTexture texture, 1024, 1024 And there is a EntityFX that is used for "clamping". You can disable repeating the texture on the sides of a mesh. Not sure about terrains though. |
| ||
can't find the entityfx command you are talking about... fx - 0: nothing (default) 1: full-bright 2: use vertex colors instead of brush color 4: flatshaded 8: disable fog 16: disable backface culling 32: force alpha-blending there is nothing for clamping... |
| ||
Yes, you are right. The right command is TextureFilter. (edit)However I tried it and it does not work. Here is an example of what I mean: !note!edited |
| ||
oh ok thnx |
| ||
I tweaked the example a bit and it seems that the best way to go for a clamping version, is using a big texture for the circle (terrainsize*3) and then scaling it up so only 1/3rd of the entire texture is shown. Finally, use PositionTexture to move it. That way, even when the circle crosses the edge of the terrain, the repetition of the circle on the other side still remains outside of the visible area. So then it doesn't repeat in sight. (edit)OR: take 4 points. Read the TerrainHeight from their position and place them on top of the terrain. Then, move a quad to match these 4 points. This method is faster, but less precise. The more points the quad has, the better it 'fits' on the terrain. |
| ||
I sprite would probably be alot easier to do :) |
| ||
That is right. And considering that a character is above the terrain all the time, simply parenting the sprite to the object might work. I guess every method has it's disadvantages. Using a sprite doesn't allow for moving the vertices up and down separately. Using EntityOrder causes the terrain to be rendered below any characters. The multitexture solution works, but it takes far more memory than needed. And using a quad (preferrably with multiple subdivisions) will also need some tweaking to get it right, because the distance between the vertices should somehow match the vertices of the terrain. Otherwise some parts of the quad will still end up under the terrain. |
| ||
I think i will use a sprite... |
| ||
:) |