Title: URP Support · Issue #126 · unitycoder/UnityPointCloudViewer · GitHub
Open Graph Title: URP Support · Issue #126 · unitycoder/UnityPointCloudViewer
X Title: URP Support · Issue #126 · unitycoder/UnityPointCloudViewer
Description: using Unity 2019.4.25f1 + URP 7.7.1 temporary fix for URP+WorldSpace Canvas issue (point cloud get "stuck" inside canvas) You dont need to do this, if you don't have world space canvas. This is only for V1 (.bin) and V2 (.ucpc) formats. ...
Open Graph Description: using Unity 2019.4.25f1 + URP 7.7.1 temporary fix for URP+WorldSpace Canvas issue (point cloud get "stuck" inside canvas) You dont need to do this, if you don't have world space canvas. This is onl...
X Description: using Unity 2019.4.25f1 + URP 7.7.1 temporary fix for URP+WorldSpace Canvas issue (point cloud get "stuck" inside canvas) You dont need to do this, if you don't have world space canva...
Opengraph URL: https://github.com/unitycoder/UnityPointCloudViewer/issues/126
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"URP Support","articleBody":"### using Unity 2019.4.25f1 + URP 7.7.1\r\n\r\ntemporary fix for URP+WorldSpace Canvas issue (point cloud get \"stuck\" inside canvas)\r\nYou dont need to do this, if you don't have world space canvas.\r\nThis is only for V1 (.bin) and V2 (.ucpc) formats.\r\n\r\n- Create script CustomRenderPassFeature.cs (copy below)\r\n- Select UniversalRenderPipelineAsset_Renderer\r\n- Click Add Renderer Feature/CustomRenderPassFeature *this wont be visible, if you didnt create the script first\r\n- Modify PointCloudViewerDX11.cs, add this line to class variables (somewhere before Awake() line):\r\n`public static PointCloudViewerDX11 instance;`\r\nModify Awake() to:\r\n```\r\nvoid Awake()\r\n{\r\n instance = this;\r\n applicationStreamingAssetsPath = Application.streamingAssetsPath;\r\n}\r\n```\r\n\r\n```\r\nusing UnityEngine;\r\nusing UnityEngine.Rendering;\r\nusing UnityEngine.Rendering.Universal;\r\n\r\npublic class CustomRenderPassFeature : ScriptableRendererFeature\r\n{\r\n class CustomRenderPass : ScriptableRenderPass\r\n {\r\n CommandBuffer commandBuffer;\r\n\r\n public override void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor)\r\n {\r\n commandBuffer = new CommandBuffer { name = \"PointCloudViewer\" };\r\n }\r\n\r\n public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)\r\n {\r\n if (unitycodercom_PointCloudBinaryViewer.PointCloudViewerDX11.instance == null) return;\r\n commandBuffer.Clear();\r\n commandBuffer.DrawProcedural(Matrix4x4.identity, unitycodercom_PointCloudBinaryViewer.PointCloudViewerDX11.instance.cloudMaterial, 0, MeshTopology.Points, unitycodercom_PointCloudBinaryViewer.PointCloudViewerDX11.instance.points.Length);\r\n context.ExecuteCommandBuffer(commandBuffer);\r\n }\r\n\r\n public override void FrameCleanup(CommandBuffer cmd)\r\n {\r\n }\r\n }\r\n\r\n CustomRenderPass m_ScriptablePass;\r\n public override void Create()\r\n {\r\n m_ScriptablePass = new CustomRenderPass();\r\n m_ScriptablePass.renderPassEvent = RenderPassEvent.AfterRenderingOpaques;\r\n }\r\n\r\n public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)\r\n {\r\n renderer.EnqueuePass(m_ScriptablePass);\r\n }\r\n}\r\n\r\n```\r\n--------------------------\r\n### Using Unity 2020.3.21f1 + URP 10.6.0 + V3 (.pcroot) viewer\r\n\r\n- Create script CustomRenderPassFeature.cs (copy contents below)\r\n- Select UniversalRenderPipelineAsset_Renderer\r\n- Click Add Renderer Feature/CustomRenderPassFeature *this wont be visible, if you didn't create the script first\r\n- Modify PointCloudViewerTilesDX11.cs, add these changes:\r\n```\r\n// BEFORE\r\nPointCloudTile[] tiles;\r\n// AFTER\r\ninternal PointCloudTile[] tiles;\r\n// BEFORE\r\nint tilesCount = 0;\r\n// AFTER\r\ninternal int tilesCount = 0;\r\n// BEFORE\r\n void Awake()\r\n {\r\n applicationStreamingAssetsPath = Application.streamingAssetsPath;\r\n FixMainThreadHelper();\r\n }\r\n// AFTER\r\n public static PointCloudViewerTilesDX11 instance;\r\n void Awake()\r\n {\r\n instance = this;\r\n applicationStreamingAssetsPath = Application.streamingAssetsPath;\r\n FixMainThreadHelper();\r\n }\r\n// BEFORE\r\npublic void OnRenderObject()\r\n// AFTER\r\npublic void DisabledOnRenderObject()\r\n```\r\n\r\n\r\n\r\nCustomRenderPassFeature .cs:\r\n\r\n```\r\nusing unitycodercom_PointCloudBinaryViewer;\r\nusing UnityEngine;\r\nusing UnityEngine.Rendering;\r\nusing UnityEngine.Rendering.Universal;\r\n\r\npublic class CustomRenderPassFeature : ScriptableRendererFeature\r\n{\r\n class CustomRenderPass : ScriptableRenderPass\r\n {\r\n CommandBuffer commandBuffer;\r\n\r\n public override void Configure(CommandBuffer cmd, RenderTextureDescriptor cameraTextureDescriptor)\r\n {\r\n commandBuffer = new CommandBuffer { name = \"PointCloudViewer\" };\r\n }\r\n\r\n public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)\r\n {\r\n if (PointCloudViewerTilesDX11.instance == null) return;\r\n\r\n commandBuffer.Clear();\r\n for (int i = 0, len = PointCloudViewerTilesDX11.instance.tilesCount; i \u003c len; i++)\r\n {\r\n if (PointCloudViewerTilesDX11.instance.tiles[i].isReady == false || PointCloudViewerTilesDX11.instance.tiles[i].isLoading == true || PointCloudViewerTilesDX11.instance.tiles[i].visiblePoints == 0) continue;\r\n commandBuffer.DrawProcedural(Matrix4x4.identity, PointCloudViewerTilesDX11.instance.tiles[i].material, 0, MeshTopology.Points, PointCloudViewerTilesDX11.instance.tiles[i].visiblePoints);\r\n }\r\n context.ExecuteCommandBuffer(commandBuffer);\r\n }\r\n\r\n public override void FrameCleanup(CommandBuffer cmd)\r\n {\r\n }\r\n }\r\n\r\n CustomRenderPass m_ScriptablePass;\r\n public override void Create()\r\n {\r\n m_ScriptablePass = new CustomRenderPass();\r\n m_ScriptablePass.renderPassEvent = RenderPassEvent.AfterRenderingOpaques;\r\n }\r\n\r\n public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)\r\n {\r\n renderer.EnqueuePass(m_ScriptablePass);\r\n }\r\n}\r\n\r\n```","author":{"url":"https://github.com/unitycoder","@type":"Person","name":"unitycoder"},"datePublished":"2021-12-06T16:24:20Z","url":"https://github.com/unitycoder/UnityPointCloudViewer/issues/126"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fd32e6b5-fc1e-04f1-0384-525a18e73cee |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A162:12476C:F21B58:13A4B8E:6AFFF11E |
| html-safe-nonce | dd68de166fe1e72a421ee65f1e5bfc1f3ff54743dbce4a9ae4c74b2cd706eebc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTYyOjEyNDc2QzpGMjFCNTg6MTNBNEI4RTo2QUZGRjExRSIsInZpc2l0b3JfaWQiOiI0MDAwMDQ5ODUwODM3MTAyODc4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 94cece7ce3f110e56f13fca96567708e7e30a9f2a766cc38384d1269dda1752a |
| hovercard-subject-tag | issue:1072343673 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/unitycoder/UnityPointCloudViewer/126/issue_layout |
| twitter:image | https://opengraph.githubassets.com/755db4c0343cd4030ea955a37f5191b6f61ea066d4df4d2a96465ca94222bc9f/unitycoder/UnityPointCloudViewer/issues/126 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/755db4c0343cd4030ea955a37f5191b6f61ea066d4df4d2a96465ca94222bc9f/unitycoder/UnityPointCloudViewer/issues/126 |
| og:image:alt | using Unity 2019.4.25f1 + URP 7.7.1 temporary fix for URP+WorldSpace Canvas issue (point cloud get "stuck" inside canvas) You dont need to do this, if you don't have world space canvas. This is onl... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | unitycoder |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| turbo-cache-control | no-preview |
| go-import | github.com/unitycoder/UnityPointCloudViewer git https://github.com/unitycoder/UnityPointCloudViewer.git |
| octolytics-dimension-user_id | 5438317 |
| octolytics-dimension-user_login | unitycoder |
| octolytics-dimension-repository_id | 57969691 |
| octolytics-dimension-repository_nwo | unitycoder/UnityPointCloudViewer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 57969691 |
| octolytics-dimension-repository_network_root_nwo | unitycoder/UnityPointCloudViewer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width