Game Development Community

Painting Terrain Textures

by Jeremy Noetzelman · in Torque Game Engine · 10/03/2001 (11:00 pm) · 8 replies

Is it possible to paint textures onto terrain, instead of applying them in the Terraformer?

I played around with the 'set material' button, but couldn't seem to manage to get a texture applied, nor does anything show up in the 'Texture Group Selection' dialog box.

What am I missing?

#1
10/04/2001 (2:31 am)
There's a broken path in the terrain editor that causes the materials not to work (as you can see in the material selector).

Also when you do paint it, it doesnt really work. I'm going to fix this when I get finished with my stuff at work.

Phil.
#2
10/04/2001 (4:08 am)
Also a "Place texture by bitmap" feature would be very nice. I know a lot of people would really appreciate this. So if anyone could make this feature it would be cool.

It can't be that hard to make since we already have the "Heightmap by bitmap" feature.

// Clocks out.
#3
10/18/2001 (8:04 am)
I was playing with this a while back, it does basically work, but there a few issues as Phil has pointed out. The material selector dialog broke when we removed all the hard-coded paths, so that needs to be changed to get the terrain directory textures from somewhere. This is all script code, so it shouldn't be too hard to figure out. The other is the refresh on the terrain after the material is applied, this is code I'm not all that familiar with.

This problem is on our task list, but I'm not sure when we'll get to it, both Mark and Rick are going to be a way for the next 10 days.
#4
11/06/2001 (4:17 pm)
Okay, here's my fixed material selector dialog:

www.clonk.de/torque/TerrainEditorTxSelectGui.gui

This alone doesn't fix the painting problem yet, though. I searched around in the code and found that TerrainEditor::setGridMaterialGroup forwards to TerrainBlock::setBaseMaterial (on the client terrain block) which is completely empty. I even tried
mBaseMaterialMap[(x & BlockMask) + ((y & BlockMask) << BlockShift)] = matGroup;
in there but that's not it, either. There's still going to have to be some update/texture rebuild and I still didn't understand the way the renderer goes about blending different materials from grid to grid.
#5
11/06/2001 (8:58 pm)
Mark's working on the mission editor now, he may be taking a look at this. Hopefully he'll post something...
#6
11/07/2001 (3:35 am)
Sorry Ive not had time to get round to it yet. Shipping game just ate my time up for now.

If Mark doesnt get to this, I should be free in a week or two, and this is high on my list.

Phil.
#7
11/11/2001 (12:11 am)
Search around, either here or in the private forums.

I remember a while back something about this, there was some code someone posted to get it working. The only problem was that it looks really screwed up, and it didn't blend with the tiles around it.


Dark
#8
11/12/2001 (12:12 pm)
Check my post here:

http://www.garagegames.com/index.php?sec=mg&mod=forums&page=result.thread&qt=1654