Author Topic: River Z-fighting  (Read 2602 times)

Offline 715

  • Silver Member
  • ****
  • Posts: 1835
River Z-fighting
« on: July 18, 2018, 07:15:21 PM »
quote: "10. Made change on how Z fighting is dealt with on rivers, roads, and convoys."

On my system (E8400, GTX1060 6GB, Win7, DX9) this wasn't an improvement (see attached jpeg).

[caveat: my terrain's rivers are automatically imported from GSHHG hi-res data which is apparently not hi-res enough to register well with SRTM DEM topography so rivers sometimes travel over non-flat ground.  However, I chose the jpeg as a case where it was over flat ground (a reservoir). ]


Offline bustr

  • Plutonium Member
  • *******
  • Posts: 12436
Re: River Z-fighting
« Reply #1 on: July 18, 2018, 07:49:48 PM »
My rivers I laid freehand do the same thing. I've discovered that the minimum elevation for roads so they don't z-fight with the ground now is 4ft. Before this patch 1ft was ok. I have a few days of raising river bottoms to 4ft and hunting down 1ft gully bottoms dummy roads run across. I fixed one spawn, road, river and bridge area next to a field and it stopped the road z-fighting. I created the river valleys months ago before Hitech released the new path function. So I was expecting to cut tiny rivers by hand. When he surprised us with the new path function, I had all the river bottoms at 1ft waiting to cut rivers. So it was simple to lay in the river path instead.

And if you run a road segment up the berm of a bridge, it will not show up after you mask and build now. I have to delete some number of those. At least you will not have to remember to set a convoy road segment that runs over a bridge to not viewable now.
bustr - POTW 1st Wing


This is like the old joke that voters are harsher to their beer brewer if he has an outage, than their politicians after raising their taxes. Death and taxes are certain but, fun and sex is only now.

Offline hitech

  • Administrator
  • Administrator
  • *****
  • Posts: 12398
      • http://www.hitechcreations.com
Re: River Z-fighting
« Reply #2 on: July 19, 2018, 10:31:53 AM »
quote: "10. Made change on how Z fighting is dealt with on rivers, roads, and convoys."

On my system (E8400, GTX1060 6GB, Win7, DX9) this wasn't an improvement (see attached jpeg).

[caveat: my terrain's rivers are automatically imported from GSHHG hi-res data which is apparently not hi-res enough to register well with SRTM DEM topography so rivers sometimes travel over non-flat ground.  However, I chose the jpeg as a case where it was over flat ground (a reservoir). ]

Is that terrain on the server?

HiTech

Offline hitech

  • Administrator
  • Administrator
  • *****
  • Posts: 12398
      • http://www.hitechcreations.com
Re: River Z-fighting
« Reply #3 on: July 19, 2018, 10:33:44 AM »
My rivers I laid freehand do the same thing. I've discovered that the minimum elevation for roads so they don't z-fight with the ground now is 4ft. Before this patch 1ft was ok. I have a few days of raising river bottoms to 4ft and hunting down 1ft gully bottoms dummy roads run across. I fixed one spawn, road, river and bridge area next to a field and it stopped the road z-fighting. I created the river valleys months ago before Hitech released the new path function. So I was expecting to cut tiny rivers by hand. When he surprised us with the new path function, I had all the river bottoms at 1ft waiting to cut rivers. So it was simple to lay in the river path instead.

And if you run a road segment up the berm of a bridge, it will not show up after you mask and build now. I have to delete some number of those. At least you will not have to remember to set a convoy road segment that runs over a bridge to not viewable now.

Once again PLEASE DO NOT adjust road or train elevations simply to fix z fighting.

HiTech

Offline 715

  • Silver Member
  • ****
  • Posts: 1835
Re: River Z-fighting
« Reply #4 on: July 19, 2018, 05:51:49 PM »
Is that terrain on the server?

HiTech

No. It's just a test terrain.

Offline hitech

  • Administrator
  • Administrator
  • *****
  • Posts: 12398
      • http://www.hitechcreations.com
Re: River Z-fighting
« Reply #5 on: July 20, 2018, 09:37:42 AM »
No. It's just a test terrain.

The terrain under the river should be a flat plane relative to the slope of the river.

Also I found a solution yesterday.
The next release first stencils in with a large z bias then makes a 2nd pass to draw the path with no z bias. This allows me to increase the bias and creating minimal adverser effects like having convoys disappear do to the zbias.

HiTech

HiTech

Offline bustr

  • Plutonium Member
  • *******
  • Posts: 12436
Re: River Z-fighting
« Reply #6 on: July 20, 2018, 01:27:20 PM »
Thank you, after you roll it out and I test it against my archived project version I saved before sending you that link a week ago. I'll present that project version for your approval once again. While inspecting the river mouths I found a few small fat fingers with elevations and fixed them. If both banks of a river at a point are not on the same elevation gradient, the higher bank shows z-fighting that cuts into the river at that location.

My river valleys run at 1ft elevation for the full length of the rivers. This made it simpler to create the illusion of gradually descending elevations for the mountain ridges along with creating the micro combat terrain hills and gully's that ran down to each river valley bottom so tanks could cross bridges. Terrains are illusions, from the air players can only see macro elevation changes like descending ridge lines, and on the ground, a tanker will only know his path to a bridge runs down slope through gully's to get to a bridge. That solves having to worry about the gradient run over miles of terrain with custom terrains.

I bet Artik's program throws a new wrinkle into laying down river paths becasue it uses real world data. I ran into that problem running roads over mountain passes.
bustr - POTW 1st Wing


This is like the old joke that voters are harsher to their beer brewer if he has an outage, than their politicians after raising their taxes. Death and taxes are certain but, fun and sex is only now.

Offline artik

  • Silver Member
  • ****
  • Posts: 1908
      • Blog
Re: River Z-fighting
« Reply #7 on: July 25, 2018, 01:55:48 AM »
I bet Artik's program throws a new wrinkle into laying down river paths becasue it uses real world data. I ran into that problem running roads over mountain passes.

Note, in makeahmap program I set all the water - including lakes and rivers to 0 altitude. Rivers are not objects but rather terrain features. It changes a shape of the terrain but allows transparent handling of water including possibility to bring task groups to lakes or rivers (if the revers wide enough)

Also when I wrote the program rivers had not been implemented in AH3 yet.
Artik, 101 "Red" Squadron, Israel

Offline 715

  • Silver Member
  • ****
  • Posts: 1835
Re: River Z-fighting
« Reply #8 on: July 26, 2018, 11:48:40 PM »
River Z-fighting is much improved on my test terrain with patch 16: almost no Z-fighting except occasionally when bad registration between GSHHG and SRTM DEM datasets has rivers running over non-flat ground.

There are still artifacts from ground level when that happens, i.e. if the river line segment passes over a dip in the terrain the river looks sort of like an aqueduct and you can see the terrain under it.

Note: patch 16 (and patch 15) hang on "Exit Terrain" (or whatever that's called) for my test terrain, as many people have described for the new MA terrain.  My test terrain is 512 miles square and has a LOT of river segments.  I waited many minutes for it to come back, but had to finally Alt-F4.

Offline hitech

  • Administrator
  • Administrator
  • *****
  • Posts: 12398
      • http://www.hitechcreations.com
Re: River Z-fighting
« Reply #9 on: July 27, 2018, 12:05:40 PM »
River Z-fighting is much improved on my test terrain with patch 16: almost no Z-fighting except occasionally when bad registration between GSHHG and SRTM DEM datasets has rivers running over non-flat ground.

There are still artifacts from ground level when that happens, i.e. if the river line segment passes over a dip in the terrain the river looks sort of like an aqueduct and you can see the terrain under it.

Note: patch 16 (and patch 15) hang on "Exit Terrain" (or whatever that's called) for my test terrain, as many people have described for the new MA terrain.  My test terrain is 512 miles square and has a LOT of river segments.  I waited many minutes for it to come back, but had to finally Alt-F4.

715: All rivers should be 20 foot or higher unless merging with the ocean. Between 15 and 0 feet the river is flattened to terrain height to merge smoothly with the ocean. So if any rivers are below 15 feet they will have been flattened causing more z fighting.

HiTech

Offline bustr

  • Plutonium Member
  • *******
  • Posts: 12436
Re: River Z-fighting
« Reply #10 on: July 27, 2018, 12:23:09 PM »
Wish I had known that months ago, I would have made the river valley bottoms 15ft and worked from there. If you had to programmatically raise all of my river bottoms from 1ft to 15ft, it will have destroyed quite a bit of micro terrain I hand cut for tank combat based on 1ft as the valley bottom base level.
bustr - POTW 1st Wing


This is like the old joke that voters are harsher to their beer brewer if he has an outage, than their politicians after raising their taxes. Death and taxes are certain but, fun and sex is only now.

Offline 715

  • Silver Member
  • ****
  • Posts: 1835
Re: River Z-fighting
« Reply #11 on: July 27, 2018, 01:07:32 PM »
You mean 20ft absolute altitude? Or do you mean AGL?  In the object file where is the number setting river segment hight above terrain level?  (All of my test terrain is more than 20ft absolute altitude.)

Offline hitech

  • Administrator
  • Administrator
  • *****
  • Posts: 12398
      • http://www.hitechcreations.com
Re: River Z-fighting
« Reply #12 on: July 27, 2018, 01:39:02 PM »
You mean 20ft absolute altitude? Or do you mean AGL?  In the object file where is the number setting river segment hight above terrain level?  (All of my test terrain is more than 20ft absolute altitude.)

20ft Absolute.  I.E. Terrain height must be 20 or greater.

HiTech

Offline bustr

  • Plutonium Member
  • *******
  • Posts: 12436
Re: River Z-fighting
« Reply #13 on: July 27, 2018, 02:16:04 PM »
Oh well, there is only one field on one river end that the river is above 20ft. It up slopes from 20 throuhg about 200. Any chance after you raise all of my river bottoms to 20ft along with adjusting the bridges and roads that you will allow me to fix the micro gully's that will now be pool table flattened? The near sides of the valley are mostly 20-25ft for the feilds sitting on them and rise up to the ridges past them. I have a texturing technique I developed for this terrain that I can put back some of the tank combat micro gully's that will disappear when you raise the river bottoms to 20ft. I used that 19-24ft for the micro gully's to enhance the GV ground game. It's one of the techniques AH's competition uses for their tank terrain.
bustr - POTW 1st Wing


This is like the old joke that voters are harsher to their beer brewer if he has an outage, than their politicians after raising their taxes. Death and taxes are certain but, fun and sex is only now.

Offline hitech

  • Administrator
  • Administrator
  • *****
  • Posts: 12398
      • http://www.hitechcreations.com
Re: River Z-fighting
« Reply #14 on: July 27, 2018, 02:35:39 PM »
Oh well, there is only one field on one river end that the river is above 20ft. It up slopes from 20 throuhg about 200. Any chance after you raise all of my river bottoms to 20ft along with adjusting the bridges and roads that you will allow me to fix the micro gully's that will now be pool table flattened? The near sides of the valley are mostly 20-25ft for the feilds sitting on them and rise up to the ridges past them. I have a texturing technique I developed for this terrain that I can put back some of the tank combat micro gully's that will disappear when you raise the river bottoms to 20ft. I used that 19-24ft for the micro gully's to enhance the GV ground game. It's one of the techniques AH's competition uses for their tank terrain.
I'll consider it, but care must be taken to not cause z fighting with the river.

HiTech