Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android not working - fix candidate #5

Open
JRRomacho opened this issue Mar 27, 2020 · 1 comment
Open

Android not working - fix candidate #5

JRRomacho opened this issue Mar 27, 2020 · 1 comment

Comments

@JRRomacho
Copy link

I thought that was an issue related to shaders, but looks like there is something about render textures.
Replacing:
viewTexture = new RenderTexture (Screen.width, Screen.height, 0);

by:
viewTexture = new RenderTexture (Screen.width, Screen.height, 24);

Portals are rendered, but with no recursion.
Why is this happening? Is feasible to fix recursion with Android?

@vegechick123
Copy link

I've met the problem, you can fix recursion problem by
replacing:
portalCam.Render ();
by:

RenderTexture buffer = RenderTexture.GetTemporary(Screen.width, Screen.height, 24);
portalCam.targetTexture = buffer;
portalCam.Render ();
Graphics.Blit(buffer, viewTexture);
RenderTexture.ReleaseTemporary(buffer);

the reason is viewTexture in origin code is used as the texture of recursion portal, when we call portalCam.Render ();, it also used as the targetTexture of Camera.We can't read the same RenderTexture while it is being written, so the recusion is black.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants