Search Unity

Official URP Package Samples

Discussion in 'Universal Render Pipeline' started by Jonas-Mortensen, Jul 6, 2021.

  1. Jonas-Mortensen

    Jonas-Mortensen

    Unity Technologies

    Joined:
    Jan 3, 2020
    Posts:
    110
    Hey everybody!

    With the 2021.2 release, package samples are coming to URP.
    We want to grow the sample collection as features are added and also want to make sure we include samples for the workflows that you are struggling with.

    If you have any thoughts on what you would like to see in the package samples please reply in the thread.
    Maybe you've been wondering how to do some cool effect in URP or maybe you would like to see some specific API in action. Anything goes!

    Thanks!
     
  2. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    486
    I personally always struggled with effects like ripples on puddle from footsteps or trails on snow etc. where you need to inject some data to the render texture. Would love to see an example of this in URP
     
    Jonas-Mortensen likes this.
  3. RoughSpaghetti3211

    RoughSpaghetti3211

    Joined:
    Aug 11, 2015
    Posts:
    1,708
    Would love to see an indoor set example.
     
    PutridEx and Jonas-Mortensen like this.
  4. CyrilGhys

    CyrilGhys

    Joined:
    Nov 1, 2018
    Posts:
    29
    Thank you for asking this!

    Personally I'd like to see an example of a procedurally generated environnement: advices on how to handle lighting in such a scene; can we use realtime global illumination? If so, how do we tie precomputed lightmaps together?; are there optimisations to do regarding Light Probes?; is volumetric lighting achievable?; tips & best practices in general would be useful.

    Otherwise, even though that might be too specific, I've always wondered how the custom depth of field effect was made in the remake of Link's Awakening (the blur effect is not two parallels lines, it seems they take the ground height into account).
     
  5. JesOb

    JesOb

    Joined:
    Sep 3, 2012
    Posts:
    1,109
    Effective batched rendering for low-middle end mobiles (with vulkan support) without static batching
    Best practice how to render i.e. small town from constructor using:
    - gpu instancing
    - srp batcher (and how to use it so it will not exceed mali varyings limit)
    - effective use of texture arrays to lower batches count
    - one batch instancing to render many submeshes of one mesh in different places and material overrides using gpu instancing. Like Static batching but without static batch. This way we can make mesh with submeshes of all city constructor parts and draw all buildings in 1 batch because it uses one mesh, one shader, one material with texture arrays, unique transform per instance and unique material overrides per instance. But how to correctly and effectively do this in URP?
    - how to use TextureArrays for lightmaps to lower batches count
    - how to create good looking visual without lightmaps for low-middle tier mobiles
    - how to create optimal city (location) mesh constructor for all this

    edit: actually it is DrawInstancedIndirect, MultiDrawInstanedIndirect use in Unity for efficient draw many pieces of city constructor
     
    Last edited: Aug 18, 2021
  6. Jonas-Mortensen

    Jonas-Mortensen

    Unity Technologies

    Joined:
    Jan 3, 2020
    Posts:
    110
    Thanks for the reply! Could you share your thoughts on this? I wanna make sure I understand the need
     
  7. Deleted User

    Deleted User

    Guest

  8. lilacsky824

    lilacsky824

    Joined:
    May 19, 2018
    Posts:
    171
    Just curious. Will you ported Lens Flare Sample from HDRP to URP?:p
    I can't find Lens Flare Sample from URP package, but I found some samples from HDRP package.
    Just tried and found it is compatible to URP.
     
  9. Jonas-Mortensen

    Jonas-Mortensen

    Unity Technologies

    Joined:
    Jan 3, 2020
    Posts:
    110
    @lilacsky824 Yes there will be Lens Flare samples in URP as well. It might not be the exact same presets though as we want to keep the amount of textures (file size) to a minimum.
     
    tomekkie2, CyrilGhys and lilacsky824 like this.
  10. Jonas-Mortensen

    Jonas-Mortensen

    Unity Technologies

    Joined:
    Jan 3, 2020
    Posts:
    110
    TrailEffect.gif
    Hey @Onigiri I took your idea and made this sand trail effect. The sample will come with 21.2. It uses a custom renderer feature and an orthographic camera to render a trail map inside the boundaries of the sand box. Hopefully it's useful for leaning some URP intricacies :)
     
    colin299, boone0694, fxlange and 15 others like this.
  11. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    486
    Wow, this is really cool, thank you! I will learn from this for sure
     
  12. Erfan_SheikhHoseini

    Erfan_SheikhHoseini

    Joined:
    Feb 7, 2019
    Posts:
    32
    definitely some custom post processing stuff with render passes.
    sampling light in shader graph (like the blog post you did a few years ago).
     
    daneobyrd and Skuxlife like this.
  13. daneobyrd

    daneobyrd

    Joined:
    Mar 29, 2018
    Posts:
    101
    I would love to see some examples of the Command Buffer API being used with Compute Shaders
     
  14. Kadae

    Kadae

    Joined:
    Dec 7, 2013
    Posts:
    52
    Last edited: Nov 23, 2021
  15. Kadae

    Kadae

    Joined:
    Dec 7, 2013
    Posts:
    52
    And sample with a VERY BIG map and baked light there. Something like a castle or undeground or parking with vehicles.

    All Unity have is a small 2x2 meters maps for mobile games.
     
    PutridEx likes this.
  16. URocks

    URocks

    Joined:
    May 1, 2014
    Posts:
    159
    UI shader sample with ui masking support
     
  17. peaj_metric

    peaj_metric

    Joined:
    Sep 15, 2014
    Posts:
    146
    I really like the 3D Skybox camera stacking example. Its a good use of the stencil buffer.

    Is it possible to get it to work with transparent objects though?
    As the base camera writes each pixel to the stencil buffer (even the transparent ones) the background will not be rendered behind any transparent objects. E.g. particle quads stamp huge squares out of the background.
    I even tried this kind of setup:

    BaseOpaqueRenderer - write stencil
    BackgroundRenderer - compare stencil
    BaseTransparencyRenderer

    But this way the background is drawn on top of the transparent base objects.
    This also has the downside that all transparent shaders are invisible in scene view now as the MainCamera is not drawing the transparent objects and the scene camera seems to mirror the main camera in this regard.
     
  18. peaj_metric

    peaj_metric

    Joined:
    Sep 15, 2014
    Posts:
    146
    Ok the 3 renderer approach actually works for transparent stuff. You just have to make sure to use the same near and far planes as the depth buffer of previous cameras will be interpreted incorrectly otherwise
     
  19. spajus

    spajus

    Joined:
    Jun 10, 2015
    Posts:
    47
    Advanced use cases of Graphics.DrawMeshInstancedIndirect / Procedural / Now would be great
     
  20. daneobyrd

    daneobyrd

    Joined:
    Mar 29, 2018
    Posts:
    101
    Can all of the URP Package Samples be updated to account for the "New" Input System? It's annoying to open the samples and be met with warnings/errors about the old input system is being used for the scripts used in the examples.
     
    hippocoder likes this.
  21. RogueStargun

    RogueStargun

    Joined:
    Aug 5, 2018
    Posts:
    296
    There should be a an ultra low settings sample (ie: something that will run at 72 fps on the oculus quest 1). Something with no post-processing, shadows, a bit of terrain with no normal textures. It won't look good, but it would be extremely useful for the many folks that complain that URP is slow.
     
  22. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    Unity 3d samples are not too much beautiful

    Something like this can be a good 3d sample for URP:
    https://www.unrealengine.com/marketplace/en-US/product/epic-zen-garden
    531.jpg
    The only difference is the art and not the rendering... Unity needs artistic works

    All artists are using the UE and all programmers are using the Unity

    I recommend that you ask some UE's artists to create a sample for Unity. This don't needs too much money
     
    Last edited: Jan 24, 2022
    Fury_Sven_ and daneobyrd like this.
  23. Jonas-Mortensen

    Jonas-Mortensen

    Unity Technologies

    Joined:
    Jan 3, 2020
    Posts:
    110
    Hey @UnityLighting
    The samples are designed to focus on specific features of URP while having as low file size as possible. We definitely want to do beautiful scenes because URP is capable of it, but package samples might not be the place to release them. The new HDRP template was received very well by the community so we are looking into the possibility of URP getting something of that caliber.
     
  24. kurroarashi

    kurroarashi

    Joined:
    Dec 22, 2018
    Posts:
    28
    An example of a day-night cycle as explained here.

    Day-night cycles are very popular in games these days and would be nice to have a sample to follow.
     
  25. Jonas-Mortensen

    Jonas-Mortensen

    Unity Technologies

    Joined:
    Jan 3, 2020
    Posts:
    110
    Hey @kurroarashi. Real Time GI with Enlighten has been supported by URP from 2021.2 and would therefore be the recommended workflow for day/night cycles. Would you still be interested in a sample that shows how to do a day/night cycle with Enlighten? Something like this: enlighten.gif
     
    Issol, TerraUnity, Luxxuor and 5 others like this.
  26. Jonas-Mortensen

    Jonas-Mortensen

    Unity Technologies

    Joined:
    Jan 3, 2020
    Posts:
    110
    Hey @spajus could you say a bit more about what you'd want from a sample like that? Maybe some specific effect or use case you'd like to see recreated.
     
  27. kurroarashi

    kurroarashi

    Joined:
    Dec 22, 2018
    Posts:
    28
    Oh! I apologize, I wasn't aware of Enlighten being supported. I was under the impression that it was still deprecated. I personally have a basic idea for how one might use enlighten but if you could polish up the said day-night cycle example (maybe using some post-processing, using interpolated lighting etc.), I think it might be very helpful to people (including myself).
     
    daneobyrd likes this.
  28. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,668
    I am. That would be very cool sample to learn for sure. Also all the ideas the guys are writing here are very interesting too for URP
     
    daneobyrd likes this.
  29. kenzen0

    kenzen0

    Joined:
    Sep 17, 2018
    Posts:
    16
    URP sample "LensFlare(SRP)" is not available in orthographic
    The Flare in the sample works fine in lensflare, but disappears when I make it orthographic.
    Please tell me how to get this to show up!
    Please!
     
    mitaywalle likes this.
  30. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,668
    Is the Japanesse office a sample or a demo? because it is beautiful for sure :D
     
  31. DrViJ

    DrViJ

    Joined:
    Feb 9, 2013
    Posts:
    161
  32. NarberalTools

    NarberalTools

    Joined:
    Jul 8, 2019
    Posts:
    63
    I did something like this for my pipeline. Perhaps you can develop the idea from my example and make it richer in content. In my case, this weighs 33.3 MB.
    upload_2022-6-7_12-6-35.png
     
  33. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Echoing @DrViJ , the sample need to be updated for 13+/14+. Some render feature sample just spamming error on 2022.2
     
  34. clabbe

    clabbe

    Joined:
    Aug 9, 2013
    Posts:
    26
    I'd be thrilled at some samples showcasing how to do more pracital stuff in terms of render stack modification.
    How to write depth from transparent objects after they've been drawn so they to can be a part of cool post effects using depth is one that would be useful to a lot of people since i've seen quite a few having trouble with it.
    Another example would be how to render shadow layers into different buffers so you can get unique shadow values for different objects. like semi transparent shadows from colored glass and such.