Texuring a Pathway

Blitz3D Forums/Blitz3D Programming/Texuring a Pathway

Whats My Face(Posted 2010) [#1]
How would one go about blending grass texture and pathway texture on one surface to create a pathway. I didn't see anything in a quick search of the site although most of what I got was path finding code. If you know of any topics that have gone over this a link would be appreciated.


Ross C(Posted 2010) [#2]
Your probably looking to use vertex alpha, I'd imagine that would be the easiest?


scribbla(Posted 2010) [#3]
ive been pondering this myself
i spend more time running around games looking at textures than playing the damn things,

the only way i can think of doing it is to have a 2048 image and paint what you want where you want instead of tiling it,
its a good question and i dont the answer


puki(Posted 2010) [#4]
You can construct a path internally via the AddVertex/AddTriangle route. I build them separate (ie the path texture is one mesh and the grass is a second) then crossblend them with EntityBlend. I've never used VertexAlpha as "Ross C" has suggested, but I suppose it is an alternative - I use EntityAlpha and EntityFX.

You'll end up with something like this:
http://www.blitzbasic.com/Community/posts.php?topic=72643


Kryzon(Posted 2010) [#5]
I would advise against using 2 different surfaces for two reasons:

1) It's slower than using only 1 surface.
2) There will be flickering issues when the camera is far-away.


the only way i can think of doing it is to have a 2048 image and paint what you want where you want instead of tiling it,
its a good question and i dont the answer

That in fact is the best approach, which is named Texture Splatting.
It relies on 2 or more color maps (1 for the grass and the other for the gravel\road, for example), and 1 or more "mask" textures that have only their Alpha Channels read.

By using some specific blending modes from Direct3D 7, you can bind the alpha channel from that invisible "mask" texture to a road texture, making the road texture appear only in the parts you want. This increases the texture-swap amount, but has the benefit of only using 1 surface. These blending modes are not included in the current release of Blitz3D.

How to do it in Blitz3D?
- You can use the FastEXT library, which allows you to use these new alpha-channel-binding blend modes.
- You could also try Seyhajin's Texture Splatting DLL (but his sales system is somewhat dead, so that could be a bit harder- perhaps sending him an e-mail?).
- You could also try and manually hack the Blitz3D runtime in a way that I have no idea how (basically, do the same thing that FastEXT does).


Oiduts Studios(Posted 2010) [#6]
I highly recommend using the Fast extension lib like Kryzon said.


scribbla(Posted 2010) [#7]
Texture Splatting

i like the sound of that

i was thinking 1 surface 1 texture & paint the whole thing instead of textures for grass, rubble, roads & so on

take for instance modern warfare 2 , grass, mud, rubble, roads, paths all over the ground you couldnt tile that & blend it & way too many surfaces i think

interesting subject


puki(Posted 2010) [#8]
I don't get flickering (or even seams) because mine are next to each other as opposed to overlapping. I use mine on a tile basis so they are not too slow. I suppose my way is more for creating a total landscape rather than an individual road.


Rroff(Posted 2010) [#9]
The MW2 method is the best - but they do use patch meshes (nurbs) - you can do a similiar job with regular sub-divided planes but you do have to make sure that overlapping areas are not fully opaque or you get z-fighting at a distance.

Using one massive alpha texture for paths, etc. works well for small levels but for large terrains does limit you quite a bit unless you setup some fancy megatexture style streaming.


jfk EO-11110(Posted 2010) [#10]
I'd also mention that Fastlib reduces the compatibility, for instance it doesn't work on the notebook I am using right now.

When I had to add some simple paths some time ago, I simply used some stretched quads and applied a texture to it that as alpa-fade-away edges on the left and right side, and some tex-scale-repetitions on the long side.

On this screenie you may see it, sorry, this is the only one with a part of the bespoken path.



scribbla(Posted 2010) [#11]
ok figured out how to use modo to generate an alpha in real time (wow that was a hard day modo is not the best tool for this)

i think i will try blender after seeing some on the vids

also bought fastext thanks Kryzon for linky , i will have to figure out how to use it, i aint no good with code

result in realtime modo viewport
1 surface, 3 tiles, 2 alpha






Leon Drake(Posted 2010) [#12]
Blitz3d already supports DDS.. to bad there wasn't a built in way to just load a .fx file