popcron / gizmos Goto Github PK
View Code? Open in Web Editor NEWUsed for drawing runtime gizmos in builds and editor (Unity3D)
License: MIT License
Used for drawing runtime gizmos in builds and editor (Unity3D)
License: MIT License
Why does it only support 2018.3?
I have write a plugin to show waveforms of audioclips in scene by using compute buffer and DrawMeshInstancedProcedural function. And I use your gizmos drawing plugin at same time. Then I found that your gizmos may not rendered correctly on Game View while the waveforms are rendering.
When the bounds of waveforms is out of field of vision, then the gizmos can rendered correctly. I can't find the reason.
Besides, I have used two compute buffers to calculate waveforms. At the beginning I wonder if it is because the compute buffers are on conflict. But I found that the gizmos can be rendered correctly while I just removed the line of Graphic.DrawMeshInstancedProcedural() but keep buffers delivering their data.
Previously I was working with URP, in which there are two active cameras (MainCamera, UICamera) in my game view. Calling methods such as PopcronGizmos.Line
or PopcronGizmos.Draw
was rendering fine when viewing from the MainCamera. However, it seems that after having upgraded to HDRP, the same functionalities aren't rendering now from the MainCamera. After some investigation of my own and coming across this thread, it seems that I had to make the following change to GizmosInstance
on my local clone of the repo to make rendering work for HDRP:
RenderPipelineManager
callback from endCameraRendering
to endContexRendering
which takes a list of cameras instead of a single one. I would then have to filter the list of cameras to find one tagged with MainCamera
to then pass to OnRendered
to draw GL lines.private void OnRendered(ScriptableRenderContext context, List<Camera> cameras) => OnRendered(cameras.FirstOrDefault(c => c.tag == "MainCamera"));
After some debugging, it seems that using endCameraRendering
keeps alternating between the two cameras in my scene which then would mean the lines I want to draw will not persist in the game view from my MainCamera
.
Is there a way to fix this such that draw lines still work for the MainCamera
with HDRP with a multi-camera setup, and that I don't have to maintain my own fork of the repo?
//use custom material, if null it uses a default line material
Gizmos.Material = material;
This is an example from README which isn't working right now. I could change the material only this way: Popcron.GizmosInstance.Material = material;
Anyone else facing the same issue or I'm making the mistake??
It only for some materials other materials are perfectly fine, but some materials have to be converted every time when I reopen the project.
Gizmos are only drawn by the first camera (aka the first raise of Camera.onPostRender(...)) each frame.
Bug location:
gizmos/Runtime/GizmosInstance.cs
Line 278 in 58288ca
Sorry, me again.
Actually, it happened long time ago.
Every time I pressed to play in edit mode, this error caused. Because of it did not cause any other problem after I pressed to unpause, I didn't asked for help. For I need to test on play mode more frequently, now it puzzled me a lot.
How can I fix it? In fact, every scene whatever it has some script to use you plugin or not will cause this error as the same.
The error log is on below.
IOException: Authentication failed because the remote party has closed the transport stream.
Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake (Mono.Net.Security.AsyncOperationStatus status) (at <14e3453b740b4bd690e8d4e5a013a715>:0)
(wrapper remoting-invoke-with-check) Mono.Net.Security.MobileAuthenticatedStream.ProcessHandshake(Mono.Net.Security.AsyncOperationStatus)
Mono.Net.Security.AsyncHandshakeRequest.Run (Mono.Net.Security.AsyncOperationStatus status) (at <14e3453b740b4bd690e8d4e5a013a715>:0)
Mono.Net.Security.AsyncProtocolRequest+d__24.MoveNext () (at <14e3453b740b4bd690e8d4e5a013a715>:0)
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at :0)
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at :0)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at :0)
System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at :0)
System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () (at :0)
Mono.Net.Security.AsyncProtocolRequest+d__23.MoveNext () (at <14e3453b740b4bd690e8d4e5a013a715>:0)
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at :0)
Mono.Net.Security.MobileAuthenticatedStream+d__47.MoveNext () (at <14e3453b740b4bd690e8d4e5a013a715>:0)
Rethrow as AggregateException: One or more errors occurred.
System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) (at :0)
System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) (at :0)
System.Threading.Tasks.Task.Wait () (at :0)
Mono.Net.Security.MobileAuthenticatedStream.AuthenticateAsClient (System.String targetHost, System.Security.Cryptography.X509Certificates.X509CertificateCollection clientCertificates, System.Security.Authentication.SslProtocols enabledSslProtocols, System.Boolean checkCertificateRevocation) (at <14e3453b740b4bd690e8d4e5a013a715>:0)
Mono.Net.Security.MonoTlsStream.CreateStream (System.Byte[] buffer) (at <14e3453b740b4bd690e8d4e5a013a715>:0)
System.Net.WebConnection.CreateStream (System.Net.HttpWebRequest request) (at <14e3453b740b4bd690e8d4e5a013a715>:0)
Rethrow as WebException: Error: SecureChannelFailure (One or more errors occurred.)
System.Net.HttpWebRequest.EndGetResponse (System.IAsyncResult asyncResult) (at <14e3453b740b4bd690e8d4e5a013a715>:0)
System.Net.WebClient.GetWebResponse (System.Net.WebRequest request, System.IAsyncResult result) (at <14e3453b740b4bd690e8d4e5a013a715>:0)
System.Net.WebClient.DownloadBitsResponseCallback (System.IAsyncResult result) (at <14e3453b740b4bd690e8d4e5a013a715>:0)
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at :0)
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at :0)
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at :0)
System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at :0)
System.Runtime.CompilerServices.TaskAwaiter1[TResult].GetResult () (at <fb001e01371b4adca20013e0ac763896>:0) Updater+<IsUpdateAvailable>d__6.MoveNext () (at Library/PackageCache/com.popcron.gizmos@41dfa17124/Editor/Updater.cs:28) --- End of stack trace from previous location where exception was thrown --- System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at <fb001e01371b4adca20013e0ac763896>:0) System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) (at <fb001e01371b4adca20013e0ac763896>:0) System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) (at <fb001e01371b4adca20013e0ac763896>:0) System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) (at <fb001e01371b4adca20013e0ac763896>:0) System.Runtime.CompilerServices.TaskAwaiter
1[TResult].GetResult () (at :0)
Updater+d__8.MoveNext () (at Library/PackageCache/com.popcron.gizmos@41dfa17124/Editor/Updater.cs:71)
--- End of stack trace from previous location where exception was thrown ---
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () (at :0)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__6_0 (System.Object state) (at :0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <2791c1cdbfd943f6aba0f758c93ccc78>:0)
UnityEngine.UnitySynchronizationContext:ExecuteTasks()
i dont find Gizmos.DrawRay in here , how can i put it in ?
This is not related to your package specifically, but maybe you know some info on how to fix it.
Recently I added RenderPipelineManager.endCameraRendering
to this package for rendering with Unity's Rendering Pipelines, but using this delegate Gizmos are incorrectly rendered in Game view.
Here is a comment in Unity post and a question with details. Noone has made any comments yet =(
Hi. Thank you for your work to bring Gizmos to life also in build and play mode. I find it useful.
I would just like to say, that it doesn't work in Unity 2019.1.0f2. It shows gizmo for a moment in play mode and then it goes away.
Can you add such functionality?
I developed an AR app that rendered gizmo lines on the screen.When it didnt render then since my AR app doesnt have a MainCamera component & only using the Vuforia AR Camera component I then added it using the specified filter.But for some reason the lines(circle created using line) I created aren't rendering on the screen.It is visible in the Editor mode though.I am also new to C# scipting & Unity & so I am sorry if I explained it wrong.I have also included my script I attached to the gameobject below.Thanks in advance.
circlescript.txt
hi,
i need gizmo to rotate with some parent ? it is possible with this library ?
thankyou and have a great day
Hi, first of all, thanks for this awesome package, really useful in play mode.
I have one small issue.
When having more than one scenes. In the build, the gizmos are only rendering in the first scene. They just do not appear in the following scenes. Any thoughts?
Thanks for you help.
I'm using Unity 2019.1.0f2
THICK
I am working with standalone VR (Oculus Go, Oculus Quest) where I can only use builds to test things. This tool is great, but when this is in VR, where there is 3 cameras (left, right, center eyes) I cannot see gizmos things because everything is drawing to center camera. It would be great if this tool will be able to work with 2 cameras at the same time.
I just write this here to ask if you can make this feature or advice how to do so. Anyway I am going to figure out how it works and then try to make a solution.
Have a nice day :)
Does anybody test it on Andorid with AR 4.1.0 and URP 8.3.1. It doesn't render on phone.
Hi @popcron,
Thanks for making this awesome UPM package. I'm the creator of the OpenUPM platform, an open-source UPM registry, and continuous build service based on Git tags. It's hosting more than 200+ open-source UPM packages at the time of writing.
To make it happen, I would suggest you make GitHub releases (which create Git tags) for version control. It can be achieved either manually or using an automatic approach.
In your case, the new release would be 1.6.6
or v1.6.6
. After your GitHub release, our build pipelines will detect the changes and build UPM packages in 5-10 minutes. Then you can visit your package at https://openupm.com/packages/com.popcron.gizmos/.
Hopeful this makes sense for you.
Change how long a gizmo can be visible
See: https://docs.unity3d.com/ScriptReference/Debug.DrawLine.html
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.
Hi @popcron, I just noticed gizmos are drawing over icons I use in my worldspace canvas.
Any suggestion or idea to fix it?
The Gizmos.Circle doesn't rotate towards the camera! It doesn't work if you manually set Gizmos.Camera as well.
Workaround, use this code:
Gizmos.Circle(transform.position, 0.2f, Quaternion.LookRotation(transform.position - Camera.main.transform.position), Color.white);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.