Hi DanielSefton,
Yeah, that black squared building kinda sucks - programmers art. Yeah, you're right, I didn't set the materials correctly, it only flashes very subtly now. I think I'll wait for depth scene rendering, because it's really not practical for objects with multiple materials - having to add a haze pass in the code manually is a bit of a pain. It's fine for objects with one material, because I add it when my component-based object system calls setMaterial on an entity.
Yes with depth scene rendering you will not need to add haze pass to objects materials but i will implement it for v2.0 only because it implicates to rewrite a lot some shaders.
Unless it crashed before it reached mbWorldIsLoaded, it's guaranteed to be set to false, so I don't think that's the issue.
ok i will investigate that.
Also, could you clearly explain how paging works? e.g. what AsyncLoadPageMargin, LivePageMargin, PageCacheSize, WorldWidth/HeightSeamless. do. The explanation in the docs is a bit cryptic.
LivePageMargin is the radius in count of pages of pages being rendered (minus the current page which is always rendered):
for instance if LivePageMargin = 2 it means that (2*2+1)^2 pages are rendered at every frame.
And to disable paging, set LivePageMargin to 0 so that (2*0+1)^2 = 1 page is rendered only.
AsyncLoadPageMargin is the radius in count of pages of pages being loaded even if they are not rendered yet (must be >= LivePageMargin to enable paging and better if >)
PageCacheSize is the max count of pages which remain in memory (minus the ones which are rendered)
WorldWidthSeamless is the count of pages which repeat seamlessly along X axis while
WorldHeightSeamless is the count of pages which repeat seamlessly along Z axis
(set to 0 to disable seamless status)
The landsample is absolutely huge, I can never reach the end What I want is it to just load the heightmaps in landsample once and not duplicate anything if that makes sense. It appears to seamlessly page them forever.
Yes as WorldWidthSeamless and WorldHeightSeamless are set to 8 it means that terrain repeat seamlessly (every 8 pages) in all directions...
To load once the heightmaps as terrain is seamless 8x8 pages set AsyncLoadPageMargin to 4 and PageCacheSize to 64 should be enough to avoid pages to be unloaded/reloaded (but vertex buffers still need to be builded because page vertexs coordinates are not the same)
Also, in my project I use real world scales, and the avatar is about 2.5m tall. Problem is, this is really small in relation to the terrain. So it's very close to the geometry, and the textures are blurry. I also needed to reduce the near clip plane quite significantly, to 0.5 because the camera is so close to the terrain. However, the lower the value below 1, the more the water plane shakes at a long distance.
Yes it is because if you lower NearClipPlane but not FarClipPlane, the more math discrepancy errors you will have (shaders work with floating point not double...): just take care that ratio FarClipPlane/NearClipPlane stay constant and low enough.
In order to use real world scale (you mean 2.5 world unit = 2.5 meters ?) you must modify PageWorldSize and PageHeightSize by a factor of /4 at least i think but in this case you must also lower both Near and Far clip plane so that ratio remain constant and sufficiently low to avoid discrepancy errors; you will need to adjust haze blending with sky too.
I noticed that it's not just the sky that shakes a long way from the origin, but the entire terrain and water plane also shake violently - basically everything shakes.
Yes i noticed that too but only for the clouds and the water plane: i think i will need to modify world origin so that camera = world origin in order to render properly clouds and water plane.
The other easy way is to reduce Far clip plane/Near clip plane ratio by setting Near clip plane to higher value: it works well with sky (because it is far away actually you do not need small value for near clip plane) - you can try by setting near clip plane to 50 for instance: sky will not shake anymore but terrain will be clipped if camera is too close to the ground...
So to properly implement that i will need to feed sky shader with a custom modified proj matrix (because i need to keep the standard matrix for rendering objects and terrain). For the water plane, the same can apply but only when camera is high above water plane: if camera y is near water plane y, i still can use normal projection matrix because shaking is unnoticeable near water plane and we need small value for near clip plane to avoid water plane being clipped like for terrain.
For the terrain, i did not notice shaking: i think it is because you set near clip plane to a very small value (1 or below) without adjusting proportionally the far clip plane ?
Cheers.
Myrddinson.