1
\$\begingroup\$

I'm trying to update a skybox shader to URP and reimplement it in Shader Graph. The shader code itself is pretty straightforward, but I don't know enough about Shader Graph yet to set up the basic skybox.

It's a standard cubemap skybox made up of six textures for +x, -x, +y, -y, +z, and +z.

Trying to Google different variants of "unity shader graph cubemap skybox" turns up tons of noise and nothing actually useful that I can see.

Does anyone know what the basic node setup is I would need to input six images and output a skybox?

\$\endgroup\$
0

1 Answer 1

3
\$\begingroup\$

In your Assets folder, right click and select Create > Legacy > Cubemap

Set the "Face Size" parameter to your desired resolution before you assign your textures - it won't re-import them automatically if you increase the size later.

Assign your six textures to the six face fields.

Cubemap inspector

Now inside your shader graph, you can add a Cubemap property, and sample it like so:

Cubemap sampling graph

Assign your custom-made cubemap to the material property.

Note that you can also pre-compose your six images into a single image in various layouts, and Unity will automatically convert this to a corresponding cubemap based on your import settings. This gives you additional options to filter the cubemap for use in reflections, and HDR support.

\$\endgroup\$
1
  • \$\begingroup\$ That looks pretty straightforward. Thanks! \$\endgroup\$ Commented Jun 3, 2020 at 16:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .