Тёмный

Stylized Geometry Grass Shader for Universal Render Pipeline Unity [Pt. 1] 

AJTech
Подписаться 8 тыс.
Просмотров 39 тыс.
50% 1

Next Part: • Stylized Geometry Gras...
A fully functional grass shader that's made for the Universal Render Pipeline, it works without Unity's terrain system and comes with a bunch of features such as lighting, shadows, tesselation! This is the system I will be using in my open world game which I am developing on this channel as well, we will be coding everything ourselves so that you can understand from the base up how everything works.
PROJECT FILES (TEXTURES & MODELS) + COMPLETED PROJECT :
☢ github.com/AJTech2002/Grass-S...
☁ In this video we begin our journey by creating the first of the three shader sections, the Vertex Shader. It's only setup, but it will set the foundation for the remaining episodes, this is a very complex system and will take a few episodes to get fully fleshed out!
* NEWS : Welcome to the community!! I want to congratulate everyone on reaching 3,700 subscribers, this is a collective accomplishment and I thank you all for your support. *
Firstly I would like to apologise for the late upload times I know I announced this video a while ago, I really wanted to polish up the system before I shared with everyone :)
❤ 2020 calls for more social media & interaction with you guys so check me out on, also I hope everyone is safe during this time ❤ :
====================================================
✄ / codewithajay ✄ [TWITTER]
- Daily Game Development Content, tips, motivation, updates on the game & just about my very 'interesting' life.
====================================================
----- LETS TRY AND HIT : 40 LIKES ✌ ---------
★ Upcoming Videos :
- Grass Shader Part 3 ❤
- Open World Series Part 6 ❤
◕‿◕ The next part is even better and in order for you to see it you have to subscribe and tap that bell icon to be notified :
►► / subscription_. . ◄◄
☾ Stay tuned for the next episode, I will be releasing new videos once every 5 to 6 weeks discussing what I have done over the course of the weeks, always giving you some good entertainment with some knowledge on how you can tackle complex challenges in your own games! (◕‿-)
I'll see you next time ✌
✄ IMPORTANT LINKS YOU SHOULD CHECK OUT ✄ :
1. roystan.net/articles/grass-sh... (Grass Shader Blog)
2. gist.github.com/phi-lira/225c... (URP Sample Shader)
3. kenney.nl/assets/foliage-sprites (Grass and Leaf Textures)
OTHER VIDEOS
DEV LOG PART 1
☢ • Video
DEV LOG PART 2
☢ • Video
DEV LOG PART 3
☢ • Video
CUSTOM CHARACTER CONTROLLER TUTORIAL
☢ • (01) Stealth Game - Cu...
INVERSE KINEMATICS SERIES
☢ • (05) Stealth Game - In...
♬ MUSIC ♬ :
☮ Wayr - Follow the light
If any of these videos or music belong to you and you wish for them to be taken down, please email me at : ajays.workemail@gmail.com
Thank you, for watching guys :)
Intro: (0:00)
Setup: (1:58)
Shader Setup: (8:40)
Vertex Shader: (20:00)
Geometry and Fragment Shader: (37:40)
Applying Shader: (45:00)
Outro: (48:15)
#unity #shaders #openworld #stylized

Наука

Опубликовано:

 

25 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 85   
@batchprogrammer108
@batchprogrammer108 4 года назад
Hey everyone thanks for watching the video, hope this helps you all! Fun fact, the first couple of seconds is a sneak peak of my Open World game that I have been working on for a while. In regards to my Open World Series, I am still continuing it and infact this grass shader is one of the things I have been working on, I haven't uploaded much due to school, but like I've mentioned, it isn't a project I will be giving up on :)
@Shamysoza92
@Shamysoza92 3 года назад
Maaaan, this is some great stuff. Great approach and easy understanding of some more complex shaders. Keep up the great work
@KarenKawas
@KarenKawas 3 года назад
Hope you can upload the next part soon! this is super useful stuff. Especially for those, who like me, want to be on the technical artist side of things. keep it up!!!
@krzysztofszczepanski8597
@krzysztofszczepanski8597 3 года назад
Best tutorial on the topic watched all 4 parts and learned a lot! Thanks, Dude!
@batchprogrammer108
@batchprogrammer108 3 года назад
Happy to have helped :)
@eziowayne
@eziowayne 3 года назад
Amazing series!! Thanks soooo much! This really takes some of my personal projects to the next level! Thank you!
@thesapphiredragon8568
@thesapphiredragon8568 2 года назад
Ive been looking for something like this for months thank you
@Pepius_Julius_Magnus_Maximu...
@Pepius_Julius_Magnus_Maximu... 3 года назад
You're resuming I don't know how many days/weeks/months of study into a copy & paste tutorial with clear, technical explanations. You're a god, you've earned a new subscriber, thank you so much!
@batchprogrammer108
@batchprogrammer108 3 года назад
You're very welcome, thanks for the sub and kind words, glad you enjoyed :D
@BKGcode
@BKGcode 3 года назад
Great shader! Looks beautiful
@arsil_
@arsil_ 3 года назад
just when i wanted to learn more about shader in urp, i found you.. awesome video 🔥
@rajinhossain9522
@rajinhossain9522 4 года назад
Also the segmentation is superb. gj
@neatelf9913
@neatelf9913 3 года назад
Dude, you weren't uploading for a long time!! I'm glad you're back. =)
@rajinhossain9522
@rajinhossain9522 4 года назад
You're a legend
@AngeloValentimMerlo
@AngeloValentimMerlo 3 года назад
very cool!!! ty
@ultraxdzn
@ultraxdzn 4 года назад
Bruh dude when youre cooming back on discord, every your video amazes me even more and more woah, you r a legend
@batchprogrammer108
@batchprogrammer108 4 года назад
Hey man, thank you! Just give me a month and I'll be completely done with school then I'll have more than enough time to help with the project, sorry I've been unresponsive.
@ultraxdzn
@ultraxdzn 4 года назад
@@batchprogrammer108 alright bro take ur time, glad that it won't take till November cuz very soon I hope to release demo, I'll try to help you with your project if I can too, but yeah, make gg ez zo school n u free then!
@VictorPitchPlays
@VictorPitchPlays 4 года назад
What? There’s a Discord? Link pls?
@ultraxdzn
@ultraxdzn 4 года назад
@@VictorPitchPlays me and Ajay are working on some project together, there ain't his official discord yet, sorry
@VictorPitchPlays
@VictorPitchPlays 3 года назад
@@ultraxdzn Ah, alright. A pity, but understandable!
@piter2a922
@piter2a922 Год назад
Is there a way to only generate the grass at a certain world height? This is the first tutorial i have found that actually works for URP but i need it so it can onli generate within a certain heights. Ty
@AlansTechnical
@AlansTechnical 4 года назад
Hi, Was Waiting For a Video From This Channel Also, Are you continuing Open World Series?
@batchprogrammer108
@batchprogrammer108 4 года назад
Yessir, this grass is one of the things I've been working on for the project. Unfortunately, I've just been unable to upload for a while due to school.
@AlansTechnical
@AlansTechnical 4 года назад
@@batchprogrammer108 Oh, I dint watch the full video, and came to the comment section and asked you about the openwaorld series, now watching...😋
@carmelorussello7755
@carmelorussello7755 Год назад
Is it possible to add the shader only at a certain height?For example i have my mesh that has different color textures depending on height(grass, sand, water) and i only want the grass to appear on the grass part of the mesh, is it possible?
@ujjwalsingh5188
@ujjwalsingh5188 3 года назад
can you make grass interactive with player . i mean grass move side when player coming
@Indseta
@Indseta 3 года назад
Awesome shader! Is there any way to keep the grass direction up even when the plane is tilted?
@batchprogrammer108
@batchprogrammer108 3 года назад
Thank you :) Currently i extrude the points using the surface normal, but instead of that you can use the global up vector (0,1,0)
@haraldgundersen7303
@haraldgundersen7303 2 года назад
How does it look and perform in VR? android / windows based
@carlol4931
@carlol4931 4 года назад
More Videos pls
@Ryan-xq3kl
@Ryan-xq3kl 3 года назад
can you make a change to the script to make the grass curve or work on curved surfaces?
@batchprogrammer108
@batchprogrammer108 3 года назад
I think the grass should work on curved surfaces already.
@32kuba32
@32kuba32 3 года назад
Is it possible that the grass is instantiated once and then stays the same? In our game we want to move platforms with gras on them but any kind of movement resets and reloads the grass. Is there any way so that doesnt happen?
@batchprogrammer108
@batchprogrammer108 3 года назад
Absolutely, the reason why it resets is because the rand function uses the seed that is based on the world position of the grass, so if you change that to object space then the grass will stay the same :)
@dongiovanni1993
@dongiovanni1993 4 года назад
Thank you for your efforts to share tour struggles. Note that there are dead links in the description (some vidz like CCC tut; IK series). And what about the school. I think, if you'd talk to the staff, they'll let you stay home considering you'll learn their 'ropes' on your own. Why will this work? They burn your time giving the knowledge with the most slow speed possible for everyone of the group to comprehend. And you're self-motivated, and you just don't need this. Just get from them themes that they will teach, and discuss some exams to verify your progress and that's it. And this stupid journeys will become just another line in your todo list. Working with old books is pretty easy. =) If they're too stubborn, there are ways to get some vacation (e g. foreign affairs=).
@batchprogrammer108
@batchprogrammer108 4 года назад
I'm happy to share this, also thanks for pointing out the dead links! Honestly, I thought about doing that a while ago but it's a bit too late I'm about to finish school in a month so I'm just going to get through it and get it over with, but I'm sure this advice would be great for anyone else on the same journey.
@dongiovanni1993
@dongiovanni1993 4 года назад
@@batchprogrammer108 Sure, a bit too late. :( Ma per chi arrivera.. Lucky you, at least you have had this thought. It's fun, but most people while being at school treat it as a real thing, a part of reality. They can never afford the thought that a school is actually just a game. Maybe it's wise to support this deceit to keep the Universe continuity intact. =) But in some rare cases someone just got to say something like "there is no spoon that bends, it's only yourself..." © =)
@batchprogrammer108
@batchprogrammer108 4 года назад
@@dongiovanni1993 Haha I love this! I hope more people see this comment :)
@rredenvous
@rredenvous 3 года назад
Question, is't this performance heavy? I've seen ways to do it by using sprites systems where the grass is a textured plane only. Of course there are many planes but that way we could compensate with the terrain being very low poly...(I'm an extra virgin noob so i don't really know what i'm talking about)....
@batchprogrammer108
@batchprogrammer108 2 года назад
Well considering Geometry Shaders work primarily on computers I reckon you won't see much of a performance hit with some decent culling. However, I would recommend this more for situations where you can't use a terrain :)
@PedroL.Rosario
@PedroL.Rosario 3 года назад
24:29, How you did this? this double line? PS: AWESOME video! me and my friend we looking to made this effect and you is helping a lot! thank you!
@batchprogrammer108
@batchprogrammer108 3 года назад
Haha I think it's Alt + Up Arrow, glad you enjoyed :)
@nomadshiba
@nomadshiba 2 года назад
its cool and all but not many systems have support for geometry shaders
@xxzippyzachxx
@xxzippyzachxx 3 года назад
Is the vertex color based placement of the grass implemented in the complete project? Don't seem to see anything in the shader code for it. Just the initialization of the _VertexColorTesselation variable. Thanks!
@batchprogrammer108
@batchprogrammer108 3 года назад
Yeah so essentially in the Geometry pass of the Completed project you should see these lines at the very top: if (input[0].color.g < 0.1f || input[1].color.g < 0.1f || input[2].color.g < 0.1f) { return; } Now all it does is checks if the vertex colour is green, if not it doesn't draw grass there. You can use Unitys polybrush to vertex paint your meshes, just vertex paint a green colour where ever you want grass :) It's not very sophisticated at all, but I guess you could build upon this relatively easily.
@xxzippyzachxx
@xxzippyzachxx 3 года назад
@@batchprogrammer108 Thanks for the detailed response. I used poly brush like you suggested to add the vertex color instead of Blender (wasn't working for some reason) and now its working great. Thanks!
@batchprogrammer108
@batchprogrammer108 3 года назад
@@xxzippyzachxx Awesome, that's great to hear! I'll try look into why Blender's vertex colors aren't working, but it may have something to do with the mesh import options but I'm not too sure.
@xxzippyzachxx
@xxzippyzachxx 3 года назад
@@batchprogrammer108 Ah yes I needed to make sure the vertex color information was coming from the blender import. Works now
@ZGX3D
@ZGX3D 3 года назад
Any info on when the next part is coming out?
@batchprogrammer108
@batchprogrammer108 3 года назад
I just released it!
@abraxysjax6630
@abraxysjax6630 2 года назад
Do you have a patreon link? Your tutorials are really great!
@batchprogrammer108
@batchprogrammer108 2 года назад
Thanks I really appreciate that! I don't have a Patreon right now as I'm not so active on RU-vid :)
@Razlar123-sx2bm
@Razlar123-sx2bm 3 года назад
Mine says fail to compile
@hyukioshiygames2873
@hyukioshiygames2873 2 года назад
Are grass Shaders lighter for the pc to run other than using the terrain grass?
@batchprogrammer108
@batchprogrammer108 2 года назад
Terrain grass might be equal to or faster, this solution is good when you don't want to use terrain system and when you want to customise its behaviour
@hyukioshiygames2873
@hyukioshiygames2873 2 года назад
@@batchprogrammer108 Thanks Man! Love you videos by the way!
@CineShivansh
@CineShivansh 3 года назад
Showing pink material when ported to android devices, any solutions?
@batchprogrammer108
@batchprogrammer108 3 года назад
Nah sorry mobile doesn't support
@MegaCX
@MegaCX 3 года назад
can it be done with graph nodes?
@batchprogrammer108
@batchprogrammer108 3 года назад
Nope
@stephanzoes8010
@stephanzoes8010 3 года назад
Does this HAVE to be on the udrp?
@batchprogrammer108
@batchprogrammer108 3 года назад
Or hdrp but you have to make some changes, if it's on the standard one it's much easier than this, follow roystans tutorial in the description
@scratchydev
@scratchydev 3 года назад
does this work on hdrp?
@batchprogrammer108
@batchprogrammer108 3 года назад
You may have to modify it a little bit but the core logic will work
@davecho45
@davecho45 3 года назад
Can I use this in unreal? Please say yes
@batchprogrammer108
@batchprogrammer108 3 года назад
Not the exact same code, but the concepts should carry over to whatever shading language ue4 is using.
@ImKingReal
@ImKingReal 4 года назад
hey what is your pc specs?
@batchprogrammer108
@batchprogrammer108 3 года назад
I used to use a laptop, but recently I bought a gaming PC: Graphics Card: RTX 2070 Super CPU: AMD Ryzen 7 3700x RAM: 16GB Storage: 500GB SSD MOBO: Gaming Carbon WIFI b450
@ImKingReal
@ImKingReal 3 года назад
AJTech ok thanks.
@Nokdef
@Nokdef 3 года назад
Did anybody manage to get this to work on HDRP? I tried messing about with the code with no sucess :/
@batchprogrammer108
@batchprogrammer108 3 года назад
Hey, you might want to check out this link: github.com/keijiro/TestbedHDRP He has a bunch of HDRP Geometry shaders, however I think the only few adjustments you would need to make are to change the RenderPipeline tag within the shaders. Tags{ "RenderPipeline"="HDRenderPipeline" "RenderType" = "HDLitShader" } Something like this, instead of the existing tags; you will also have to change the package includes to include the HDRP files rather than the URP files. This specific shader might help: github.com/keijiro/TestbedHDRP/blob/master/Assets/CustomShader/Voxelizer/Shader/Voxelizer.shader Good luck, and if you get it working it would be great if you could upload a link to help everyone else out, thanks! :)
@Nokdef
@Nokdef 3 года назад
@@batchprogrammer108 Perhaps I'm abusing your kindness, but I managed to do most of the transition (I assume) and now it only returns one error, I made a unity forum post to bring more light to my issue, in case you know how to solve this problem as well here is the link: forum.unity.com/threads/converting-urp-shader-to-hdrp.998848/ Anyhow, thanks a lot for the tutorial, and if I solve this I'll def post the link here in the comments for others to enjoy.
@batchprogrammer108
@batchprogrammer108 3 года назад
@@Nokdef Don't worry about it at all, I'm only making this content to help out the community. I'll take a look at the error you're having and see if I can come up with a solution! I just had a glance over it, and I'm honestly a bit lost; I haven't played around much with HDRP so I don't know how useful I can be to you, but I'll try re-create the grass myself in HDRP and see what I come up with :)
@Nokdef
@Nokdef 3 года назад
@@batchprogrammer108 Only your talents surpasses your kindness! Thank you so much. I never interfaced with geometry shaders before too, so I'm scratching my head as I look through the code. I'll still look around for a solution!
@farrelrabbani7655
@farrelrabbani7655 4 года назад
Hello
@batchprogrammer108
@batchprogrammer108 4 года назад
Hello :)
@wonderingpixel
@wonderingpixel 3 года назад
I am watching the video just to give you watch hour
@batchprogrammer108
@batchprogrammer108 3 года назад
Hahah thank you!
Далее
Выпускаем трек? #iribaby
00:14
Просмотров 494 тыс.
Unity | I made an Interactive Grass Shader + Tool
8:26
Simulating Wind in URP (Shader Graph Tutorial)
6:59
Просмотров 76 тыс.
Unity procedural animation tutorial (10 steps)
1:05
Просмотров 402 тыс.
How to Create Ghibli Trees in 3D - Blender Tutorial
29:36
#engineering #diy #amazing #electronic #fyp
0:59
Просмотров 2,1 млн
Prices & Poco M4 Pro 5G
1:00
Просмотров 272 тыс.
#samsung #retrophone #nostalgia #x100
0:14
Просмотров 8 млн