About Store Forum Documentation Contact



Post Reply 
AO Testing on Terrain
Author Message
aceio76 Offline
Source Licensee

Post: #1
AO Testing on Terrain
Hi Greg,

Here is a quick vid that shows 4 adjacent terrain tiles dynamically created. The heightmap is built with ambient occlusion applied. As you will see, the seam becomes visible with AO enabled on the terrain tile.



Any suggestion on preventing the seam from showing up with AO on?
(This post was last modified: 06-12-2017 03:23 PM by aceio76.)
06-12-2017 03:05 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: AO Testing on Terrain
Can you send me the *.EsenthelProject of that demo and I will check it out.
06-12-2017 07:15 AM
Find all posts by this user Quote this message in a reply
aceio76 Offline
Source Licensee

Post: #3
RE: AO Testing on Terrain
Sure, I've uploaded it.


Attached File(s)
.7z  biivjh_w8ri5xqbmu2uf1szo.7z (Size: 2.58 KB / Downloads: 3)
06-12-2017 05:14 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: AO Testing on Terrain
Thank you, I will investigate this soon.
06-13-2017 12:50 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #5
RE: AO Testing on Terrain
Hi,

The project that you've sent me I think it's different than on the video,
It doesn't have the material or texture included, and no HM_AO was specified
tile.build(tile.mesh, 1, 6, HM_SOFT|HM_BUILD_NULL_MTRL|HM_AO, null, null, null, null, null, null, null, null, &tempmem);
After I specified I can't see the problem as on the video.

However you are passing null everywhere, and probably that's the problem,
You need to pass pointers to all neighbor tiles (Heightmap) instead of null.

Also for simplification of heightmaps, I recommend to use "true" instead of "false" to keep borders, otherwise you may get holes between the meshes.
if(simplify)tile.mesh.simplify (1.f, 0.05f, 1.f, 0.03f, 0.08f, PI, false); // simplify
06-15-2017 02:43 AM
Find all posts by this user Quote this message in a reply
aceio76 Offline
Source Licensee

Post: #6
RE: AO Testing on Terrain
Thanks Greg!

Quote:The project that you've sent me I think it's different than on the video,
It doesn't have the material or texture included, and no HM_AO was specified
tile.build(tile.mesh, 1, 6, HM_SOFT|HM_BUILD_NULL_MTRL|HM_AO, null, null, null, null, null, null, null, null, &tempmem);
After I specified I can't see the problem as on the video.
I must've removed it while doing some variations. It's interesting that you aren't seeing it, it's definitely there. Maybe I'll compile this and give it to another person to test with a different PC. As you can see in the project, no other display settings are set, so this is using defaults.

Quote:However you are passing null everywhere, and probably that's the problem,
You need to pass pointers to all neighbor tiles (Heightmap) instead of null.
This part always confused me. During the initial creation of the heightmaps, the other heightmaps obviously wouldn't exist, so do you recommend to call heightmap.create() and heightmap.build() a second time after all the adjacent heightmaps have been created, and specify all the adjacent heightmaps in the 2nd set of calls to create() and build()?

Quote:Also for simplification of heightmaps, I recommend to use "true" instead of "false" to keep borders, otherwise you may get holes between the meshes.
if(simplify)tile.mesh.simplify (1.f, 0.05f, 1.f, 0.03f, 0.08f, PI, false); // simplify
I'm doing this now, thank you for pointing that out.

_________________________________

Quote:This part always confused me. During the initial creation of the heightmaps, the other heightmaps obviously wouldn't exist, so do you recommend to call heightmap.create() and heightmap.build() a second time after all the adjacent heightmaps have been created, and specify all the adjacent heightmaps in the 2nd set of calls to create() and build()?
So I actually just tested this part, and yes, now AO works as expected.

Thanks for the guidance. I'm anyone is interested in the final test code, let me know, I can share it.
(This post was last modified: 06-15-2017 03:42 PM by aceio76.)
06-15-2017 04:14 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #7
RE: AO Testing on Terrain
Hi,

First all heighmaps need to be created, and their height and materials set.

Once that's all done, you can build the meshes for the heightmaps.
06-15-2017 04:48 AM
Find all posts by this user Quote this message in a reply
aceio76 Offline
Source Licensee

Post: #8
RE: AO Testing on Terrain
Yea I finally see that. In the past, I always got away with simply making sure the meshes aligned when deforming terrain. But with AO, it looks orders of magnitude better looking.
06-15-2017 05:03 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply