Extrapolate texture?

Blitz3D Forums/Blitz3D Beginners Area/Extrapolate texture?

Azaratur(Posted 2008) [#1]
I created my own mesh (terrain) and textured it but i need to blend some texture and i am not able with the program.. There is a way to operate from the code?

Aza


puki(Posted 2008) [#2]
Yes there is.


Azaratur(Posted 2008) [#3]
... Thanks
Aza


Ross C(Posted 2008) [#4]
You can indeed. Make use of entitytexture using the optional index parameter. Then use scale texture and positiontexture, to get it in the right place. Unfortunely, it's harder than using vertex alpha...


Azaratur(Posted 2008) [#5]
I don't really need to blend i can use alpha vertex too...
But how? There is some tutorial?
I'll search for it..
If you want can you explain it to me?
Aza


Ross C(Posted 2008) [#6]
It's not easy just doing it via code. There are alot of editor out there that will do this to a heightmap generated mesh. ALE, FLE are a few example.

But, if you want to know the basics of it, you need to create x number of copies of the mesh.

Each of these will be surfaces within the mesh. So, say you have 4 different textures you need to blend, you would have 4 surfaces on the same mesh. Each of these IDENTICAL. The only difference are:

The texture applied to the surface. You can texture surfaces differently using the paint surface command. For each surface you will need a brush.

And you will need to give each brush it's own texture. The only differences between each of these surfaces is the vertex alpha If you don't want an area of the texture/surface to show, you make the vertex alpha of the particular vertex you want hidden, 0. Anywhere inbetween will give varying alpha. Be careful of alpha though. It sometimes cause z buffer issues, with other alphaed meshes appearing out of drawing order.

I think that's really it :o)

So:

MESH
Surface 1 - mud texture
Surface 2 - grass texture
Surface 3 - road texture

you would obviously make the base layer the layer that will be used the most, as everything blends down to it.


Azaratur(Posted 2008) [#7]
I understand, and it's really near what i thinked..
How can i "clone" some surface, or better how can i find the right surface and clone it?
If you have a tutorial or an old code i will study it by myself..

Aza


Ross C(Posted 2008) [#8]
I'm afraid i don't have any old code. You need to have the mesh that has your landscape. This is the mesh you would clone in your surfaces.

To clone a surface, you simple copy all the vertices and tris across. You will need to manually recreate the tris though.


Azaratur(Posted 2008) [#9]
But in this way i use the double of the poly.. Can i clone only the faces i need?
I don't find FLE or ALE in google. Can you give me a long name or better a link :)
Aza


Ross C(Posted 2008) [#10]
I'm afraid that's the way it works, You can optimise the mesh afterwards, deleting any vertices that have neighbours all with 0 alpha.


Ross C(Posted 2008) [#11]
ALE
---
http://www.dyvision.co.uk/ale.htm

FLE
---
http://www.melog.ch/dl/fle_rr4.zip
BETA link there, be it should still be functional.

Another link: (should be the most recent)
http://www.moondoggieent.com/downloads/fle.zip

TED
---
www.d-grafix.com/softwareted.html


Azaratur(Posted 2008) [#12]
I copied all the vertices but know i have a problem.. I create a mesh with a 3d editor, than i don't know how connect the vertex to create triangles..
There is a way or i must give up?

Second question i try the blending way too, i get the right surface and i used the brush to blend the 2 textures but they change color (i use a grey rock and a green grass, and they become dark green), and that's is not good i don't have any screenshot to show you, and no code for today.
Do you think i wrong using brush?

Aza


Moraldi(Posted 2008) [#13]
Yes there is.

Is this a joke? If yes you need to check your humor again


Ross C(Posted 2008) [#14]
You need to change the texture blend i reckon.

And you can find out which tris are connected to vertices in blitz i'm sure.

TriangleVertex ( surface,triangle_index,corner )

Is the command that you should use, whilst copying, to get which vertices make up a triangle :o)

Or, just use the apps i listed.


Azaratur(Posted 2008) [#15]
... I want do it by myself :p
Thanks for the help.

For the blending you mean blend mode? I need to change blend mode?
I tried every blend mode but nothing work..

Aza


Ross C(Posted 2008) [#16]
The textureblendmode. Or show a screenie?


Azaratur(Posted 2008) [#17]
Tomorrow i'll show you.

I have some problem with vertex alpha:
I copy the surface (vertex position , normal, color and alpha too)
I paint the surface with 2 texture, and bring the vertex alpha to 0.3 of the first texture.

When i use entityfx 32 (force alpha blending) my mesh become in some part "invisible".. Did i wrong something? If you need the code say to me..

Aza


Ross C(Posted 2008) [#18]
It sounds like your alpha blend the bottom layer. The bottom layer should be completely solid. When copying the surfaces, DON'T copy the alpha across. That's the thing that different about each surface and why your using multiple surfaces in the first place :O)


Azaratur(Posted 2008) [#19]
mmm i copy it BEFORE set the alpha value.
And after the alpha declaration i reset all the vertex of the original mesh at aplha 1.
Need i to get a little bit down the surface i created?
I just copy in the same position..
Sorry is the first time i do it!

Aza


Ross C(Posted 2008) [#20]
I've never actually coded this btw. I'm going by theory and what i know happens with surfaces and such :o) I'm waiting on someone who's coded this before to come along :D


Azaratur(Posted 2008) [#21]
Maybe is better that i create another post..
I don't think everybody will enter in extrapolate texture!
Aza