Search Unity

How to use the Projector component when using LWRP?

Discussion in 'General Graphics' started by Vak_HD, Jun 26, 2018.

  1. Vak_HD

    Vak_HD

    Joined:
    Aug 6, 2016
    Posts:
    13
    I don't seem to be able to get the Projector component to work when using the new Lightweight Render Pipeline. Does anyone know how to get this to work using LWRP? I've tried to use the Upgrade Material tool on the Projector Materials from the Standard Assets Effects package but get the message:

    ShadowProjector material was not upgraded. There's no upgrader to convert Projector/Multiply shader to selected pipeline
    UnityEditor.Experimental.Rendering.LightweightPipeline.LightweightMaterialUpgrader:UpgradeSelectedMaterials()

    etc..

    Do I need to set up a regular LightweightPipeline material a certain way to in order for it to work? If so I am having trouble and don't seem to be able to get it to work.
     
    TreesAreOP likes this.
  2. itsPeetah

    itsPeetah

    Joined:
    Nov 4, 2016
    Posts:
    1
    I know this comment is going to be pretty useless but I also am having this problem and I hope this thread reaches out to someone who can help
     
  3. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    1,002
    You have to provide a shader that's compatible with LWRP for it to work.
     
  4. Wolfos

    Wolfos

    Joined:
    Mar 17, 2011
    Posts:
    738
    Why don't the default projector shaders work? They don't display any errors or warnings, they just don't work.
     
  5. jugueton

    jugueton

    Joined:
    May 11, 2016
    Posts:
    13
    Very helpful...
     
  6. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    399
    Projectors are not supported by SRP and LWRP. We need to provide faster alternatives for decals, blob shadows and so on.

    What are you main usage of projectors? Then we can add your requests to our backlog.
     
  7. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    1,256
    We use projectors in our tools to highlight an area of the terrain and also detect the height at that point as the user moves the mouse across a terrain. Is there a better way to do this that works in both HDRP and LWRP?

    We use them in orthographic mode with the projector facing downwards.
     
    joshcamas likes this.
  8. MostHated

    MostHated

    Joined:
    Nov 29, 2015
    Posts:
    882
    I was wanting to use a projector as my character throws objects and I have a line renderer that shows the trajectory arc but if you start to get kind of far away it becomes difficult to determine exactly where the end of the line renderer is compared to other objects near it, so I wanted to have something of a crosshair or circle or something that projects on to the ground or onto whatever object happens to be at the receiving end of the line renderer and where the thrown object will end up.

    Is there another way that someone can suggest for LWRP that might work for this and be able to display on the ground as well as on other objects if they happen to be there? I would assume that if this gets added to a backlog it will probably be a while before it makes it into a release, yeah?

    --- Edit --- Hmm... I had been using LWRP since the start of this current project and things were more or less fine this whole time and I made due with the limitations but decided to copy my project and remove the LWRP just to see if the restrictions were worth the performance increase. Turns out, they are not. My game ran just as good, while I had not actually profiled it yet without it, it seemed to actually be running better. I guess I may as well just run normal rendering as it will at least not restrict some of the things I need. I guess I can just revisit LWRP down the road to see if things are better at a later date.
     
    Last edited: Sep 23, 2018
  9. reflectingb0t

    reflectingb0t

    Joined:
    Apr 10, 2018
    Posts:
    18
    Having trouble with Projectors, too..
    We use Blob Shadow Projector for the player character shadow (just the one from Unity Standard Assets) and somehow it works fine in the Scene view with LWRP, but in Game it sometimes shows and sometimes not.
    It seems to depend on the mesh the player is standing on (for example the regular plane doesn't work, but some custom meshes always show the shadow), but i couldn't figure it out exactly.
    Setting the render queue and moving the projector doesn't fix this. Any idea or workaround? We can afford the performance cost of the projector in this particular case.
     
  10. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    1,002
    As answered earlier, projectors are not supported by SRP and LWRP.
     
  11. juanfornos

    juanfornos

    Joined:
    Feb 17, 2018
    Posts:
    7
    I was using projector for blob shadows as real time are too expensive for low end devices.

    Blob shadow support would be great and makes total sense in the LWRP context.
     
    Giacas and qzmp like this.
  12. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,934
  13. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    337
    Thanks for the link! I'll check this out as soon as a I can but I am a bit concerned. It appears to be using the projector component - but I'm hoping that the shaders involved don't have the same issue of requiring a re-render of every mesh they touch. Considering I need to be able to render hundreds of onscreen blob shadows at once, that would be bad.
     
  14. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,934
    Yeah although Kink3d works at Unity and on LWRP (I think) so I don't think he would deliberately make something crappy and slow. You could ask him - @Kink3d here, or on twitter: https://twitter.com/MatthewDean3D

    I have doubts it's slow, but it is actually still forward so YMMV... I haven't tested it because I'm using HDRP at the moment which supports decals by default.
     
  15. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    337
    I checked it out and it does indeed appear to add additional SetPass calls for each decal unfortunately. At least, that's the case with the built-in pipeline. Maybe it's different for the LWRP. I suppose this is at least a nice temporary fill-in for projectors if one is using the LWRP.

    Sadly I'm in production so using something experimental like the new rendering pipelines is out of the question for me.
     
    hippocoder likes this.
  16. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    555
    Just passing by to say the kDecals by Kink3d isn't for LWRP yet, as it still use projectors.

    You will need to develop a custom solution based on ScriptableRenderPass, here are some examples:

    https://github.com/UnityTechnologies/LWRPScriptableRenderPass_ExampleLibrary

    I haven't seen a working solution in the wild yet, but it's possible, here are a few idea:

    https://forum.unity.com/threads/alternative-blob-shadows-lwrp.592237/

    (Projector are slow anyway, by going the alternative routes you gain what LWRP focus on: performance)

    (Kinda think this thread should be in the graphic beta forum.)
     
    phil_lira likes this.
  17. Jokerminator

    Jokerminator

    Joined:
    Jun 30, 2006
    Posts:
    258
    Clouds effect. Blood. Details in general.

    Please make projectors and decals work, also in the LWRP. No support isn't an option!
     
    DezBoyle, kkrg001, Immu and 5 others like this.
  18. japtar10101

    japtar10101

    Joined:
    Mar 13, 2010
    Posts:
    137
    I have a unique case where I'm trying to create an F-zero-like arcade game with anti-gravity vehicles hovering over a track that can flip upside-down. A common problem I have are that users cannot tell how high the vehicle is hovering over the track, especially if the vehicles & track are upside-down, thus making the directional light ineffective. If I could project the vehicle's "shadow" (as in, blob shadow) onto the track so it's always pointing down relative to the vehicle, that would go a long way in helping solve this visual problem.
     
  19. m3rt32

    m3rt32

    Joined:
    Mar 5, 2013
    Posts:
    62
    There is no decal support, no projector support. But it is really really needed. I am making blood splatting to ground via projectors on different mesh surfaces but without it I can't do that.
     
    kkrg001 likes this.
  20. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    883
    How does the terrain editor manage to have something like projectors for brushes? Is it built into the terrain shader?
     
  21. WILEz1975

    WILEz1975

    Joined:
    Mar 23, 2013
    Posts:
    301
    Don't worry, this solution doesn't work either.
     
    DezBoyle likes this.
  22. Sluggy

    Sluggy

    Joined:
    Nov 27, 2012
    Posts:
    337
    Ha yeah, tried a long time ago and discovered as much. Thanks for the heads up just the same. I just ended up going back to deferred rendering and using a deferred decal shader to solve the issue. Just made life easier.
     
  23. WILEz1975

    WILEz1975

    Joined:
    Mar 23, 2013
    Posts:
    301
    If I can have my say without being stoned, for me HDRP and LWRP are the worst update since I use Unity. And I use it from the Unity 3 version.
    I think it will take a long time for these introductions to be usable on a large scale. Especially because the tons of shaders that are on the net do not work if they are not rewritten from scratch for these pipelines.
     
    DezBoyle, gregolai and BroMandarin like this.
  24. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    7,889
    Any news on a projector for LWRP - HDRP ?
     
  25. khalvr

    khalvr

    Joined:
    Sep 12, 2017
    Posts:
    36
    It's a part of the shader. When you paint terrain, you are basically painting into texture maps which have the same dimensions as the terrain. The shader then reads from the RGBA channels of these maps and use them as weights for the different terrain layers.

    The best solution for decals would be to have a system which crops out pieces of the meshes it affects and uses them for its own renderer. This would allow them to be batched too, though it would be a more static approach than projectors and not as usable for shadows and such.