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

[2018.4.23] Not working in Play Mode #21

Open
jbltx opened this issue Jun 19, 2020 · 3 comments
Open

[2018.4.23] Not working in Play Mode #21

jbltx opened this issue Jun 19, 2020 · 3 comments

Comments

@jbltx
Copy link

jbltx commented Jun 19, 2020

Hello,
Apparently, in my project, the rendering of gizmos works well only in the Editor when the Play Mode is not enabled.
I can see the gizmos in SceneView and Game View.

I am using Unity 2018.4.23f1 and the legacy render pipeline (no Render Pipeline Asset).
When debugging, I can see I go through all the drawing process, so I am not sure what is different in Play Mode.
The Gizmos Draw methods are called into my OnRenderObject() method (ExecuteAlways attribute is used to see the result in the editor).

I thought it could come from the onPostRender event, but even without PostProcess activated in the scene, I am not able to see it.

Any ideas ?
Thank you.

EDIT :

After more investigation, it seems the GizmosInstance.queuIndex is equal to 1 when it arrives at OnRendered(Camera cam).
So only the dummy Gizmos is processed. But in the queue, there are all the submitted Gizmos through OnRenderObject()...

I will let you know if I find something.

@jbltx jbltx changed the title [2018.3.24] Not working in Play Mode [2018.4.23] Not working in Play Mode Jun 19, 2020
@jbltx
Copy link
Author

jbltx commented Jun 20, 2020

It seems to be a synchronization problem, what I can see is, all my scripts submit draw in the queue, then when the dummy gizmos (from GizmosInstance.Update() ) is submitted, it seems to be another frame, so the queueIndex is reset, and only the dummy is actually rendered.
For now my workaround is to reset the queueIndex only at the end of OnRederered(Camera camera). Now it's working fine for PlayMode, but of course this won't work in SceneView/GameView in editing Mode. For now the most important is the PlayMode.

image

@popcron
Copy link
Owner

popcron commented Jun 20, 2020

Hm, the fix would likely be to do add a #if UNITY_EDITOR for this exact case since it can only ever happen in the editor. I did have issues like yours in the past, and I thought I fixed it but I guess not lol. If I have time I will fix it, otherwise a PR would be great for this since I'm pretty busy.

@CycloneRing
Copy link

Any news @popcron ? same issue

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

3 participants