Mardok
Member
|
[SOLVED] mesh drawPrepare jittering flickering mobile
Hi All,
Problem occurs only on Android, on pc is ok.
Why when i try draw mesh via cskel matrix all is fine but when i set my custom matrix this happens (mesh is over ground y = 0.01):
Code:
void TTest::create(Object &obj_params)
{
(...)
_matrix_render = actor.matrix().scaleOrnL(_scale);
cskel.updateMatrix(_matrix_render);
}
Affected:
https://drive.google.com/file/d/0B9eEH0v...09DVm5maTg
Code:
UInt TTest::drawPrepare()
{
//mesh->draw(cskel);
mesh->draw(_matrix_render);
return 0;
}
Correct:
https://drive.google.com/file/d/0B9eEH0v...Wx5UURITVU
Code:
UInt TTest::drawPrepare()
{
mesh->draw(cskel);
//mesh->draw(_matrix_render);
return 0;
}
(This post was last modified: 04-01-2016 01:40 AM by Mardok.)
|
|
03-31-2016 05:39 AM |
|
Esenthel
Administrator
|
RE: mesh drawPrepare jittering flickering mobile
Hi,
On Android you could have a low precision depth buffer.
You can check it with Bool Renderer.lowDepthPrecision()
To overcome this issue, you could:
-try increasing viewport.from (near plane)
-try decreasing viewport.range (far plane)
-place the mesh higher above ground (not just 0.01, but more)
|
|
03-31-2016 11:47 PM |
|
Mardok
Member
|
RE: mesh drawPrepare jittering flickering mobile
hi, thx for answer
To overcome this issue i draw my meshes via cskel, i dont need change viewport.from and range and placing meshes over ground more than 0.01.
I'm wondering where is the difference between cskel matrix and my matrix.
It should work the same way? Right?
These 2 screenshots above are from my android device and the
difference is only in drawPrepare function.
If call mesh->draw(cskel) rendering is ok
When i call mesh->draw(_matrix_render) rendering isnt ok.
I dont process my "_matrix_render" and cskel in any other place. It's set only once in "create" method.
Im just wondering where is the difference between cskel matrix and my _matrix_render.
|
|
04-01-2016 12:40 AM |
|
Esenthel
Administrator
|
RE: mesh drawPrepare jittering flickering mobile
This could be because internally the draw calls (by Matrix vs AnimSkel) may be processed at different order.
I strongly recommend using the ideas proposed by me above, as you may encounter similar issues later.
Drawing with AnimSkel is also slower then with just the Matrix.
Especially when HW Instancing is available (DX10+)
|
|
04-01-2016 01:09 AM |
|