ClipToBounds not working in Android
Hi,
We are building for multiple platforms (Windows, Mac, iOS, Android, etc). In one view we have a collection of PNGs tiles that we pan and zoom around. This is basically a ItemsControl, inside a Canvas, Inside a Grid, with ClipToBounds="True" set on the Grid so that the PNGs do not show up outside of the confines of the Grid.
This works fine except on our Android test device, where the PNGs show up outside the confines of the Grid.
Any idea what this might be or where to start looking on this? We just don't get how it can work everywhere else!
Many thanks.
We are building for multiple platforms (Windows, Mac, iOS, Android, etc). In one view we have a collection of PNGs tiles that we pan and zoom around. This is basically a ItemsControl, inside a Canvas, Inside a Grid, with ClipToBounds="True" set on the Grid so that the PNGs do not show up outside of the confines of the Grid.
This works fine except on our Android test device, where the PNGs show up outside the confines of the Grid.
Any idea what this might be or where to start looking on this? We just don't get how it can work everywhere else!
Many thanks.
Re: ClipToBounds not working in Android
If this using Unity or C++ with a custom renderer?
Re: ClipToBounds not working in Android
It is C++, so from your question it sounds like there must be a custom renderer in that case, so looks like the problem is our side..?
Re: ClipToBounds not working in Android
Not necessarily, but I was assuming you have implemented your own renderer or are you using our implementation? (GLRenderDevice in this case).
Are you setting up a stencil surface and clearing it in Android?
Are you setting up a stencil surface and clearing it in Android?
Re: ClipToBounds not working in Android
I've found GLRenderDevice - it looks like it is your implementation but whether anyone else has modded it I'm not sure. Its around 2734 lines, we are using Noesis version 3.0.11 ...
Sorry if its a bit vague, I didn't have much involvement on that side of things originally.
Sorry if its a bit vague, I didn't have much involvement on that side of things originally.
Re: ClipToBounds not working in Android
I see, well, as said before I would verify first that you are setting and clearing a stencil buffer.
If that's correct could you capture a frame with Renderdoc?
If that's correct could you capture a frame with Renderdoc?
Re: ClipToBounds not working in Android
I've been looking through GLRenderDevice.cpp, which if I understand correctly is provided by Noesis? I put the question out as to whether it had been modified and it seems not, or at least not anything significant.I see, well, as said before I would verify first that you are setting and clearing a stencil buffer.
If that's correct could you capture a frame with Renderdoc?
In "GLRenderDevice::CreateRenderTarget", a stencil is created:
surface->stencil = CreateStencil(width, height, samples);
Stencil is cleared in "GLRenderDevice::BeginTile"
Stencil is deleted in "GLRenderDevice::DeleteRenderTarget"
Stencil is cleared in InvalidateStateCache.
I could send you the entire GLRenderDevice.cpp if that helps?
I'm not sure what Renderdoc is, I'll check it out. As I mentioned before, it works fine on all other platforms.
Re: ClipToBounds not working in Android
https://renderdoc.org/
The problem with the stencil is not about the lines you mention in our code. It is the framebuffer where you are rendering your game (and after your game, the UI). That framebuffer must have stencil bits, and you must clear them before calling Render() in our view.
Hope this helps.
The problem with the stencil is not about the lines you mention in our code. It is the framebuffer where you are rendering your game (and after your game, the UI). That framebuffer must have stencil bits, and you must clear them before calling Render() in our view.
Hope this helps.
Who is online
Users browsing this forum: Google [Bot] and 19 guests