🎁 FREE High-quality assets: bit.ly/2dhp-free-yt 📦 Download the Unity project: github.com/notslot/tutorial-25d-game-unity 📚 Read: notslot.com/blog/2019/12/_25d-game-in-unity-part-2 💬 Need help? Ask me here: worth.yt/nirlah 🐙 Unity Graphics new repository: github.com/Unity-Technologies/Graphics
@evanderzenmartin5684
Жыл бұрын
Hello.. Nice tutorial. Now I wanna ask you. how to make a depth effect on lit shader? In your tutorial, you were using unlit sprite. Thank's in advance
@Pixel_J
4 жыл бұрын
You have no idea how long I have been looking for something like this. Thanks!! Will this shader work with unity’s new 2D lighting system?
@NotSlot
4 жыл бұрын
Happy to hear it helped! In the video, we are working with the unlit shader variants - I assume we can do a similar manipulation for the lit shaders.
@Pixel_J
4 жыл бұрын
NotSlot wow, can’t believe you replied so quickly. Thanks again, definitely gonna subscribe :)
@PeterMilko
3 жыл бұрын
bro these are amazing, i do pixel art and plan to make a 2.5D game
@NotSlot
3 жыл бұрын
Awesome! Would love to see the progress...
@Fuzzel
4 жыл бұрын
The critical point it writing to the depth buffer. The default sprite shader in Unity is a transparent shader which inherently shouldn't write into the depth buffer because it would defeat the purpose of having transparency (in most cases). A simple cutout sprite shader would be an opaque shader that writes into the depth buffer. From my own testing, I achieved the same effect by using an opaque cutout sprite shader using the Shadergraph in UWPR. Is there any benefit from doing it your way, I am missing? Because from the changes you make from the standard UWPR shader, it appears you basically do the same thing...
@NotSlot
4 жыл бұрын
Hey, thanks for taking the time to write down about your tests. You are correct that using Shader Graph yields the same outcome - the main difference is efficiency. Shader Graph adds quite a lot of bloat to the shader, and since thousands of objects may use this shader, I preferred the more performant but less intuitive approach.
@Jangwhoan
4 жыл бұрын
Thanks for the great tips NotSlot! Could you also do quick tip on howto use depth of field while using lwrp 2d pipeline? It might be the similar reason. Thank you!
@MilesWingsOficial
2 жыл бұрын
I using this tutorial in my game but I'm having a problem. The shader works fine with the environment, but my character is a multi layered sprite, so as soon as I add the shader on it, it looks like a overlapping mess. My game has multiple character like that, so they should not overlap.
@nicopardooo
3 жыл бұрын
Wow, impressive. Thank you, you are a lifesaver 😁😁
@NotSlot
3 жыл бұрын
Always happy to help :)
@ToonSoulsGame
2 жыл бұрын
Instead of Depth Shader, I think you set Camera to work with perspective and Sprites GetComponent().transparencySortMode = TransparencySortMode.CustomAxis; GetComponent().transparencySortAxis = new Vector3(0.0f, 0.0f, 0.0f);
@evanderzenmartin5684
Жыл бұрын
Hi.. Would you mind elaborate a little bit more about this?
@evanderzenmartin5684
Жыл бұрын
where do you put the code?
@AnnaGlin
Жыл бұрын
I would also like to know
@tttrrrrt1229
2 жыл бұрын
Thank you friend! Using this method, I made a shader that reacts to light. Thanks!
@NotSlot
2 жыл бұрын
Awsome!
@evanderzenmartin5684
Жыл бұрын
How did you do it? I'm trying to add shadow to my shader
@tttrrrrt1229
Жыл бұрын
@@evanderzenmartin5684 I just used SimpleLit Shader instead of UnLit. At that time, I didn't need shadows. It was a long time ago. Now I would use ShaderGraph to create the shader. I would make MatCap Shader. To simulate lighting. Maybe you should look for information in this direction.
@evanderzenmartin5684
Жыл бұрын
@@tttrrrrt1229 okay.. Thank you for replying
@evanderzenmartin5684
Жыл бұрын
@@tttrrrrt1229 Hello. I'm looking into the information you told me... But it seems about an object receive a shadow. What I need is how my object can cast a shadow, but still have depth rendering like in the video Once again, thank you for replaying
@helicalius
4 жыл бұрын
Meddling with Render Pipeline scripts is a scaaary practice
@NotSlot
4 жыл бұрын
Yep, wish there was a safer method for adding depth writing to sprites 👷
@helicalius
4 жыл бұрын
@@NotSlot BTW though of something, try reducing as much as possible the Rendering camera far and near clipping planes. In some cases there is Z fighting like in your project due to floating precision errors, produced by the far to large ranged clipping planes
@NotSlot
4 жыл бұрын
Thanks! Will give it a try...
@joshuarobinson7422
3 ай бұрын
Thanks!
@koko0riginal
4 жыл бұрын
I would like to learn about why and where to look for references for this topic, currently it feels more like a how to copy-paste video :)
@NotSlot
4 жыл бұрын
Hi Arial, Sadly, the built-in shaders is not a field that is well documented by Unity. There is somewhat of improvement for the new Scriptable Render Pipeline, but for most, the best way to get familiar with the shading of the render pipeline is by digging into the source. The purpose of this video was to specifically solve an issue that arises while creating a game with this 2.5D art style, and not cover the whole topic of shader of URP. If there is a specific topic you are interested in - please let me know :) Anyway, an excellent place to start is by looking into the docs & source code of the SRP: github.com/Unity-Technologies/ScriptableRenderPipeline docs.unity3d.com/Packages/com.unity.render-pipelines.core@7.1/manual/index.html docs.unity3d.com/Packages/com.unity.render-pipelines.universal@7.1/manual/index.html
@koko0riginal
4 жыл бұрын
@@NotSlot thanks! And keep up the amazing work, you are killing it (:
@s4nzyG
2 жыл бұрын
Hello, your tutorials on this 2.5D project have been most insightful and helpful! I have one question about this process, maybe I'm missing something. After I apply the Unlit Sprite Material to all the objects in the scene, every object changes color. It becomes either pink or white, like with blending modes in Photoshop. Is there anything I could do to avoid this effect?
@wormholeinteractive
Жыл бұрын
The pink appears when your object doesn’t mesh well with the current shader. To fix it, you need to change the materials to the proper shader.
@deuterocanonico
2 жыл бұрын
I am a newbie in Unity and I am quite disoriented. how did you realize that the problem was the shader? Do you have any documentation I can refer to? I want to learn more about this problem. Could you make a tutorial on how you approached this problem from the beginning? It would be invaluable information. Your channel has been my most precious discovery. Finally, could you recommend me a learning path for these topics? Thank you so much for your work
@NotSlot
2 жыл бұрын
Hey, the problem was not the default shader by itself, rather the way Unity renders sprites. The modified shader is just a proposed solution (one of many) for the ordering issue. Real-time rendering is a vast topic, so you can expect to learn as you go...
@suchabs
4 жыл бұрын
How do you handle z-fighting? I use 2d animation package and multi-sprite characters has the z-fighting issue. Can't change the z values either, that breaks the animations.
@EonsAway
4 жыл бұрын
Hiya. I got it working but now the edges of the unlit sprites are jagged. I have turned the AlphaCutout up and down but then it only get worse.
@NotSlot
4 жыл бұрын
Thank you for watching! A "hard cut" edge is one of the downsides of this approach :/ We tend to create the assets accordingly with a harder edge... Setting a different AlphaCutoff for problematic assets is actually something we found useful for some of our assets.
@paufenollosa
Жыл бұрын
@NotSlot What should we change if we want a transparent sprite intead of a cutoff sprite? Thanks!
@specstrem
4 жыл бұрын
Thaks for the great Video it helped a lot! But can you show us how to manipulate the Lit shader so that the sprite can receive and cast shadows?
@NotSlot
4 жыл бұрын
Hey, already discussed this - look in the comments for a solution 😉
@snell9444
4 жыл бұрын
Is there a way to apply 3D lights and shadows to this shader?
@NotSlot
4 жыл бұрын
You would probably want to take a look at modifying the lit shader instead of the unlit one.
@evanderzenmartin5684
Жыл бұрын
@@NotSlot Hello! How about a little pointer about how to do it? which sahder should I change, and what thing's I need to do?
@SpiceLag
2 жыл бұрын
Hi ! Loved your shader and your video, just wondering something. The shader works great making a material based on it, and when I export my game, works perfectly on Windows OS. But then, I tried to switch to WebGL Build platform, but oh surprise, the material based on the shader won't work. So, I need to ask... Is there any way to make the shader work in WebGL? Or I am asking too much? I read in the forums that certain parts of Shadergraph are not 100% compatible with WebGL, so I don't know ... Thanks in advance, love your videos!
@NotSlot
2 жыл бұрын
Hey Sebastián, TBH, I don’t have much experience with WebGL...
@SpiceLag
2 жыл бұрын
@@NotSlot No problem, thanks for the quick answer!
@PaonSol
Жыл бұрын
Are these shader hacks still necessary this many years later?
@alexturnerfilm
4 жыл бұрын
The Unity Github link provided no longer works! Could you please show us another way to find those files?
@NotSlot
4 жыл бұрын
Thanks for the heads up, I updated the link: github.com/Unity-Technologies/Graphics
@Erniath
4 жыл бұрын
Hi, thanks for the video. I tried modifying the shader files like you said for Unity 2020.1.4f1, which seemed to work the same as your tutorial except there were a few more includes to replace in the shader file. However, once I did this, the material has an issue and displayed pink. I then tried downloading your files from github, but that also displays pink in Unity 2020.1.4. Any idea why this might be?
@NotSlot
4 жыл бұрын
Make sure you are downloading the shaders from the same URP version you installed in the package manager.
@Erniath
4 жыл бұрын
@@NotSlot Thanks for the quick response! My URP package is on version 8.2.0. I tried copying the files directly from the "Universal RP" folder in my packages just to be sure I had the right versions, but modifying those still didn't work (it's worth mentioning that I wasn't able to find UnlitInput.hlsl in my packages folder, so I just used the one from your github. Later today I'll try a sample project with the same versions of Unity/URP that you used in the video, just to confirm that it's not my user error.
@Erniath
4 жыл бұрын
@@NotSlot I figured out the issue. Since I was applying this to an existing project, I didn't start from the URP template. This meant that my Scriptable Render Pipeline Settings weren't correctly set up. After copying over the settings assets generated from the URP template, I've got it working. Thanks again for the video! I've been looking for a 2.5D solution in Unity for a long time now, and this works great.
@NotSlot
4 жыл бұрын
Great! Thanks for sharing the issue and the solution 🙏
@paufenollosa
Жыл бұрын
You can also find your Unitys version shaders and hsls in: Packages -> Universal RP -> Shaders
@betinamascenon4675
4 жыл бұрын
Sadly I can't seem to find that repository anymore :'(((
@NotSlot
4 жыл бұрын
No worries! The link was updated to: github.com/notslot/tutorial-25d-game-unity
@midimusicforever
3 жыл бұрын
does this hack work the same on Unity 2021?
@NotSlot
3 жыл бұрын
Yes, although the shaders are a bit different.
@midimusicforever
3 жыл бұрын
@@NotSlot Different in behavior or just in looks?
@NotSlot
3 жыл бұрын
URP 11 is a bit different than URP 7, therefore the shaders have changes a bit technically. The look is the same.
@midimusicforever
3 жыл бұрын
@@NotSlot Ok, will it be obvious what I should do instead if I try to follow your tutorial using 2021?
@gam1821
20 күн бұрын
Oh lord that's terrible what have I done
@banzeirao
4 жыл бұрын
This is not about create shader, is about to copy shader
@noonoox12
3 жыл бұрын
Heya! This method is exactly what I need for my game, but I'm not using the new render pipeline system (for a variety of reasons). How would I pull this off without URP? This process seems different in the regular version of unity.
Пікірлер: 69