Login
You're viewing the discuss.systems public feed.
  • Aug 28, 2025, 6:52 PM

    Does anyone here have experience writing shaders for #unity that work with both URP, HDRP and builtin-render pipeline?

    The "new" RPs use different includes and have different alternatives to ObjSpaceViewDir, etc.

    So far I have concluded that the best solution is to:
    - Create one volrend.hlsl with the main shader code, where it conditionally uses builtin shader functionality or URP/HDRP versions based on a "
    #if USE_BUILTIN_RP" definition
    - Create 3 separate shaders, one for each RP, that include the volrend.hlsl (the builtin one first defines "USE_BUILTIN_RP".
    - When creating the materials, choose the appropriate shader.

    This is madness, but are there really no better alternatives?

    💬 1🔄 1⭐ 0

Replies