HDRP stars background

I’d like to add stars to the background with an option for the full screen (not just above the horizon). Is there an example of doing this with a custom pass or are there better options that don’t require making a custom shader?

If you download the environment sample in the HDRP packager manager samples tab, you should be able to get an example on how to add stars to the Physically Based Sky in HDRP.

There’s also a simple custom shader graph you can duplicate and/or create a material from that is located here: \Packages\com.unity.render-pipelines.high-definition\Runtime\RenderPipelineResources\ShaderGraph\PhysicallyBasedSky

In this one you can put a stars cubemap directly without having to open the shader graph.

Procedural Sky is deprecated.

It feels like building sandcastles on the beach with Unity. Something is just starting to work correctly, then it gets broken down, is washed away, then you have to start all over again. Only to have it washed away. It’s why no-one likes upgrading Unity versions.

Instead, a more production-ready system would enhance, upgrade, and fix issues.

Cannot agree more! Finding that “learning” these “updates” is certainly most depressing and mostly pointless. HDRP has always been a mess but has gotten even more so.

I’d like to create custom full screen starfield using shader graph for the physically based sky. In HDRP 16 and 17 there is a Render Mode for Material.

How can I use a custom material for use with HDRP 14 and 15? (Assuming it would also work in HDRP 16 and 17).

I’m probably going to use a noise texture I can modify rather than a fixed cubemap as I want to dynamically modify the starfield.

While indeed HDRP 14 doesn’t have the PBR sky target for shadergraph, you could use the Custom Render Texture target to generate a starfield cubemap.
Then you can use this cubemap as the Space Emission Texture of the PBR sky, or directly as the cubemap texture of a HDRI sky.




Thanks, that’s helpful. A few questions:

  1. What is the first HDRP version to support Custom Render Texture as a target? (I couldn’t find any doco on this).
  2. How can I fill the whole screen with stars with Physical Based Sky like with HDRi?
  1. I did my previous screenshots with Unity 2022.3.x. I don’t remember when the custom RT target was introduced, but even before you could use the built-in/unlit target with a custom RT asset.

  2. The Physicaly Base Sky always have a ground displayed, even if it is a constant color, so it can not display stars on the whole screen when looking downwards. For it to display the stars (in the space emission texture), you need to lower the sun light (so it is a night sky).
    If you want a full screen “everywhere” star sky, it will be easier to use the HDRI sky.

In 2021 LTS (HDRP 12.1.7) using an unlit HDRP target the material looks ok but can’t get the custom RT to render anything for the HDRi.

Setting a target of Built-in, just get a pink material and again no custom RT output.

Not sure what I’m doing wrong.


It is expected for the built-in material preview to be pink when HDRP is the active pipeline.
The important thing is that it generates a compatible shader pass for the custom render texture.


(Note that using a 3D noise would yield a better result)

ok, thanks. I’ll give it another go.