Search Unity

Also set variable `_DrawObjectPassData` in RenderObjectsPass.Execute()

Discussion in 'Universal Render Pipeline' started by pw_prg_yinchao, Nov 23, 2020.

  1. pw_prg_yinchao

    pw_prg_yinchao

    Joined:
    Feb 14, 2020
    Posts:
    18
    Hi there,
    I found URP set global variable `_DrawObjectPassData` in `DrawObjectsPass`, but `RenderObjectsPass`(the pass of RenderFeature, which is designed to be easily used) doesn't. And `_DrawObjectPassData.w` determines shader's output alpha.
    So, for now, if I create a new RenderFeature with its `Queue` is `Transparent` and `Event` is `BeforeRenderingTransparent`.Its `_DrawObjectPassData.w` is still 1, leading to a lot of shader's output alpha is always 1.
    I think `_DrawObjectPassData.w` may be 0 whenever my `Queue` is `Transparent`, no matter what my `Event` is.