Texture splatting + vertex alpha problem

Blitz3D Forums/Blitz3D Programming/Texture splatting + vertex alpha problem

Pinete(Posted 2007) [#1]
Hi all,

I'm working with the code of RifRaf, F.L.E, the free landscape editor that can be found in the code archives, at terrain editors.

It seems to be very clear to me except the part in which the
resultant model is saved to a B3D.

Basically it follows the standard way to do texture splatting, but when it save the models, save two models.
The first one is a model with the basic texture (no vertex alpha), and the second one is a model with the other textures and vertex alpha information (2+32).

My question is how could I save just one model that could contains all the information...

At the header of the source, rifraf says this could be possible using addmesh, but I've been working on it making a lot of attempts of "addition" with this command but the exported terrain always is crap (I cannot see all the textures, sometimes I cannot see nothing, another ones I just can see the first texture...)

I would like to know the way in which I could merge
two models and save a unique B3D with all the vertex alpha information to be displayed as I can see it from the editor of RifRaf.

Please someone could says me how could I save just one model??!!!


Thanks in advance!


D4NM4N(Posted 2007) [#2]
do you mean 2 child meshes or 2 separate files, when using vetex alpha you need the extra geometry either as an extra surface or as a separate mesh. The underlying layer cannot be alpha blended and must use just the 2 flag.

addmesh should add a separate surface but when painting it (or if trying to read write from b3d) you need to set the surfaces brushFX to:

layer0:1+2
layer1:1+2+32
layer2:1+2+32
layer3:1+2+32


my ted prog uses internally multisurface meshes but xports both methods, and i seem to remeber when writing to a b3d you need to reverse their order in the file.


Pinete(Posted 2007) [#3]
Thanks a lot for the explanation...
I will go for it
:)

regards!


Mattizzle(Posted 2007) [#4]
So did it work?


jfk EO-11110(Posted 2007) [#5]
Basicly, this Save Routine wasn't by RifRaf, but by me. The idea is: If you save it as two meshes, you will have to check for collision only on the bottom mesh (grass by default). Additionally, this will prevent z-order issues of the upper layers due to the use of alpha.

The save routine will also optimize Saving of the 2nd mesh, a triangle will only be saved if at least one of its 3 vertices is not fully transparent (VertexAlpha=0).

I prefere this method, but as I said in the source, you may use AddMesh to make only one mesh out of them, something like:

mesh=createmesh()
addmesh mesh, layer0mesh
addmesh mesh, layer1mesh

then save mesh using the save method for layer 1 to 7 (the optimized one).

You may however have to use PositionMesh to offset one of the two slightly on the Y axis, to prevent Z (or Y)-fighting due to rounding errors.


Pinete(Posted 2007) [#6]
Hi!,

Mattizzle: I was trying to make this by myself but at the end, I quited. I was working on my own terrain editor from the FLE code, available at the forums and in the code archives...
First problem was the alpha order problems with the different layers... really I had not patience enough and I started buying all the tools I saw related with terrain generation.
I bought Freeworld3D, T.ED and Panorama.
Freeworld3D need some extra work in order to see your maps in Blitz, in fact, I didn't obtain any success with it.
T.ED is the most complete and works really fine, a lot of options and features but the interface is a nightmare and working with it is horrible, a real headhache. Really a shame because the tool is great.
At the end, Panorama is absolutely fast and lovely to work with, but it has an important lack of features.
In order to lightmap the scene with a external lightmapper (I use gile[s]), T.ED worked at the first time, but I needed
help of Fredborg with Panorama, because it's necessary to configure some options of gile[s] in order to run properly a lightmapped scenario of panorama in Blitz.

Now my pipeline is: Panorama to make a terrain (fast), gile[s] to lightmap, drop objects and finally export to B3D.

jfk: ey man, you're a megablitzer!! ;)

Regards!


jfk EO-11110(Posted 2007) [#7]
I just wanted to make clear FLE was an open source project, the alpha splatting part was done by RifRaf, the exporter by me.


RifRaf(Posted 2007) [#8]
Depending on what version of fle is floatig around these days,JFK could be mistaken.

JFK started an exporter. The optimizelayer routines as well as nesting nodes so that you do not get the phase shifting alpha bleeding were modifications and additions by myself.

The model exporting I use today for terrains of different styles is a new thing entirely, and ive come to know the B3D format back to front, You can always shoot me an email if you like to

GameMaker04@...


jfk EO-11110(Posted 2007) [#9]
I didn't mean to steal your creadits. tho not sure of the optimize layer thing. At least I'd do it exactly the same way. He was however using the version with my exporter. later open source versions kind of disappeared due to your deal with idigicon if I'm right, that's absolutely ok to me.


D4NM4N(Posted 2007) [#10]
Hi pinete,

Im in the process of developing ted6, can you email me telling me what you would like improving, and i will try and accomodate.
Alternatively chuck it on the forum www.d-grafix.com/?page=forum

Thanks :)


Pinete(Posted 2007) [#11]
Hi Dan!
thank you very much!
I will do it!! :)

best regards!