Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by jknight-nc · Dec 20, 2016 at 07:16 AM · graphicsimage effectsinstancing

Graphics.DrawMeshInstanced Does Not Write to _CameraDepthNormalsTexture

Hey there, I am using EdgeDetection on my camera and recently converted my rendering system to use Graphics.DrawMeshInstanced, however my meshes do not receive the EdgeDetection image effect anymore. Any hints as to why? Any ideas how I can make these two systems work together?

EDIT:

Just discovered that when I use the Deferred Rendering Path, that the Edge Detection filter is applied, however I am using an Orthographic Camera, and thus cannot easily use the Deferred Rendering Path. I am now looking into using a Deferred Rendering Path in the Perspective Camera setting, but by applying a custom Orthographic Projection Matrix.

EDIT 2: Using Deferred Rendering with an Orthographic Projection Applied via Script (while the camera remains "perspective" in the editor) is not a feasible solution.

Is there a reason that the Standard Assets Edge Detection does not work with Graphics.DrawMeshInstanced using Forward Rendering?

EDIT 3: The "Luminance Threshold Setting" works, but looks much worse than Edge Detection using Triangle Depth Normals

EDIT 4: Determined that _CameraDepthNormalsTexture does not get written to while using DrawMeshInstanced in Forward Rendering mode, but _CameraDepthTexture does. I raised a bug with a repro project.

EDIT 5: The Unity QA Team responded to my bug report and are going to work on fixing this!

EDIT 6: They told me to use the CommandBuffer.DrawMeshInstanced version. Haven't tested if this works. Unity is likely not fixing this due to the impending release of ScriptableRenderLoops, where everything should be better and working!

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image tanoshimi · Dec 20, 2016 at 10:27 PM 1
Share

I'm afraid I can't help, but just wanted to +1 for a great question and updates - do please let us know what response you get to the bug report.

avatar image jknight-nc · Dec 21, 2016 at 03:49 PM 1
Share

That's a very nice thing to say tanoshimi! Thank you! The Unity QA Team responded to my bug report and are going to work on fixing this!

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by bnogal · Apr 18, 2017 at 09:54 AM

it got "resolved" as Won't Fix.

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jknight-nc · Apr 18, 2017 at 05:12 PM 0
Share

They told me to use the CommandBuffer.Draw$$anonymous$$eshInstanced version. Haven't tested if this works. Unity is likely not fixing this due to the impending release of ScriptableRenderLoops, where everything should be better and working!

avatar image ArminRigo · Aug 11, 2019 at 07:13 AM 0
Share

For people wondering how to do it, follow this commit where I did exactly that in a public project. In addition to Graphics.Draw$$anonymous$$eshInstanced() which was already there, I use a command buffer just to add rendering into the depth+normals texture, using a custom shader: https://pastebin.com/$$anonymous$$vrF8svA

avatar image GeorgeAdamon ArminRigo · May 21, 2020 at 07:57 PM 0
Share

Hi @Ar$$anonymous$$Rigo, as @wxxhrt mentioned, posting the solution here would be extremely helpful to us! 4 years after the original post, this issue persists!

avatar image wxxhrt · May 19, 2020 at 10:15 PM 0
Share

Hi @Ar$$anonymous$$Rigo could you post the code here- the pastebin link no longer works and I cant find any other info on this- thanks!

avatar image ArminRigo wxxhrt · May 22, 2020 at 10:01 AM 0
Share

Ah, sorry. The project is https://baroquesoftware.com/nan-industry/ and the file is available at https://baroquesoftware.com/hg/nan-industry-vr/file/tip/Assets/Scripts/World.cs . Sorry, I don't have my own paste any more where I tried to reduce it, but look for the call to cmdbuf.Draw$$anonymous$$eshInstanced, as well as the logic for getting one command_buffer per camera.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

8 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to (efficiently) make an image pixelated? 3 Answers

Adding support for GPU instancing for legacy shaders? 1 Answer

How to move from Graphics.DrawMeshInstanced to Graphics.RenderMeshInstanced 1 Answer

Mask and Vignette artifacts on Android 0 Answers

GPU Instancing (Dynamic Batching) Not Working on Oculus Quest 2 (Android). Works fine in-editor. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges