Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Feedback Wanted: High Definition Render Pipeline

Discussion in 'Graphics Experimental Previews' started by Tim-C, Sep 25, 2018.

  1. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi,
    it is almost impossible to build without Shader Variant stripping, we have remove it from the UI so people can't disable it (and see infinite build time).

    We still have work to do to be more agressive on shader variant we removed.
     
    Grimreaper358 likes this.
  2. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934

    Hi, I am not sure about which version people refer to, maybe we have get one version at some point that was broken but it have been fixed quickly. Anyway, shader stripping is always on and can't be disable in recent version.

    Also to cut your build time A LOT, I suggest to disable "Debug Display" option in HDRP asset. This will prevent you from debugging, but can save 30% of your build time.

    We need all the shader variant for various reasons. If you are a coder and know what your game is using, you can remove unused multi-compile in lit.shader and replace them by define. you will save a lot of time.
    The issue with build time is that as a general engine, we can't tweak our variant for your game, so we need to compîle all variant :( . We have added option in HDRP asset to allow to cut shader variant not use (Decals, light layers etc...).
     
  3. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    hmm... That is indeed unfortunate. One solution could be to not apply contact shadow if we detect that we are emissive. (easy to do, just do if (builtindata.emissiveColor > 0) dont apply contact shadow in lightEvaluation.hlsl). However I pretty sure other will come to ask the opposite :).
     
    hippocoder likes this.
  4. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    We can't reproduce this. But I would advice to not play with 2019.1 and 5.x.x we currently focus on 2018.3 and 4.x.x
     
  5. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi sorry I am not sure to understand if you have a question or what is your question.

    SSS apply to diffuse lighting, not specular lighting.
    The dual specular you refer too is specular lighting, so independent of SSS.

    Lit shader support a single lobe for specular for performance reasons.
    StackLit shader support dual lobe for specular but isn't targeting game.
     
  6. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi, I would advice to not play with 2019.1 and 5.x.x we currently focus on 2018.3 and 4.x.x
     
    hippocoder likes this.
  7. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi, We indeed haven't consider the case of flight simulator in our implementation. So expected that thing get broken :(
     
  8. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi,
    yes I can be surprising. But here is some comment :)
    - HDRP vs Builtin can be compare, an empty scene is not the best comparison, but I will say a unity scene convert to HDRP isn't either. What you need to compare if what you can achieve. HDRP have way more features and can support way more lights (you can go up to 500 lights and it still perform correctly compare to Builtin).
    - HDRP IS slower currently due to various copy we are performing that we can't remove as low level 3D API function are not yet expose + HDRP perform a depth pyramid and a color pyramid all the time (this is use for distortion, refraction, SSR etc...). We haven't added yet option to disable it, and this explain this slowdown. But have in mind that if you use these features, you will require it. So if you use HDRP to have the same feature as Builtin, then indeed there is a waste of effort here.
    - Please always use millisecond and not FPS (but sadly Unity is bad at providing these numbers...) :)

    So you are right. Currently with empty scene builtin is faster. Later we will expose more option to disable undesired effect and allowing to reach same performance on empty scene. But ultimately, you don't care once you will have a game (but you care for secondary camera).
     
    optimise and hippocoder like this.
  9. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Yes, builtime are long. Fontainbleau demo take around 40 min, and around 1H30 on PS4.
    https://forum.unity.com/threads/pho...eal-world-objects-into-digital-assets.521946/

    FPS Sample game can take also one or two hours.

    Be sure we are worried about that but to the question why Builtin (or LW) is faster. It is because they support way less features than HDRP do. And in particular as HDRP support both forward and deferred renderer at the same time, this add a lot of variant. If you customize buitlin Unity with your own shader, you can get into the same issues. Adding multicompile in .shader cause a lot of variants.

    We are working on being more agressive on shader variant removal, but it will always require hint from the users. We can't decide for him what he want to use, and this is why by default there is various option enabled (like decals).
     
    hippocoder likes this.
  10. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Can you give a barebone custom unlit emissive shader, working wit fog and keep it updated with each HDRP release?

    A shader like this sounds simple but with each new HDRP release, fog breaks. Having an up to date example greatly reduces the hours of source code digging I have to do each time something changes.
     
  11. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    @SebLagarde
    1. what is TerrainLit Mask configuration on each channel? is it RGB or RGBA? also what is on each channel?
    2. Planar reflection are flickering like crazy in 410
    3. also can you confirm my question in this post about the distortion settings
     
  12. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    EvaluateAtmosphericScattering() is broken again. It used to work fine in 4.0 find but in 4.1 it turns the sprites into triangles. If I comment out that function, it works again.

    EvaluateAtmosphericScattering bug:
    View attachment 326590

    If I change the fog code to this, the triangles disappear, but the sprites are white in the distance instead of being blocked out completely:
    Code (CSharp):
    1. float3 test = float3(1, 1, 1);
    2. //col = EvaluateAtmosphericScattering(posInput, col.xyz);
    3. col = EvaluateAtmosphericScattering(posInput, test, col);
    View attachment 326596

    Case Nr: 1099511
     
    Last edited: Nov 10, 2018
  13. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    @SebLagarde
    HDRP 410 Lit Terrain Normal scale are flipped
    FlippedNormal.png
     
  14. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    HDRP Volume component Profile creates instance without user action
    Issue is that every so often it will make it an instanced volume rather than referencing my original. For example when I reload the editor it will show (instanced). I never want that, ever. I know what I control and what I want on it. Is it a bug? If not then I will add some additional code to prevent it from happening.
     
  15. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    1,255
    Why fade distance in Density Volumes is hard-coded or am I missing something?

    DensityVolumes.JPG


    In our case we want the local fog to stay at place in its bounding box even at far viewing distances and the fade distance controllable though component's UI.
     
    Last edited: Nov 11, 2018
  16. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    704
    Check the Depth Range in the Volumetric Lighting Controller of your Scene Settings. The range is [0.5, 64] by default. Looking at your cube size, I guess the fading you're seeing is the maximum depth range.
     
    TerraUnity likes this.
  17. TerraUnity

    TerraUnity

    Joined:
    Aug 3, 2012
    Posts:
    1,255
    @Remy_Unity Thank you, how did I miss that! Obviously setting the range to a higher value will lose precision, wish this setting was available per volume as enabling "Increase resolution of volumetrics" in the HDRP asset kills the performance.

    Are you aware of THIS as well?
     
  18. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    704
    I tried but I don't notice any performance drop with Unity 2018.3.0b9 and HDRP 4.1.0 .

    Edit: I found the culprit : If you have realtime probes it will indeed cause huge performance drops. I will not got in depth in the details, but basically convolution will be done multiples times per probe with this setting, and that's the root of the issue. A fix will come in the near future, but I can't give an ETA for it.
     
    Last edited: Nov 12, 2018
  19. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Ah. . . i think i do have planar reflection on the scene.
     
  20. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Yes, real time probes ( even a single one ) are really slow for me too even on HDRP 4.0.1 and now on 4.1.0
     
  21. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    One more thing,
    when i start a scene at 1080p it lags - toggle fullscreen ( alt+enter) fixes the issue and makes it smooth still at 1080p.
    Not sure what could be the issue !
     
  22. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    704
    1. The mask is similar to the mask map used in HDRP lit:
    R. Metallic
    G. Occlusion
    B. Height (instead of detail mask)
    A. Smoothness​
    2. Could you maybe share a repro scene or describe a bit more the issue. I never encountered this.
    3. Yes, distortion affects its own surface. Maybe you should more look into refraction for the effect you showed in the other post.
     
  23. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    704
    EvaluateAtmosphericScattering() is not broken, but you appear to use it wrongly :)

    Calling it with two argument is more ment to be used with opaque objects. It returns the color and opacity of the fog, and so, was coloring your triangles in a full uniform color :
    https://github.com/Unity-Technologi...ericScattering/AtmosphericScattering.hlsl#L34

    The implementation with 3 arguments is ment to be used with transparent objects : https://github.com/Unity-Technologi...definition/Runtime/Material/Material.hlsl#L64

    But in your case, you were providing the wrong blend mode. Your shader is using a soft blend : Blend SrcAlpha One .
    But your declared #define _BLENDMODE_ALPHA 1 , so the fog evaluation was wrong.
    Replace it by #define _BLENDMODE_ADD 1 and it will fix your issue:
    upload_2018-11-13_15-50-55.png
     
    Elecman likes this.
  24. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    704
    We have a fix for this that is coming. It will add a "Max Fog Distance" parameter that you can set to "Infinity" if needed. It's already in our master branch, so expect it to be available in the next release of the package.
     
  25. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    704
    I tested and could reproduce this. Thanks for reporting.
     
    Pr0x1d likes this.
  26. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    1. Ah. . . alright then i'll reconfigure my texture packer. Thanks
    2.
    huh? i can't embed gif/image from external image storage now? Try this https://i.imgur.com/jlJk3rg.gifv
    i'll try to create a small repo scene,
    @Remy_Unity i think i found the problem, The planar reflection flicker if double sided are activated in the Lit Shader. One sided works just fine


    3. Uuuhh which post, i made a lot of post lately?
    Refraction are great and every except for these thing
    RefractionProblem.png
    - there's a cuttoff in the lower edge of the screen
    - Object above/in front of the refraction showing a bad refraction artiffact above it. I know that this is a grab pass artifact, but distortion doesn't have this artifact (actually it do, but not this bad).
    - So, can we specify the direction of the refraction ior? i believe the artifact occured due refraction are shift the refraction buffer in Y screen space axis.
    - maybe this could be solved if we can have an opaque texture buffer just like LWRP, or an access to the refraction buffer in shadergraph.
     
    Last edited: Nov 13, 2018
  27. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,374
    Thanks! That fixed the problem.
     
  28. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    704
    That one :)
     
  29. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    ah i see, but how about the artifact with the refraction. Any chance to reduce that like in distortion?
     
  30. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    704
    @Reanimate_L Check your probe setup, refraction falls back to the local probe if the ray trace fails to find proper value in the buffers. We already reduced some issues with refraction in the current version, but can't do much more without impacting performances ...
     
  31. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Reanimate_L likes this.
  32. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi.

    Cost of realtime reflection probes depends on your scene content + your resolution. It is up to you to control what you render in your probe (disable decals, have only a single cascade shadow etc...).

    The current extra cost that we are aware is that builtin unity is still performing its own convolution (a gaussian blur), before HDRP can do its own (GGX blur). We will solve this issue in 2019.1
     
  33. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Sorry but I am confused by your description, I don't understand the issue.
     
  34. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi.
    Sorry but we but there is not enough information here to be of any help.
     
  35. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Distortion and refraction use the same fading at edge (in 4.1.0), which version are you using? There is no improvement plan for now after 4.1.0
     
  36. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi, Sorry I don't understand the question / problem.

    >Added SunShafts FX as a post processing which was already included in V-Fog itself

    What is Sunshaft FX or V-Fog ? Suppose it is your own plugin ?
     
  37. Lecht

    Lecht

    Joined:
    Jul 1, 2014
    Posts:
    24
    I'm using HDRP 4.20 (the latest 2018.3 release). I added a grass texture to the terrain details, if I use "Billboard" it doesn't show up, if I don't, it shows up but it's pink.
     
  38. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    410
     
  39. DefiantDev_Chris

    DefiantDev_Chris

    Joined:
    May 9, 2018
    Posts:
    11
    What is currently the correct way to access the HDRP Gbuffer from a custom post process effect?

    Thanks!
     
  40. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Also what is distortion mode for? it seems the multiply mode doesn't do anything.
    @SebLagarde say when do we get access directly to refraction buffer in shadergraph?
     
    Last edited: Nov 15, 2018
  41. Remy_Unity

    Remy_Unity

    Unity Technologies

    Joined:
    Oct 3, 2017
    Posts:
    704
    It's when you overlay multiple objects with distortion. In Add mode, the newly rendered object will accumulate it's value to the previous one, while in Multiply mode, it will multiply with the previous one.
     
  42. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Ahh okay, Thanks
     
  43. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Hi,

    Look at deferred.shader for an example

    These lines:

    // input.positionCS is SV_Position
    float depth = LOAD_TEXTURE2D(_CameraDepthTexture, input.positionCS.xy).x;

    PositionInputs posInput = GetPositionInput_Stereo(input.positionCS.xy, _ScreenSize.zw, depth, UNITY_MATRIX_I_VP, UNITY_MATRIX_V, uint2(input.positionCS.xy) / GetTileSize(), unity_StereoEyeIndex);

    BSDFData bsdfData;
    BuiltinData builtinData;
    DECODE_FROM_GBUFFER(posInput.positionSS, UINT_MAX, bsdfData, builtinData);

    With these line you have the GBuffer data. If you only use the normal from GBuffer (bsdfData.normalWS), then the compiler will remove all unneeded texture fetch
     
    Last edited: Nov 16, 2018
    DefiantDev_Chris likes this.
  44. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    934
    Color pyramid will be accessible via shadergraph in near future
     
  45. kite3h

    kite3h

    Joined:
    Aug 27, 2012
    Posts:
    197
    Of course I also know that SSS is a diffuse term.
    It's not a technical story, it's about art design.
    When there are not many polygons, Sometime I may use dual specular to express skin detail and gloss.

    In fact, even before linear lighting, dual specularity has been used a lot. (Not game )



    As You already said , StackLit is not for Game.

    But I do not have much trouble when I use it so I just want to use it.
     
    Last edited: Nov 16, 2018
  46. kite3h

    kite3h

    Joined:
    Aug 27, 2012
    Posts:
    197
    I am wondering where to replace whole Terrain shader in the HD RP.
    For example, I want to know if the unity default shader's nature shader is replaced.
    And I want to know if the grass billboard shaders are being replaced as well, or replaced by separate ECS forms.
     
  47. Morillan

    Morillan

    Joined:
    Mar 6, 2013
    Posts:
    8
    HI,

    Is it possible to replace the SplatAlpha image of the new HDRP Terrain?

    I created a terrain using a RAW image from Word Machine in Unity and I´d like to use the maps generated in World Machine ( Deposit, Fluids, Soil, etc ) for the textures. There is a script that does just that but I couldn´t make it work in the new HDRP Terrain.

    https://www.world-machine.com/learn.php?page=workflow&workflow=wfunity You can find it at the bottom of the article.

    Is there a way to do it?

    Thanks !
     
  48. YuriyPopov

    YuriyPopov

    Joined:
    Sep 5, 2017
    Posts:
    237
    So I'm facing a bit of an issue. Is there anyway to define layerMasks for the decal projector ?
     
  49. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    I was looking for this as well, but i don't think there is a way.
    There is only per material decal support toggle !
    At least i am only aware to this solution !
     
  50. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    hdrp 4.2
    • Remove multi-camera support. LWRP and HDRP will not support multi-camera layered rendering.
    What is the resoning behind that? How we would overcome depth buffer issues in the huge worlds, like in the space simulators? Or this will not be the case for hdrp?