Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transparency issue when using Shader Graph shaders in particles #331

Open
Ziplaw opened this issue Sep 16, 2024 · 8 comments
Open

Transparency issue when using Shader Graph shaders in particles #331

Ziplaw opened this issue Sep 16, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@Ziplaw
Copy link

Ziplaw commented Sep 16, 2024

Objects seem to not use transparency when viewed in Game View in the editor, as seen here: here

This is due to the fact that whatever is rendering the particles ("Bake Camera" I think?) rendering the generated quad with the Scene Picking and Scene Selection passes auto-generated by Shader Graph:
draw quad with transparency stage

draw quad with scene picking and scene selection passes
These passes are not used during normal rendering, so they should be skipped by the rendering of the particles

@Ziplaw Ziplaw added the bug Something isn't working label Sep 16, 2024
@mob-sakai
Copy link
Owner

Thank you for your reporting!

@mob-sakai
Copy link
Owner

Tell me about your develop/build environment.

  • version [e.g. 2.3.6]
  • Platform: [e.g. Editor(Windows/Mac), Standalone(Windows/Mac), iOS, Android, WebGL]
  • Unity version: [e.g. 2022.2.0f1]
  • Build options: [e.g. IL2CPP, .Net 4.x, URP/HDRP]

Could you please attach a minimal project (included Assets, Packages and ProjectSettings directories) that reproduces the issue?
Of course, you don't need to include any secret assets from your project. Feel free to use free assets instead.

repos

@mob-sakai
Copy link
Owner

mob-sakai commented Sep 16, 2024

Is it "Canvas Shader Graph"?

@Ziplaw
Copy link
Author

Ziplaw commented Sep 17, 2024

version 4.9.1
Platform: Editor(Windows/Mac), iOS
Unity version: 2022.3.42f1
Build options: Mono, URP

It's a Sprite Unlit Shadergraph, I believe Canvas Shader Graph is not supported in LTS as of yet, I'll send a repro project
Repro.zip
As you'll see, it will render the Scene Picking and Scene Selection passes as actual passes

@mob-sakai
Copy link
Owner

Thank you.
The issue is reproduced on my environment.
Just to confirm, does the issue also occur outside of the editor?

@mob-sakai
Copy link
Owner

@mob-sakai
Copy link
Owner

mob-sakai commented Sep 21, 2024

It seems fully supporting this may be challenging. Here are the workarounds:

Workaround 1: Create a new shader

  1. Follow the steps in discussions to generate shader code.
  2. Save the shader code as a *.shader file.
  3. Remove 3 passes (Spite Unlit (LightMode=Universal2D), SceneSelectionPass and ScenePickingPass) from the saved shader code.

Workaround 2: Use a render mode other than Overlay.

Workaround 3: Use the Canvas template

  1. Update Unity to 2023.2 or higher.
  2. In Shader Graph, use the Canvas template instead of the Sprite Unlit template.

P.S. I'll try skipping the passes in Overlay UI mode using RenderFeature, but... don't expect too much!

@JustinPrat
Copy link

JustinPrat commented Feb 25, 2025

Would also love to have this fixed, will for now use the remove passes workaround, thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants