popcron / gizmos

Used for drawing runtime gizmos in builds and editor (Unity3D)
MIT License
540 stars 42 forks source link

Rendering issues with HDRP #33

Open PawitKoch opened 1 year ago

PawitKoch commented 1 year ago

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:

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?

popcron commented 12 months ago

this seems specific to hdrp, is there perhaps a compiler region specific to it so that endContextRendering could be swaped in?

PawitKoch commented 12 months ago

I can try making endContextRendering be in a conditional region today and submit a subsequent PR?