This is a great tutorial, but one drawback is if the camera is not moving, the stars won't twinkle. I would love to see a variation that has change over time for a static camera, as I just spent an hour or so learning how to implement that.
Hey @bathtubanarchy, well you could use a "sine" node, "remap" it to 0 - 1 and then add it to our "Random range" node, then we will have values that goes from 0 to 2 in "Add" node just remap it again to 0 to 1 and then feed it into "sample gradient" node's time input. That way you will get the twinkle without moving the camera.
Hey, it didnt look good for me at all with simplenoise, but Voronoi looks SO GOOD. I wish i could show you, it really looks like stars. Thank you for the tutorial though it really helped :)
Think of skybox as a sphere so in position node, at the center/origin we will have the highest Y value and as we move away from the origin Y value decreases so by dividing the Y it will kind of keep our texture flat on XZ plane.
@@iDigvijaysinhGhello, thanks for the tutorial. I also have the same question😂 but not quite understand the ans. Why the center/origin of the sphere skybox has the highest Y value? I thought the origin will be 0 with the normalized range of -1 to 1
@@jamasheller224 No worries I will try to explain a bit with more clarity. Think of skybox as a Sphere mesh. Now we are using the position node, which returns position of each vertex of our sphere mesh. So at the centre if we would have two positions. One for very top vertex and we normalised it so it will be 0, 1, 0 and the bottom vertex will be 0, -1, 0. Now as we move away from the center, our vertices' Y will always be less than 1 and greater than -1. So at the end we will get kind of flat texture at top and bottom. And I am really sorry for the late reply, right now I am going through a lot of mess 😅
for some reason using urp im having an issue where the horizon is stretched on play mode. Camera looks fine in editor but as soon as i start the game the horizon is small when the players rotation is around -128. Also for some reason i had to switch the position node to object instead of world because world was still causing strange artifacts with the stars. I was able to see faint squares that stretched when looking straight up. I tried turning off all post processing on the camera but nothing seems to be working regarding the horizon issue
I've been trying to figure out how to pan the stars across the night sky for hours and I'm just stuck. If there's any chance you know of a simple way to do it, I'd forever love you.
Hi Brandon, you could try using Rotate about axis node in our sub graph, just plug our position node in it, and use Rotate about axis node's output and feed it into normalize node and hopefully it works. I have not checked it myself but I will confirm it first thing in the morning tomorrow and get back to you.
@@iDigvijaysinhGThank you! I'm very poor with shader graphs, but I found something that *kinda* works: Tim and float variable feeding into a multiply, then that and a position feeding into a rotate about axis; position to In, a vector 3 variable to axis, and the previous multiply feeding in to the rotation. Main problem with this setup is that, with the way I have things setup, if any other axis besides the Y rotates, you see the polar areas of the sky that kind of pinch the stars together and it looks like a circle, which obviously kind of breaks the immersion.
@brandonhohn245 please discard everything I said on previous comment, I was half asleep 😅 To pan the stars, in the subgraph, just create tiling and offset node. Feed our divide nodes output into UV Then take Tiling and offset node's output and feed it to Simple noise node's UV. Now we can use offset to pan the stars.
Hello, if you are talking about Poiyomi toon shader, then I think it is simply not created for URP or HDRP, you might need to contact the creator on GitHub or discord maybe.
first of all thanks for the tutorial. And i have an issue with my project. I am working on a space rocket game project that i am flying up and stars/noise texture is very disturbingly goes crazy. what to do about it?
Hey, I need to reproduce the issue myself and then I will be able to help you. I'll try my best to get back to you ASAP. Meanwhile, are you on HDRP? If yes, just change Position nodes' space to "Absolute world" because in URP world space and absolute world space are same thing but in HDRP world is relative to Camera for whatever reason and absolute world is the actual world space.
Hey @antonclark608, you could do something like this to avoid the horizon part altogether! www.patreon.com/posts/skybox-shader-85136715 If you still want horizon try to tweak the color and blend values for horizon! All the best.
Hi, Are you talking about the Amplify shader editor? If so, I have never used that, but generally shaders are mostly maths so yeah it can translate easily even between platforms. You can follow similar logic in Unreal as well.
I just learned about the Unity Graph Shader thanks for making this awesome tutorial
I love how you explain stuff and show what works and what doesn't and explain all the things in great way :)
Keep up the great work buddy :)
Thank you, comments like this is my source of motivation to keep going.
This is a great tutorial, but one drawback is if the camera is not moving, the stars won't twinkle. I would love to see a variation that has change over time for a static camera, as I just spent an hour or so learning how to implement that.
Hey @bathtubanarchy, well you could use a "sine" node, "remap" it to 0 - 1 and then add it to our "Random range" node, then we will have values that goes from 0 to 2 in "Add" node just remap it again to 0 to 1 and then feed it into "sample gradient" node's time input. That way you will get the twinkle without moving the camera.
Awesome tutorial!
heeey very nice tutorial....
will you expand on this to part 3 and blend between day and night skybox
Definitely 😁
Great Chanal 👌👌
Hey, it didnt look good for me at all with simplenoise, but Voronoi looks SO GOOD. I wish i could show you, it really looks like stars. Thank you for the tutorial though it really helped :)
Good
Great vid!! How did you figure out that dividing the xz coordinates by the y coordinate fixes the stretching? Really curious to learn why this works!
Think of skybox as a sphere so in position node, at the center/origin we will have the highest Y value and as we move away from the origin Y value decreases so by dividing the Y it will kind of keep our texture flat on XZ plane.
@@iDigvijaysinhG that makes sense, thank you!
@@iDigvijaysinhGhello, thanks for the tutorial.
I also have the same question😂 but not quite understand the ans.
Why the center/origin of the sphere skybox has the highest Y value? I thought the origin will be 0 with the normalized range of -1 to 1
@@jamasheller224 No worries I will try to explain a bit with more clarity.
Think of skybox as a Sphere mesh.
Now we are using the position node, which returns position of each vertex of our sphere mesh.
So at the centre if we would have two positions. One for very top vertex and we normalised it so it will be 0, 1, 0 and the bottom vertex will be 0, -1, 0.
Now as we move away from the center, our vertices' Y will always be less than 1 and greater than -1.
So at the end we will get kind of flat texture at top and bottom.
And I am really sorry for the late reply, right now I am going through a lot of mess 😅
@@iDigvijaysinhGThank you for your reply. Hope everything goes well for you and hoping that the mess is not about the current Unity runtime fee plan😂
for some reason using urp im having an issue where the horizon is stretched on play mode. Camera looks fine in editor but as soon as i start the game the horizon is small when the players rotation is around -128. Also for some reason i had to switch the position node to object instead of world because world was still causing strange artifacts with the stars. I was able to see faint squares that stretched when looking straight up. I tried turning off all post processing on the camera but nothing seems to be working regarding the horizon issue
I don't think object space would help, could you share with me the shader screenshot?
I've been trying to figure out how to pan the stars across the night sky for hours and I'm just stuck. If there's any chance you know of a simple way to do it, I'd forever love you.
Hi Brandon, you could try using Rotate about axis node in our sub graph, just plug our position node in it, and use Rotate about axis node's output and feed it into normalize node and hopefully it works.
I have not checked it myself but I will confirm it first thing in the morning tomorrow and get back to you.
@@iDigvijaysinhGThank you! I'm very poor with shader graphs, but I found something that *kinda* works: Tim and float variable feeding into a multiply, then that and a position feeding into a rotate about axis; position to In, a vector 3 variable to axis, and the previous multiply feeding in to the rotation. Main problem with this setup is that, with the way I have things setup, if any other axis besides the Y rotates, you see the polar areas of the sky that kind of pinch the stars together and it looks like a circle, which obviously kind of breaks the immersion.
@brandonhohn245 please discard everything I said on previous comment, I was half asleep 😅
To pan the stars, in the subgraph, just create tiling and offset node.
Feed our divide nodes output into UV
Then take Tiling and offset node's output and feed it to Simple noise node's UV.
Now we can use offset to pan the stars.
poiyomiとかと共存させることってできるのかな?パイプラインを設定したらURPは見えるようになったけどpoiyomiとかの他のマテリアは全部ピンクになった
Hello, if you are talking about Poiyomi toon shader, then I think it is simply not created for URP or HDRP, you might need to contact the creator on GitHub or discord maybe.
first of all thanks for the tutorial. And i have an issue with my project. I am working on a space rocket game project that i am flying up and stars/noise texture is very disturbingly goes crazy. what to do about it?
also texture is stretching as the player get high. thats another issue for me
Hey, I need to reproduce the issue myself and then I will be able to help you.
I'll try my best to get back to you ASAP.
Meanwhile, are you on HDRP?
If yes, just change Position nodes' space to "Absolute world" because in URP world space and absolute world space are same thing but in HDRP world is relative to Camera for whatever reason and absolute world is the actual world space.
Ive been trying to create a hsader like this without a horizon line but I cant seem to make the seam along the sides of the skybox disapear.
Hey @antonclark608, you could do something like this to avoid the horizon part altogether!
www.patreon.com/posts/skybox-shader-85136715
If you still want horizon try to tweak the color and blend values for horizon!
All the best.
can you do it for Amplify shader?
Hi,
Are you talking about the Amplify shader editor?
If so, I have never used that, but generally shaders are mostly maths so yeah it can translate easily even between platforms.
You can follow similar logic in Unreal as well.
@@iDigvijaysinhG yes sir