Archive 17/01/2023.

Android mobile shows jaggies in the instersection plane-terrain

feresmu

Hi
For performance issues, I tried to change the water material (Materials/Water.xml) with Materials/Red.xml

<material>
    <technique name="Techniques/NoTexture.xml" />
    <parameter name="MatDiffColor" value="1 0 0 0.25" />
    <parameter name="MatSpecColor" value="1 1 1 16" />
</material>

in the water example (without reflexion camera).
It works fine in desktop and android table.


But in android mobile it shows jaggies in the instersection with the terrain.

I tried a lot of things like change material with SetDepthBias or SetRenderOrder but nothing works.
The terrain is the same of the water example.
Any ideas?

Eugene

What’s your camera range, znear/zfar? I assume you don’t use orthographic cameras.

feresmu

Hi.
I don’t use orthographic cameras.
Because the camera can be far away of the terrain I create it with:
Camera* camera = cameraNode_->CreateComponent();
camera->SetFarClip( 11750.0f );

Then
nearClip_ = 0.100000001
farClip_ = 11750.0000

if I do
Camera* camera = cameraNode_->CreateComponent();
only (without camera->SetFarClip( 11750.0f ):wink:
nothing happens ( it shows jaggies )

Eugene

Yep, what I thought.
You probably have only 16 bits of depth on mobiles.

Just to give you an idea of how little it is… You literally have no intermediate depths between
z=2562, z=4207, and z=11750, these are 65533th, 65534th and 65535th depth layers. There will be no deterministic depth order between an object on z=4k and another object on z=5k.

Default values are still too much. Try near=1 and far=100?

feresmu

Hi.
It seems that camera->SetNearClip( 1 ); do the trick
even with camera->SetFarClip( 3000.0f );

Well, with camera->SetFarClip( 3000.0f ); I show jaggies but are smaller.
But with camera->SetNearClip( 100 ); and camera->SetFarClip( 700 ); I show perfect, like desktop.
So playing with that and the camera distance and limit camera zoom out, I got it.

Thanks a lot!!