Immediate Mode not drawing in Cameras but in Scene View URP

Avatar
  • updated
  • Fixed

The shapes, which are drawn with IM, arent showing up in the gameview.
In the Sceneview they are completely fine.
The Color Picker example:

Image 853

Image 854

Image 855

Thanks for any idea. Much appreciated :D

Reporting a bug? please specify Unity version:
6
Reporting a bug? please specify Shapes version:
4.4.0
Reporting a bug? please specify Render Pipeline:
URP
Pinned replies
Avatar
Freya Holmér creator
  • Answer
  • Fixed

This has now been (properly) fixed for 4.4.1

Avatar
Freya Holmér creator

first, make sure your URP renderer actually has the Shapes render feature

Image 856


If it doesn't, you'll need to add it, though it looks like it should already be added. Also make sure you don't have any errors in your project that might've disrupted Shapes URP setup process.


If you upgraded in place, sometimes shaders don't properly recompile, I would recommend doing a clean install and see if it fixes it!

Avatar
Claas Stegemeyer

Thank you very much for the super fast response.

I redid everything you said and it still doesnt work.

So I created a new Unity URP-Project and there it works.

No idea what the problem is.

For me the easiest solution is to port my small project to the new unity project.

Avatar
Freya Holmér creator
Quote from Claas Stegemeyer

Thank you very much for the super fast response.

I redid everything you said and it still doesnt work.

So I created a new Unity URP-Project and there it works.

No idea what the problem is.

For me the easiest solution is to port my small project to the new unity project.

hmm, maybe it's the URP version that's different between the two?

Avatar
Claas Stegemeyer

Ok i found it... in the URP-Asset I had to disable msaa. But I thought you should enable MSAA for subpixel rendering?

Avatar
Freya Holmér creator

I've reproduced it! and yeah, just enabling MSAA breaks Shapes rendering. Or rather, it does render, it just doesn't get to be included in the final render pass


it looks like it might have something to do with the injection point - the default injection point of rendering before post processing, seems to create a mismatch in MSAA states. 


Workaround

Set the second parameter of the Draw.Command function to any event prior to BeforeRenderingPostProcessing, the closest one being AfterRenderingTransparents in URP:

using( Draw.Command( cam, RenderPassEvent.AfterRenderingTransparents ) ){
    // ...
}

Avatar
Freya Holmér creator
  • Answer
  • Fixed

This has now been (properly) fixed for 4.4.1