• Welcome to Twisted DIRT Forums.
 

News:

MX vs ATV Reflex PC Multi-Player back on line 10/8/2013.  Get Racing.

Main Menu

Disp Map Gaps

Started by yzmxer608, May 02, 2009, 04:25:52 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

yzmxer608

I've been working on a track and have had some problems with the disp map.  It seems like I'm getting small gaps in places in game, here is a screenshot:
It is a 6x2 multi-tile track (I also have had this problem using dillo HD method).  The UE2 terrain info is: Grid Scale-1 Max. Elevation-50.  I'm guessing it's because of the small scale and higher height values?  I've tried with pov-ray tga's and it still does the same thing.

mcm2boys

Looks like mis match between the DispMaps used in adjacent tiles. UE2 has an weld function which could fix it for you in the final version, but it's probably better to get the disp maps to match because the weld function only fixes the visible part of the terrain.

I would guess you haven't used a 1 pixel overlap all round when you sliced the full dispmap into tiles..

yzmxer608

This happens throughout the whole map though, not just at the tile edges.  The weld only welds the tile seams together though, not gaps in the middle right?  For the 1 pixel overlap, I used a 769x513 disp map and exported (changed canvas size) all 6 tiles at 270x270.

mcm2boys

Ok a couple of things spring to mind. First gaps all over the map sounds like UE2 is compiling the TRN file and it's not using the TRN imported from the .TILE file which is basically a TRN compiled by the RBW editor. This happens if you import the DispMap directly into UE2 instead of a TRN/TILE file. It is only a visual issue, the physics seem to work ok in game even with the gaps. You can use UE2 to build the TRN (with the gaps) by importing DispMaps while you develop and test the terrain, and then once you are happy with the terrain use the whole final build routine below..

1) compile in the RBW editor,
2) import TRN into UE2,
3) export the TILE from UE2
4) and finally use UE2 to build the HD TRN by importing all the .TILEs

This makes the HD process a little quicker than doing the above for every change in the DispMap.

Another possible cause for gaps is not removing smoothing when importing the DispMap into UE (RBW Editor) or Dillo. This will cause the edges to be smoothed away from their original values, so when the tiles are stitched back together errors have crept in at the point of overlap.


Secondly..
For the tile sizes you have the numbes a little off, the total DispMap size for all the tiles is calculated for each direction (width and height) using: (NumberOfTiles x 256) + 1 

So you got that bit right, but to slice the whole into individual tiles you need a tile size of 257 x 257 (not sure why you used 270). The top and left edge start at pixels (NumberOfTiles x 256)+1, so in your case that would be:


where the numbers represent (left, top, right bottom) pixel counts starting at (0,0) not (1,1)


(0,0,257,257)(257,0,513,257)(513,0,769,257)
(0,257,257,513)(257,257,513,513)(513,257,769,513)

Hope that helps.

yzmxer608

What I did was make a RBW editor file for each tile (new national, scale 4, left the stitch regions at 8 (the default), height 40, imported disp, then saved and exported a pak file). After that I made a blank RBW editor file (same constraints as the rest of the tiles, just didn't import a disp map).  Then I opened UE2 and one by one opened up each RBW file along with the pak file and exported the main tile.  After I did this for all 6 RBW files, I opened the blank track and imported each tile.  I then tested in game and changed the track scale and terrain height to my liking.

I am not sure why I said I use 270x270, I indeed used 257x257 (I have made a PS action to export the tiles for me).

I have never just imported the trn file by itself, I think I'll try that and see how it works out.  What do you mean by smoothing though, is that the stitch regions?

Thanks for all of the help so far, I really appreciate it.

mcm2boys

The smoothing was an option in Dillo, not sure if the same thing exists in RBW editor, I assumed it did, but this will only affect the gaps around the edge of the tile. The gaps in the middle are caused, from what i can tell from what you just said, by changing the terrain height in UE2. This will cause UE2 to generate a new TRN which will cause the gaps throughout the Disp. I would suggest now you have found a scale and height that works that you go back remake the TRNs at the right height/scale and re-import to UE2 so you don't need t adjust the height in UE2.

If you have the tile slicing dimensions right then it will be the height that caused your problems.

QuoteThanks for all of the help so far, I really appreciate it.
Your welcome.. :)

Garasaki

The disp map tears are, as Laurie described, a result of loading the disp directly into UE2. 

Laurie described a good approach, where you live with the tears until your disp testing is done, then go thru the rigamorole of creating all the tiles in the MvA editor just once at the end.

yzmxer608

Ah ok, I get it now, will just have to figure out the height I want in the RBW editor.  One more question, do you know how the MvA height units compare to 3ds max height units?  I've been wondering about this so I could render object shadows in 3ds max, but not sure if the height works the same for both programs.  Again, thanks for your help both of you :).

mcm2boys

I believe the units are 1 to 1, and each unit is 1ft.

I remember the RBW editors scaling to be not directly (or maybe obviously) linked to the actual height grid scaling, but if you load the track into UE2 then the Terrain tab gives the Height and grid scale in feet.

yzmxer608

Ok, when I import the disp into max, I will try using the disp res and height from UE2.  Thanks again :).