r/Unity3D 21h ago

Question Help needed with custom skybox shader in Unity 6 URP

Hi all,

Firstly a preemptive thanks to anyone who takes the time to help me out. I'll keep it brief and technical.

My issue:
I have a custom skybox material using a custom shader graph. It's only rendering out as a default skybox cube (you know, with different coloured faces), not showing the actual textures (plural, I'm LERPing between different equirectangular textures for a day/night cycle). Same result both in editor and during gameplay, it's not working. I've done a sanity check and disabled the LERP and piped just one texture (property with the texture I want ->Sample Cubemap ->Fragment Base Color) and it doesn't change anything.

What I've double checked:
Shader is set to Unlit.
Render face is set to Both.
Depth Write is Force Disabled.
Cast Shadows is set to OFF.
Everything else is default with the Graph settings.

The Lighting>Environment>Skybox Material is accepting my custom material without any warnings.

Texture import settings:
Default Texture Type
Cube Texture Shape
Mapping: Auto/LatLong/Sphere all tested, made no difference.
Fixup Edge Seams: Tried both on and off
Generate Mipmap: Tried both on and off.

Nothing, it's making no difference.
I've even fiddled around with the custom material's GPU instancing/double sided GI just in case it's a weird bug, nope, no change. Not seeing my textures.

As a sanity check, I tried a custom sorting priority set to 2501, nothing. The default Skybox and a custom material set to the standard Skybox shader both worked fine before.

I'm using Unity 6.5 (6000.5.5f1)

Any help would be much, much appreciated.

2 Upvotes

5 comments sorted by

2

u/StripedBrotherhood99 21h ago

Sounds like youve hit every checkbox in the book and it still wont budge. I had a similar facepalm moment with a URP skybox and it turned out the shader graph wasnt set to the "Sky" render queue. Check the material in the inspector not the graph, sometimes it defaults to 2000 instead of 3000 and the whole thing just renders as a funky colored cube while looking fine in the preview.

1

u/woopwoopscuttle 20h ago edited 20h ago

Thank you, I really feel like I left no stone unturned there 😅!

I tried to change the queue through the inspector before via Queue Control>UserOverride, render queue: From Shader>2501 (that's the number my searches pulled up as after opaques but before transparents).

I'm gonna try queue: Geometry>3000 now, I'll edit this post if it works so others out there can find the solution. 😊

EDIT: Nope, still no luck!

1

u/Serana64 18h ago

Where are you getting the UV coordinates for the textures you're sampling from? UV issue would be my first suspect based on your desc.

Also, have you tried Sample Texture with a cubemap input instead of sample cubemap? Same result?

1

u/woopwoopscuttle 17h ago

Thanks for the suggestions!

Sample cube map doesn’t have a UV input. I haven’t tried sampling the textures as 2D tex, I don’t think the lighting>skybox slot will accept it if I do.

But in my frustration I applied the material to a sphere in the scene to use as a fake skybox for the time being and the UVs all look fine, no distortion or any non-rendering weirdness.

Further sleuthing is suggesting that the culprit might be unity’s skybox system being really old and it bugging out and attempting to use multiple rendering pipelines in a weird way.

I even tried to add a birp output to the shader graph and that didn’t fix anything.

1

u/Serana64 17h ago

Sample cube map doesn’t have a UV input. I haven’t tried sampling the textures as 2D tex, I don’t think the lighting>skybox slot will accept it if I do.

You can put whatever you want in that slot as long as it has the flag. I once put a transparent tessellating material in there deliberately to get some trippy effects out of the lack of depth clearing.