Jump to content


Photo

Damn terrain bleed!!


  • Please log in to reply
40 replies to this topic

#1 slewin

slewin

    Advanced Member

  • Members
  • PipPipPip
  • 400 posts

Posted 31 March 2019 - 09:30 AM

After 3 years I’ve had enough of the Unity terrain popping through bunker splines and I am now getting desperate. My current crazy idea would involve modifying the terrain shader to make areas transparent. This would mean changing the shader code with examples on the web and trail and error.
Have any power users tried this?
Would it work in game?

#2 DPRoberts

DPRoberts

    Advanced Member

  • Members
  • PipPipPip
  • 1,610 posts

Posted 31 March 2019 - 11:35 AM

If you are using overlay method, you may want to chat with DropZone 73. For his experiment with 4 holes on Pebble he turned off the drawing of the terrain in the terrain settings. Because the entire course is meshed, the terrain isn't necessary.

The only thing he didn't clarify is how he handles the second peripheral terrain. I imagine it is lowered in the area of your splines and then appears normal in the periphery.

#3 Mike Jones

Mike Jones

    Advanced Member

  • Administrators
  • 6,159 posts

Posted 31 March 2019 - 01:44 PM

After 3 years I’ve had enough of the Unity terrain popping through bunker splines and I am now getting desperate. My current crazy idea would involve modifying the terrain shader to make areas transparent. This would mean changing the shader code with examples on the web and trail and error.
Have any power users tried this?
Would it work in game?

 

Either use a smaller pixel error on your terrain or manually lower the terrain when all the course meshes have been completed. Make sure you make a backup heightmap first though in case you need to make alterations in the terrain later. You can also use a different layer offset under the 'P' menu in CF where by default it is set to 1.5. You can try 1.7.


  • SebGOLO likes this

#4 DPRoberts

DPRoberts

    Advanced Member

  • Members
  • PipPipPip
  • 1,610 posts

Posted 31 March 2019 - 03:30 PM

...You can also use a different layer offset under the 'P' menu in CF where by default it is set to 1.5. You can try 1.7.


0.15 or 0.17 is likely what Mike means

#5 slewin

slewin

    Advanced Member

  • Members
  • PipPipPip
  • 400 posts

Posted 31 March 2019 - 05:53 PM

Hi guys,
Thanks for your responses.
DP in regards to turning off the terrain won’t this also turn off the planting?
We are in the middle of development of Royal Melbourne which as you know has deep bunkers cut right into greens and manually lowering will cause issues with the green spline.
If we were to lower the entire terrain it would need to be drastic and as such all low planting would disappear.
I’m kind of stuck ATM.

#6 Justin9926

Justin9926

    Advanced Member

  • Members
  • PipPipPip
  • 760 posts

Posted 31 March 2019 - 06:01 PM

On Gulph Mills that I'am working on right now I've been turning the draw off the first terrain like dropzone has mentioned.The first terrain is 1500 x 1500 4097 Raw height map. I didn't need the terrain to be any bigger so my second terrain I just changed the resolution to 512. With my whole course being covered by mesh I just went ahead and lowered the second terrain throughout the whole course being careful when I got out to the outer edge so I wouldn't leave any big gaps. Which really wouldn't matter anyhow beings its way off the course and out of bounds. By doing this I gain some on the frame rate. Also the overhead map in game is crystal clear throughout.


Asus ROG G751JT-CH71 Gaming Laptop

2.5 GHz Intel Core i7– 4710HQ

Nvidia GTX 970M 3GB GDDR5

16 GB DDR3

Windows 10 64-bit


#7 Justin9926

Justin9926

    Advanced Member

  • Members
  • PipPipPip
  • 760 posts

Posted 31 March 2019 - 06:03 PM

Your grass will still be there. 


Asus ROG G751JT-CH71 Gaming Laptop

2.5 GHz Intel Core i7– 4710HQ

Nvidia GTX 970M 3GB GDDR5

16 GB DDR3

Windows 10 64-bit


#8 slewin

slewin

    Advanced Member

  • Members
  • PipPipPip
  • 400 posts

Posted 31 March 2019 - 06:12 PM

Ok
So if I copy my original terrain I could then lower the copied terrain around greens etc.. and it won’t affect the green spline?

#9 Justin9926

Justin9926

    Advanced Member

  • Members
  • PipPipPip
  • 760 posts

Posted 31 March 2019 - 06:18 PM

That I don't know. I'm just referring to if you turn the Draw off the terrain the planting will still show when you build the course


Asus ROG G751JT-CH71 Gaming Laptop

2.5 GHz Intel Core i7– 4710HQ

Nvidia GTX 970M 3GB GDDR5

16 GB DDR3

Windows 10 64-bit


#10 DPRoberts

DPRoberts

    Advanced Member

  • Members
  • PipPipPip
  • 1,610 posts

Posted 31 March 2019 - 06:43 PM

Slewin, turning off "Draw" on the terrain is under the Cog wheel in the inspector for the terrain. It doesn't impact anything other than the visibility of the terrain mesh.

As a second terrain, create a second terrain and name it "outer terrain" or something. You can then import your current heightmap that you are using if you weren't intending to have a second terrain. I would decrease the heightmap resolution on it though to like 512 and then smooth out as Justin suggests.

All your splines should follow your original terrain. The mesh is still there, it is just not being drawn. I believe your green spline will be fine.

The ticking and unticking of the "draw" box for the terrain should not negatively impact your project. And, you should be able to go back if it doesn't prove to do what you want.

#11 DPRoberts

DPRoberts

    Advanced Member

  • Members
  • PipPipPip
  • 1,610 posts

Posted 31 March 2019 - 06:54 PM

For the bunkers, I'm hoping you will be able to use the layers library to cut them deeper. Then, hide the terrain mesh.

My only question will be in areas where the terrain pokes through meshes and you've now made invisible, is it also invisible to the physics or will it "float" on invisible pieces.

I think it will work as I'm fairly certain DropZone did his HD rendition on Pebble this way.

#12 Justin9926

Justin9926

    Advanced Member

  • Members
  • PipPipPip
  • 760 posts

Posted 31 March 2019 - 07:13 PM

If you're terrain is poking through your mesh and old hacker Harry or your ball lands in that area it will be floating. That I do know. In front of my clubhouse on the retaining wall I haven't dug it out for the wall it's just hidden. But if you take hacker Harry over in that area he will be floating in the air. Which that spot of my course is OB anyhow. But I probably will take that out on my final build. I am hoping to get a beta out before next weekend if all goes well this week for Gulph Mills..


Asus ROG G751JT-CH71 Gaming Laptop

2.5 GHz Intel Core i7– 4710HQ

Nvidia GTX 970M 3GB GDDR5

16 GB DDR3

Windows 10 64-bit


#13 DPRoberts

DPRoberts

    Advanced Member

  • Members
  • PipPipPip
  • 1,610 posts

Posted 31 March 2019 - 07:23 PM

Hmm, then that won't work for Slewin's bunker plan...

#14 slewin

slewin

    Advanced Member

  • Members
  • PipPipPip
  • 400 posts

Posted 31 March 2019 - 09:46 PM

My issue is that I am currently creating custom bunkers with 3ds max which requires the original spline to be removed or cut out. Might be best to do a spline cut out so the terrain is lowered. The terrain only pokes through in small areas and should obstruct play too much.

#15 Dropzone73

Dropzone73

    Advanced Member

  • Members
  • PipPipPip
  • 557 posts
  • LocationFinland

Posted 01 April 2019 - 09:00 AM

For the bunkers, I'm hoping you will be able to use the layers library to cut them deeper. Then, hide the terrain mesh.

My only question will be in areas where the terrain pokes through meshes and you've now made invisible, is it also invisible to the physics or will it "float" on invisible pieces.

I think it will work as I'm fairly certain DropZone did his HD rendition on Pebble this way.

I'm not sure what this is all about but DBR is correct concerning what I did with Pebble.

 

I had a little main terrain which I splined fully. Then I realized that no matter how low my pixel error was, it wasn't good enough in the distance because tarrain popped out of cliffs and every steep places. It was also FPS heavy. Then a thought came to my mind, that the terrain would be best to be invisible. And I remembered that there is an option to draw or not to draw terrain. I unchecked the "Draw" checkbox and all my problems were gone. Then I also maxed the terrain's pixel error and minimized that other terrain setting ( I cant remember it's name), just to be sure that terrain wouldn't eat my CPU or GPU powers anymore.

 

Outer terrain? What problem is that? Just make it flat under the main terrain and it will never come to your face anymore. That's all.

 

And let me say. When you only have your mesh "terrain" visible (and of course the outer terrain if you have one), there is only one draw call concerning the course area, and it's so much faster. It will multibly your frame rate!

And the terrain (visible or not) is never over the mesh because pixel error is only a setting on how your terrain is shown in the distance. The real game terrain is and stays under the spline mesh when your ball lands to it.

 

Not drawing a terrain also makes it possible to have your outer terrain in good resolution and it's pixel error in 3-5.



#16 Birdie

Birdie

    Advanced Member

  • Members
  • PipPipPip
  • 456 posts

Posted 01 April 2019 - 10:07 AM

When you're talking about "terrain popping", do you mean these situations when we normally have to smooth the area a little to make the underlying ("popping") terrain bits disappear?
Or am I on the wrong path of understanding?

#17 Mike Jones

Mike Jones

    Advanced Member

  • Administrators
  • 6,159 posts

Posted 01 April 2019 - 02:58 PM

The biggest problem is that when you cover the entire course in meshes the polygon count climbs massively as compared to a terrain/mesh balance. This is because the CF meshes do not LOD at all whereas the Unity terrain has a clever LOD system. 



#18 Justin9926

Justin9926

    Advanced Member

  • Members
  • PipPipPip
  • 760 posts

Posted 01 April 2019 - 04:33 PM

Dropzone73 Is correct that the terrain that sticks about the match

 

I'm not sure what this is all about but DBR is correct concerning what I did with Pebble.

 

I had a little main terrain which I splined fully. Then I realized that no matter how low my pixel error was, it wasn't good enough in the distance because tarrain popped out of cliffs and every steep places. It was also FPS heavy. Then a thought came to my mind, that the terrain would be best to be invisible. And I remembered that there is an option to draw or not to draw terrain. I unchecked the "Draw" checkbox and all my problems were gone. Then I also maxed the terrain's pixel error and minimized that other terrain setting ( I cant remember it's name), just to be sure that terrain wouldn't eat my CPU or GPU powers anymore.

 

Outer terrain? What problem is that? Just make it flat under the main terrain and it will never come to your face anymore. That's all.

 

And let me say. When you only have your mesh "terrain" visible (and of course the outer terrain if you have one), there is only one draw call concerning the course area, and it's so much faster. It will multibly your frame rate!

And the terrain (visible or not) is never over the mesh because pixel error is only a setting on how your terrain is shown in the distance. The real game terrain is and stays under the spline mesh when your ball lands to it.

 

Not drawing a terrain also makes it possible to have your outer terrain in good resolution and it's pixel error in 3-5.

Dropzone73 is correct. I just double checked where my retaining wall has not been dug out and hacker Harry is no longer floating in the air. I could have sworn he was floating above the terrain before. Must've been one of those long days. Sorry about the wrong information.


Asus ROG G751JT-CH71 Gaming Laptop

2.5 GHz Intel Core i7– 4710HQ

Nvidia GTX 970M 3GB GDDR5

16 GB DDR3

Windows 10 64-bit


#19 DPRoberts

DPRoberts

    Advanced Member

  • Members
  • PipPipPip
  • 1,610 posts

Posted 01 April 2019 - 07:12 PM

If that is the case, Slewin, you would be free to build the bunkers to any depth you wanted as long as the outer rim matches the CF spline.

I'm assuming you've consulted with Dr Rob or RobC on getting the bunkers to work correctly.

I think it's an easy experiment to try on a solitary bunker and see what happens.

#20 slewin

slewin

    Advanced Member

  • Members
  • PipPipPip
  • 400 posts

Posted 01 April 2019 - 09:02 PM

Thanks guys,
I have found a solution for replacing the CF spline with a custom mesh.
I can calculate the CF bunker mesh and turn off its mesh Renderer which still forces the terrain to be lowered but makes the bunker invisible.
I’m working in 3ds max and I’m currently exploring Substance designer/painter for creating textures. It’s pretty exciting as it allows me to get the look of sand belt bunkers which is impossible with the CF splines.
Still very early days in the lab....
  • Justin9926 likes this




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users