An easy way to optimize the grass more is to disable them from casting shadows. They can still recieve shadows from other objects but won't cats any themselves.
Tip: have the grass models be only two triangles. One upside down and one right side up on top of it. This will allow you to speed up the game tremendously without sacrificing too much. The grass in Breath of the Wild is actually only two triangles as well.
Good video! A good next steps for your optimizations are: Textured cutouts rather than full poly grass. Occulusion drawing (rather than drawing everything from a circle. Do it like the line of sight) Lod grass. The farther the grass the less detailed it should be~ Then colored grass would be an awesome next visual xD
We're reaching a point where polygons are so cheap to render that textured cutouts aka opacity masking may actually be more expensive in some cases, mostly due to overdraw.
@@TechArtAlex it depends, specially which part of the old will you use it. also cutouts arent taxing to where I've been using it. the polygon problem isn't a big deal until you use it on hundreds and thousands of objects like what happened in the video. you can see on his stats alone the GPU really took a toll. even just shaving a few polys would be good enough. Neglecting polys can be a huge bottle neck on optimization in the future.
I like the tree shaking a lot more than the camera doing so. Maybe just add the screen shake on the last hit, when the tree explodes (Or when it hits the ground in the future perhaps). I think the problem with the tree shake right now is how the base of the trunk is moving, when really that part should be static. I think you should use the camera shake when getting hit by enemies instead, maybe add a red vignette or a blue one since you play as a robot (electricity/sparks).
@@overphildev in the same way a grass shader will morph the grass mesh more at the top that the bottom you could apply the tree shake more at the top than the bottom
I feel like there's too much grass, maybe have areas with some less dense grass clumps and areas where theres none at all, ferns and different species of fauna will help as well Also a way to improve performance further is make it so the further away something is from the player the less polygons it uses so you can be be able to render in the entire map from one spot as well as increas ethe performance of the game.
With GPU instancing you can still do scale variation for free so that can help so it doesn't look so uniformed and it can help hide holes and reduce the amount you need on screen. Also you probably don't need to apply Wind (World Position Offset) for grass mid to far from your character.
This is the way. LOD is a must have for any kind of outsy game. Keep that in mind for trees, grass, rocks, whatever you put in the world. Even enemies/other players (in multiplayer) can dramatically impact performance (or lack thereof). Just mind how you do LOD because it might become visible that you're doing it if done wrong. usually the best pointer is trying to keep the silhouette the same regardless of LOD.
Some tips on how to improve the grass (stolen from Breath of the Wild): - Zelda renders every blade of grass separately. It uses a straightforward model with 8 vertices for the sides (4 on each side) and another 4 in the vertical center. This allows you to make the blade more 3d like by bending on the two vertices in the middle. This 3d model has the shape of a rectangle and isn't in the shape of a blade. It uses a texture of a grass blade that bends however you modify the 3d model. This allows you to have a more complex texture. I hope I described that enough. Just ask for more information. - To increase the grass distance, replace the (already simple) model with another one that is more simple with like 6 or 4 vertices in the distance. It will look like normal grass at that distance and you don't have to animate it which also improves performance. - At a certain distance, don't render every grass blade. Render only every 2nd or 3rd or 4th blade. - Don't let the grass blades pop in. Use a smooth transition to fade them in or out. As I said if something is unclear or if you have some further questions, just ask. Maybe I can help :)
I think the sky box does really improve the look of the game. one thing I would say is that it looks more realistic than everything else in the world right now so that's maybe why it looks a bit off. maybe you could add some really simple looking cartoonish clouds that slowly move off and disappear a bit like how the Minecraft clouds do. anyways loving the game :)
You should try scrolling a noise texture over the ground to make it feel like the clouds really exist. This would really help make the world feel more real and immersive.
I’d suggest having geographic landmarks in your world. It’s a good way to not get lost when exploring a new world. For example in ARK Survival there are unique terrain features in different locations. Once you see a giant mountain or cave, you know where you are! Regardless, loving the content, keep it up! Really enjoying watching the progress!
Nice progress as always! I think for the terrain, it might improve the look of the hills by increasing the roughness of the perlin noise to combat that smooth look - maybe even increasing the roughness only on the hills, so that you still keep those nice rolling grassy meadows. Also spawning rocky cliff pieces on steep terrain could help with it looking bare when the grass stops - not sure what the performance would be like though. Keep it up!
I want to say this is an really good start to making terrians! I am struggling rn with developing mine for my new game and I want to say don't let this part of level design mess with you. it takes a long time but in the end it will determine the game level
when you see hills, in real life or virtual, you wll get a sense of perspective. Suddenly you realize how 'far' away stuff is, how grand the scenery is.... so adding a few distance hill might give a sense of 'scale' to your world too. Great to follow your work!
i think that making the top of the grass brighter or the bottom darker would be a great effect to fake ambient occlusion, also randomly scaling the grass can make it look more natural
It's first video I saw from you and it's so nice watching ur journey of making a game. I was sure you gonna mention the way of rotating grass-faces to face player's camera, it wouldn't look as good as the final result though so nice work so far
I suggest making LOD models (level of detail), basically the model gets less and lass detailed the farther away from the camera it is, so it will look nice close to you and you wont be able to tell that it looks bad far away, and if you want to have, lets say, a mountain, it would look weird to have it be completely smooth, so you can have it just be low poly and it wont even be noticeable, hope this helps :)
Vegetation Studio is on sale from time to time and really worth it. I'm experimenting with a scene right now that brings Unity standard terrain trees and grass down to single-digit frames while VS still runs it at 50 fps.
Woah, the game is really taking shape, can't wait to see what comes next! Also, I personally like the flatter terrain, I think it it fits with the overall feel.
Grass is an absolute nightmare in Unity. Perhaps remove the realtime shadowing of the grass and add a gradient to the grass texture instead? Another neat trick I learned was to fade the grass' opacity into the ground similar to how soft particles work. :)
I didn't know a thing about GPU instancing before this video so thanks so much man! For the global look of the game I would add a bit of post processing effect like bloom and motion blur and other shiny stuff like that. But I think what would improve it instantly with no cost is to just activate the fog in lighting options in rendering (assuming you work with Unity). That could really give a sense of depth and distance to your game!
@@overphildev yeah it's just one box to tick! Just be careful with the linear fog, it was my favorite one but for some reasons it just doesn't render in the build...
There is a free asset called ' per layer camera culling' that can do a lot of heavy lifting for that type of optimization. You assign objects to a layer, and then set the distance to show objects on that layer. For instance, I have a layer called ' tiny ' and add all little sticks, sea shells, acorns, weeds and stuff like that.. and have the distance at 10 meters. and it just works. Since the layer of a prefab is set in the inspector, it doesn't matter if it is pre-placed or added at runtime.
Looks already pretty nice :) and I totally agree not having grass in your game is not an option in 2022. Small remark: You could also use a noise texture that spans across your world for color variation of the grass: For each grass object you would look up the value of the noise texture and use it as a multiplier. In this way you can get darker / lighter grass very cheaply. You can also move the noise texture (or use another one) to simulate cloud movement.
I think a cool feature to add more life into the map would be different type of terrain/biomes. Possibly like snow terrain, sand terrain, etc. Just a thought!!
Fantastic vid! Im not sure if this has been menitioned yet but I think if you are having issues with finding items on the ground you could take a borderlands approach and add a small beacon on each item depending on the type and rarity of the object. Also subscribed, I love finding more game dev youtubers
There are couple of things to do with grass but one is frustum culling with jobs and burst. The other is a little harder but effective. It is by writing a software rasterizer for grass and drawing it by yourself to the screen.
I think the game "pops" a lot more with brighter colors and lots of green vegetation. It adds a lot of juxtaposing visuals with the white robots in a way that adds clarity and makes the game look visually interesting.
About instancing, obligatory: Your models are already sent to the GPU. The problem is just that issuing draw call is costly. Doing thousands of draw calls every frame is worse than doing one instanced call, even if they are rendering the same amount of geometry What you could've confused was a thing in OpenGL or older Direct3D where draw calls are actually blocking, like IO. Doing a draw call in those stops CPU from executing until the GPU acknowledges it finished work
For game optimization you might want to try altering the grass density bases on distance from the player. An area that’s far away but still in a loaded chunk doesn’t need to have as much grass to look convincing
I think the tree shake looks better than the camera shake. Maybe try shaking it without moving the object origin (assuming the origin is the base of the tree) so it looks less like the tree is just shivering 'cause it's cold.
Next step in optimisation is frustrum culling! Unless it is on, which i don t think so! Basically, it makes the game render only what the camera can see! That will definitely improve performance by alot! Also, good luck! Game starts to look good! Keep up the good work!
The sky box makes EVERYTHING better its much better but a different HDRI sky box would probably do the same for the game so tweak it how you want 👍 the game is also at the point where i think the Graphix are good enough that it wouldn't be something to stop me from buying it and wouldn't annoy me.
I would change the ungrassed grass texture to look more like the grassed grass, so the ungrassed grass doesn't look so flat, cause it stands out a lot even though it's at a distance.
I like the new light level, I didn't notice anything really off about it. I also would add in culling if you haven't already, or making grass further away from you have a lower detail mesh (maybe just 3 vertices for the furthest grass before it stops being rendered)
the actual best way you could've done the grass so it does lag is to code it so it makes one BIG object that covers the whole land and so the GPU only needs to take care of one ( code it so it ray traces the whole map and finds the exact angle and depth the grass needs and join all the grass objects together )
I agree the comments saying the grass should be a bit smaller. Either that or maybe you could make the robot a larger? Anyways, I am always excited to see improvements you make. Great job!
For the grass personally, i think you should have 'patches' of grass in the chunks, instead of having 100% filled, see if you can lower the amount of grass anyways (maybe it improves framerate). And also perhaps make the grass a bit lower in height. With Mountains/hills, i think you should have some hils, and if you are planning on implementing mines/caves in your game then at least a couple mountains with caves in them would be a nice atmospheric change. (myb have loot chests in the "mountain caves")
bro literally just discovered Frustum and Occlusion Culling (where he deletes grass that you don't see), and mixed it with World Streaming (where he generates parts of the map that matter to you, and de-renders the rest), all in one video. Good job :)
I think you can improve the processing speed if you decrease the tesselation based on distance and make further away parts less dense. I had a similar issue to you where I needed grass in a low poly proc gen vr game I was working on and I modified some code I found online to work like this, and I went from sub 60 fps to well over 100 or more if I recall correctly.
if (averageDist >= _TessellationDistFar) f.edge[0] = f.edge[1] = f.edge[2] = f.inside = _TessellationUniformAtFarDistance; else if (averageDist >= _TessellationDist) f.edge[0] = f.edge[1] = f.edge[2] = f.inside = _TessellationUniformAtDistance; else f.edge[0] = f.edge[1] = f.edge[2] = f.inside = _TessellationUniform; even i hardly understand the code (i know very little about shaders) but it just has 3 density settings for the grass tesselation so that distant grass is less dense, which can even remove the harsh lines caused by render distance cut offs I'm sure there is a smoother way to do this though
Additional to Shadows, if you disable directional shadows you can add contact shadows in its place, it's much cheaper solution if you still want to keep shadows (however not necessary for stylised games). Also consider additional camera frustum culling of your chunks, this adds some CPU cost on top but it has an additional save to GPU from not rendering behind view. Mesh vertex density The smaller the triangles to pixel ratio is, the absolute worse GPU processing will be, along with alpha cutout overdraw, these two alone can cripple performance more than the amount of veggies. Finally frame debugger, you want to check this regularly that your instancing or instancing indirect meshes are correctly rendering and not failing forcing it through a different render loop ( or worse a static batch render which should already be disabled.) GL :3
Presumably you can also use an LOD system with the chunking as well to switch to basically just simply billboard textures when it's further away and you still want something but it doesn't need to be as good.
Little Feedback: The flatter world is a 50/50 for me, I liked those mountains but the plains appear to ne nice too. One Part I dont like atm is the new shaking Animation. I think the old one where only the tree shakes was great, so you could change that back… also it is really annoying when the camera shakes all the time. You can do that at heavy attacks or earthquakes, Stuff that doesnt happen that often as punching trees. Another great Improvement was the sky, I really like the look of it. Keep the great work up, I really enjoy ur content
These changes are great! I cant even Imagine how long it took. I think the lighter sky complements the world well and you should keep it that way but maybe have transitions for things like fights or night. idk. But keep up the crazy coding man
Since you mentioned Horizon and this video is largely about optimisation(like most game dev stuff really) it reminded me of that Horizon behind the scenes thing where you can see which chunks of the world are being rendered when the camera moves. It's here if you wanna see what I'm talking about. Horizon has like hour long developer videos about how they did their foiliage in general, like placement and design and how it's rendered and stuff, might give ideas for this even if you would be doing a much more basic version. /r/gaming/comments/7v85ff/heres_whats_happening_in_horizon_zero_dawn_every/
I would test if a max cull distance for the individual grass instances would improve the performance even further. I read some people who advice you to use grass meshes with 2 polygons only. I wouldn't say that this is always the best option, as in some circumstances this can lead to quad overdraws very easily (if you heavily rely on the alpha texture and have a lot of unused space in your grass mesh), which decrease performance and you have a hard time giving your grass a wind animation which makes them much more alive and less static. I would recommend to use more polygons and model the grass so it kinda has the form of a single grass, and use a alphacut texture to make it look more detailed and use your uv space more efficiently. This way you can reduce quad overdraws. Then use LODs to reduce their polycount over distance. That's what i do with my grass in unreal, but i think that in unity it shouldn't make a big difference.
I would look into crafting an auto material with multiple grass types, dirt, rocks sand, underwater coral, seaweed and even bushes and ground clutter and based off of predetermined height and slope it will apply the correct material and meshes to your landscape. I have created quite a few for unreal I haven't used Unity in awhile but I'm fairly certain this is possible there as well. It takes a bit of time to set up and tweak to our liking but it will drastically help speed things up when prototyping new levels in the future.
I have to say, the brighter Version sure suits the Game a lot more! The Style in which everything is rendered suits the more poppy colour you get from the new Skybox! I'd keep it. Makes it a lot more Cartoony.
Maybe you could introduce some randomness to the density of the grass patches and the coloring of the grass blades. Off-coloring each individual blade and perphaps shading them depending on their height could make them pop out more and look less like one uniform green grassy shape. Also, lod grass could help the performance issues, you don't need that many polygons, especially for grass that is further away.
Howdy. If you are going to get an asset from the store I would highly recommend Amplify Imposters. It can make any game object that you have on your map an imposter and will really improve the FPS to it. Basically it turns the 3D object into a 2D plane and can really improve performance. The object will still look 3D. And at good distances you wont be able to tell it is a 2D plane. Also make sure you lod everything. Either by getting a LOD generating asset or doing it manually in a 3D program. Lods really help in that department. Mantis LOD Editor - Professional Edition comes with a standalone program to lod objects. And makes it easy to lod things directly in the editor or in the standalone program. Lastly I would actually get Vegetation Studio it would really help with rendering grass and trees. But wait for when assets go on sale. Or get them through humble bundle. Having assets can actually make things go a lot better in the long run.
You can absolutely use GPU instancing on trees. Collision isn't done on the GPU so that shouldn't be an issue. Though that should basically be a checkbox on the tree material to tell the game to do so inside of Unity. But if you could only instance completely static objects that are never altered it'd be completely useless in anything other than a static scene.
If your thanking on making a terain editing tool or something alike the you should to that soon because it's going to be very hard implement that in the future.
i think if you made the light from the sky warmer or changed the time of day to be closer to dawn/dusk that the feel would be much nicer. also you could not only chunk the grass, but allow chunks that are farther away to be lower res?
Around 4 minutes you're basically talking about LOD, where grass is rendered 100% when close, and 0% when far away. You could investigate how it would feel if you use a gradual fall off, multiple levels of LOD or even use a texture that looks like grass stems. This would also help when the game is played on low graphics settings, where foliage rendering is simply way too much.
Great video! I'm not in a state, where I can write a proper constructive criticism, I need time to collect my thoughts, but I wanted to write a comment for the algorithm. Expect to see this comment change soon.
You should try maybe making the grass shorter and adding some bushes and/or small flowers, you could probably take some inspiration from @Codeer , their game looks similar to yours For example, fog
@@overphildev I am working on a similar thing and its based off some older work so if I remember when I get round to it I will send some info if you like.
Rather than using an actual, modeled blade of grass, use a flat plane (you can use 2 flat planes in an X pattern for an even better looking result) with an alpha clipped/transparent grass texture. This allows you to have multiple blades of grass per grass instance since the blades are actually just a texture and keeps the poly count even lower than what you have here. As well, you can cover a larger area of terrain with one grass instance this way. This is how games have done it for years now, great examples being the elder scrolls oblivion/skyrim if you want a good example to study (oblivion especially has really dense grass despite being a game from 2006 this way).
I'm in a similiar situation as you were xD. I'm making a game about fishing and defending your island from planes (yeah sounds weird ik xD). My terrain is also procedurally generated. Right now it looks ok but your video convinced me to add grass since it did really help your game so I think It'll work in mine too.
An easy way to optimize the grass more is to disable them from casting shadows. They can still recieve shadows from other objects but won't cats any themselves.
I'll try it out
Thats true
Why aren't you uploading a video.For me it jas benn A WHOLE MONTH
@@overphildevand frustum culling is amazing too
At the cost of great graphical quality reduction. If you can, supplant the grass shadows with screen-space shadows.
Tip: have the grass models be only two triangles. One upside down and one right side up on top of it. This will allow you to speed up the game tremendously without sacrificing too much. The grass in Breath of the Wild is actually only two triangles as well.
That's very interesting I'll have to try it
do you mean like a rhombus?
@@remus-alexandrusimion3439 Yes, but have the bottom triangle be much smaller than the top one
@@seekpodcast Or just one triagle! 2 grasses for the price of 1!
@@Chris-jo1zr 1 triangle looks a bit off. I’ve tried it myself. I think you definitely need at least 2.
Good video! A good next steps for your optimizations are:
Textured cutouts rather than full poly grass.
Occulusion drawing (rather than drawing everything from a circle. Do it like the line of sight)
Lod grass. The farther the grass the less detailed it should be~
Then colored grass would be an awesome next visual xD
Thanks! Looks like I have a long way to go on grass still
agreed
Just seen this and agree, my msg is now useless haha
We're reaching a point where polygons are so cheap to render that textured cutouts aka opacity masking may actually be more expensive in some cases, mostly due to overdraw.
@@TechArtAlex it depends, specially which part of the old will you use it. also cutouts arent taxing to where I've been using it. the polygon problem isn't a big deal until you use it on hundreds and thousands of objects like what happened in the video. you can see on his stats alone the GPU really took a toll. even just shaving a few polys would be good enough.
Neglecting polys can be a huge bottle neck on optimization in the future.
I like the tree shaking a lot more than the camera doing so. Maybe just add the screen shake on the last hit, when the tree explodes (Or when it hits the ground in the future perhaps). I think the problem with the tree shake right now is how the base of the trunk is moving, when really that part should be static.
I think you should use the camera shake when getting hit by enemies instead, maybe add a red vignette or a blue one since you play as a robot (electricity/sparks).
I'll keep that I mind
@@overphildev in the same way a grass shader will morph the grass mesh more at the top that the bottom you could apply the tree shake more at the top than the bottom
I feel like there's too much grass, maybe have areas with some less dense grass clumps and areas where theres none at all, ferns and different species of fauna will help as well
Also a way to improve performance further is make it so the further away something is from the player the less polygons it uses so you can be be able to render in the entire map from one spot as well as increas ethe performance of the game.
Good point I will definitely be tweaking it
this + also some textures (not for the grass, but the ground itself) could be a good idea
theres also URP to make things look even better
In addition to this, I'd add some sand near water rather than have tons of grass on your coastline :)
With GPU instancing you can still do scale variation for free so that can help so it doesn't look so uniformed and it can help hide holes and reduce the amount you need on screen.
Also you probably don't need to apply Wind (World Position Offset) for grass mid to far from your character.
This is the way. LOD is a must have for any kind of outsy game. Keep that in mind for trees, grass, rocks, whatever you put in the world. Even enemies/other players (in multiplayer) can dramatically impact performance (or lack thereof). Just mind how you do LOD because it might become visible that you're doing it if done wrong. usually the best pointer is trying to keep the silhouette the same regardless of LOD.
Some tips on how to improve the grass (stolen from Breath of the Wild):
- Zelda renders every blade of grass separately. It uses a straightforward model with 8 vertices for the sides (4 on each side) and another 4 in the vertical center. This allows you to make the blade more 3d like by bending on the two vertices in the middle. This 3d model has the shape of a rectangle and isn't in the shape of a blade. It uses a texture of a grass blade that bends however you modify the 3d model. This allows you to have a more complex texture. I hope I described that enough. Just ask for more information.
- To increase the grass distance, replace the (already simple) model with another one that is more simple with like 6 or 4 vertices in the distance. It will look like normal grass at that distance and you don't have to animate it which also improves performance.
- At a certain distance, don't render every grass blade. Render only every 2nd or 3rd or 4th blade.
- Don't let the grass blades pop in. Use a smooth transition to fade them in or out.
As I said if something is unclear or if you have some further questions, just ask. Maybe I can help :)
All good suggestions I think the fade in instead of pooping I'm would look really good
I think the sky box does really improve the look of the game. one thing I would say is that it looks more realistic than everything else in the world right now so that's maybe why it looks a bit off. maybe you could add some really simple looking cartoonish clouds that slowly move off and disappear a bit like how the Minecraft clouds do. anyways loving the game :)
Yeah good point
@@overphildev there is a unity option for custom clouds that look realistic, its called volumetric clouds
You should try scrolling a noise texture over the ground to make it feel like the clouds really exist. This would really help make the world feel more real and immersive.
I'll have to check that out thanks
@@overphildev You would probably be better off with some 2D clouds vs volumetric would match your style as well as be much more optimized.
Your welcome for sending the video!
You the real mvp
Everybody: „Damn, we need grass“
Me: „His mouse is on the left side of his keyboard“
That's what happens when you record upside down
I’d suggest having geographic landmarks in your world. It’s a good way to not get lost when exploring a new world. For example in ARK Survival there are unique terrain features in different locations. Once you see a giant mountain or cave, you know where you are!
Regardless, loving the content, keep it up! Really enjoying watching the progress!
I am planning to add point of interest in the future. I have some fun ideas for that
Nice progress as always! I think for the terrain, it might improve the look of the hills by increasing the roughness of the perlin noise to combat that smooth look - maybe even increasing the roughness only on the hills, so that you still keep those nice rolling grassy meadows. Also spawning rocky cliff pieces on steep terrain could help with it looking bare when the grass stops - not sure what the performance would be like though. Keep it up!
And adding noise in the grass shader for the colour, so you can have patches of grass that vary visually, to help break it up 😄
I'll keep that in mind. Im sure there is plenty more I will do to the terrain before I'm finished
I think it would be nice to have a more hilly world rather than a flattish one
It is something I will definitely tweak a bunch before I'm done
@@overphildev i think this is up to the Developer to decide and not fans
@@XvirusX you know suggestions exist
Maybe keep the flatter terrain and make a mountain model that you can spawn in like trees?
@@qar_ty7732 well i dont like hilly world i prefer flat one X'';
lets see you make npc climb this mountain
the brightness from the skybox looks great in my opinion! love seeing your progress
I want to say this is an really good start to making terrians!
I am struggling rn with developing mine for my new game and I want to say don't let this part of level design mess with you. it takes a long time but in the end it will determine the game level
Yeah it's definitely a drag but very important
@@overphildev Just keep your head up mate! before you know it your project will be doing well!
Love the new light! I also like how it is flatter more.
Cool glad to hear
when you see hills, in real life or virtual, you wll get a sense of perspective. Suddenly you realize how 'far' away stuff is, how grand the scenery is.... so adding a few distance hill might give a sense of 'scale' to your world too.
Great to follow your work!
That's a good point, maybe in the future I will add them back in
I really love the new skybox and lighting, keep up the great work, it looks amazing
Thank you
I honestly really like the flatter worlds, it makes the environment look so much more vast and pretty
Thank you
i think that making the top of the grass brighter or the bottom darker would be a great effect to fake ambient occlusion, also randomly scaling the grass can make it look more natural
I love acerola’s videos so it was cool you found his grass video! He makes a ton of videos about post processing and such and they are super useful
Yeah I might be using him again when the time comes for that stuff
You could use occlusion culling, instead of chunking the terrain. It renders only what the camera sees (within a group of static objects).
I'll try it out
this game will turn out to be amazing! You improve fast
Thank you I'm trying to keep a good pace
this channel is underrated! glad i found this masterpiece before im late :)
Thanks I appreciate you
It's first video I saw from you and it's so nice watching ur journey of making a game.
I was sure you gonna mention the way of rotating grass-faces to face player's camera, it wouldn't look as good as the final result though so nice work so far
Glad you enjoyed it!
I suggest making LOD models (level of detail), basically the model gets less and lass detailed the farther away from the camera it is, so it will look nice close to you and you wont be able to tell that it looks bad far away, and if you want to have, lets say, a mountain, it would look weird to have it be completely smooth, so you can have it just be low poly and it wont even be noticeable, hope this helps :)
Vegetation Studio is on sale from time to time and really worth it. I'm experimenting with a scene right now that brings Unity standard terrain trees and grass down to single-digit frames while VS still runs it at 50 fps.
Hmm might have to give it a chance then if it goes on sale
Woah, the game is really taking shape, can't wait to see what comes next! Also, I personally like the flatter terrain, I think it it fits with the overall feel.
Thanks appreciate the feedback
Depends on what you're going for, but turning off the shadows on your grass and using SSAO ( screen space ambient occlusion) might look better
Hmm that could be interesting I'll have to play around with that now
Grass is an absolute nightmare in Unity.
Perhaps remove the realtime shadowing of the grass and add a gradient to the grass texture instead?
Another neat trick I learned was to fade the grass' opacity into the ground similar to how soft particles work. :)
That is a neat trick I might steal
I didn't know a thing about GPU instancing before this video so thanks so much man! For the global look of the game I would add a bit of post processing effect like bloom and motion blur and other shiny stuff like that. But I think what would improve it instantly with no cost is to just activate the fog in lighting options in rendering (assuming you work with Unity). That could really give a sense of depth and distance to your game!
I honestly didn't know fog was that easy. I'll have to try that
@@overphildev yeah it's just one box to tick! Just be careful with the linear fog, it was my favorite one but for some reasons it just doesn't render in the build...
Nice! Just one question: How did you calculate that the game now looks exactly 327% better?
A guestimate. If you calculated something different I can change it
maybe add a level of detail to the grass?
You could definitely add some bushes and small twigs to make the game more visually appealing , also you can add trees variant colors
Plenty more still to come. Just wanted to get it started in this video. Bushes and things will be added soon
Your game looks really cool! I think the tree shaking looks better than shaking the camera tho >()
Yeah I think I'm going to change it back
There is a free asset called ' per layer camera culling' that can do a lot of heavy lifting for that type of optimization. You assign objects to a layer, and then set the distance to show objects on that layer. For instance, I have a layer called ' tiny ' and add all little sticks, sea shells, acorns, weeds and stuff like that.. and have the distance at 10 meters. and it just works. Since the layer of a prefab is set in the inspector, it doesn't matter if it is pre-placed or added at runtime.
Oh that's cool. I'll try it out
Looks already pretty nice :) and I totally agree not having grass in your game is not an option in 2022.
Small remark: You could also use a noise texture that spans across your world for color variation of the grass: For each grass object you would look up the value of the noise texture and use it as a multiplier. In this way you can get darker / lighter grass very cheaply.
You can also move the noise texture (or use another one) to simulate cloud movement.
I think a cool feature to add more life into the map would be different type of terrain/biomes. Possibly like snow terrain, sand terrain, etc. Just a thought!!
That would be cool
Fantastic vid! Im not sure if this has been menitioned yet but I think if you are having issues with finding items on the ground you could take a borderlands approach and add a small beacon on each item depending on the type and rarity of the object. Also subscribed, I love finding more game dev youtubers
Oh that would be cool
Great job, this was a really interesting video
Thank you I appreciate it
Is it just me or does this game remind me of the old windows desktop screen saver?
Who wouldn't want to run in that field though
There are couple of things to do with grass but one is frustum culling with jobs and burst. The other is a little harder but effective. It is by writing a software rasterizer for grass and drawing it by yourself to the screen.
One of those options sound way easier lol
Besides chunks, add if something is behind a certain degree from where the camera as facing, that it isn't displayed!
I'll try it out
Great work, the game is really improving in looks. It reminds me of the wii sports golfing arenas which I always loved the atmosphere of growing up.
the game is coming along very wonderfully, the grass really makes everything pop. A bit more post processing and the quality will be awesome
Thanks!
You can use raycasts and/or colliders to stop the items from appearing from afar and through the ground.
I think the game "pops" a lot more with brighter colors and lots of green vegetation. It adds a lot of juxtaposing visuals with the white robots in a way that adds clarity and makes the game look visually interesting.
Ive heard compute shading is more performant it works 100x faster than cpu but more difficult to master .
Any chance you're a pro at it?
@@overphildev no I tried but It gave me a head ache , mabe I need more time
About instancing, obligatory:
Your models are already sent to the GPU. The problem is just that issuing draw call is costly. Doing thousands of draw calls every frame is worse than doing one instanced call, even if they are rendering the same amount of geometry
What you could've confused was a thing in OpenGL or older Direct3D where draw calls are actually blocking, like IO. Doing a draw call in those stops CPU from executing until the GPU acknowledges it finished work
Very interesting I'll look into it more
For game optimization you might want to try altering the grass density bases on distance from the player. An area that’s far away but still in a loaded chunk doesn’t need to have as much grass to look convincing
Very true
I really like how this looks but you should add more materials to the ground like mud and such!
Much more improvements to come
Instancing reduces draw calls, what’s described here sounds like batching geometry.
I'll have to look into it more. I am just starting to lean about this stuff so I wouldn't be surprised if I got something wrong
I think the tree shake looks better than the camera shake. Maybe try shaking it without moving the object origin (assuming the origin is the base of the tree) so it looks less like the tree is just shivering 'cause it's cold.
Yeah I think that is a good idea
Next step in optimisation is frustrum culling! Unless it is on, which i don t think so! Basically, it makes the game render only what the camera can see! That will definitely improve performance by alot! Also, good luck! Game starts to look good! Keep up the good work!
Thank you I will try that next
The sky box makes EVERYTHING better its much better but a different HDRI sky box would probably do the same for the game so tweak it how you want 👍 the game is also at the point where i think the Graphix are good enough that it wouldn't be something to stop me from buying it and wouldn't annoy me.
The grass looks beautiful!
Thank you
the brighter lighting looks way better
I would change the ungrassed grass texture to look more like the grassed grass, so the ungrassed grass doesn't look so flat, cause it stands out a lot even though it's at a distance.
The grass makes it look so much better. Its coming together
Thanks, cool name by the way
I like the new light level, I didn't notice anything really off about it. I also would add in culling if you haven't already, or making grass further away from you have a lower detail mesh (maybe just 3 vertices for the furthest grass before it stops being rendered)
Cool glad it is just me then
the actual best way you could've done the grass so it does lag is to code it so it makes one BIG object that covers the whole land and so the GPU only needs to take care of one (
code it so it ray traces the whole map and finds the exact angle and depth the grass needs and join all the grass objects together
)
Hmm that's an interesting idea
I agree the comments saying the grass should be a bit smaller. Either that or maybe you could make the robot a larger? Anyways, I am always excited to see improvements you make. Great job!
The bright colors look so much better in my opinion
Awesome glad you like it
For the grass personally, i think you should have 'patches' of grass in the chunks, instead of having 100% filled, see if you can lower the amount of grass anyways (maybe it improves framerate). And also perhaps make the grass a bit lower in height.
With Mountains/hills, i think you should have some hils, and if you are planning on implementing mines/caves in your game then at least a couple mountains with caves in them would be a nice atmospheric change. (myb have loot chests in the "mountain caves")
Lowering the amount of grass would definitely improve framerate amd if it looks better too that's a win win
bro literally just discovered Frustum and Occlusion Culling (where he deletes grass that you don't see), and mixed it with World Streaming (where he generates parts of the map that matter to you, and de-renders the rest), all in one video. Good job :)
I think you can improve the processing speed if you decrease the tesselation based on distance and make further away parts less dense. I had a similar issue to you where I needed grass in a low poly proc gen vr game I was working on and I modified some code I found online to work like this, and I went from sub 60 fps to well over 100 or more if I recall correctly.
if (averageDist >= _TessellationDistFar)
f.edge[0] = f.edge[1] = f.edge[2] = f.inside = _TessellationUniformAtFarDistance;
else if (averageDist >= _TessellationDist)
f.edge[0] = f.edge[1] = f.edge[2] = f.inside = _TessellationUniformAtDistance;
else
f.edge[0] = f.edge[1] = f.edge[2] = f.inside = _TessellationUniform;
even i hardly understand the code (i know very little about shaders) but it just has 3 density settings for the grass tesselation so that distant grass is less dense, which can even remove the harsh lines caused by render distance cut offs
I'm sure there is a smoother way to do this though
Wow that would be really great I'll have to try it out. Thanks for providing the code too
@@overphildev Yeah, I hope it helps!
I would recommend adding fog. You could also make the skybox brighter and make the grass less saturated.
Fog is definitely on my list
Additional to Shadows, if you disable directional shadows you can add contact shadows in its place, it's much cheaper solution if you still want to keep shadows (however not necessary for stylised games).
Also consider additional camera frustum culling of your chunks, this adds some CPU cost on top but it has an additional save to GPU from not rendering behind view.
Mesh vertex density
The smaller the triangles to pixel ratio is, the absolute worse GPU processing will be, along with alpha cutout overdraw, these two alone can cripple performance more than the amount of veggies.
Finally frame debugger, you want to check this regularly that your instancing or instancing indirect meshes are correctly rendering and not failing forcing it through a different render loop ( or worse a static batch render which should already be disabled.)
GL :3
Thanks for all the suggestions I'll look into them more
Presumably you can also use an LOD system with the chunking as well to switch to basically just simply billboard textures when it's further away and you still want something but it doesn't need to be as good.
Little Feedback: The flatter world is a 50/50 for me, I liked those mountains but the plains appear to ne nice too. One Part I dont like atm is the new shaking Animation. I think the old one where only the tree shakes was great, so you could change that back… also it is really annoying when the camera shakes all the time. You can do that at heavy attacks or earthquakes, Stuff that doesnt happen that often as punching trees. Another great Improvement was the sky, I really like the look of it.
Keep the great work up, I really enjoy ur content
Thanks for the feedback, I am also leaning towards putting the tree shake back and just keeping the screen shake to taking damage.
These changes are great! I cant even Imagine how long it took. I think the lighter sky complements the world well and you should keep it that way but maybe have transitions for things like fights or night. idk. But keep up the crazy coding man
It definitely took some time but glad you like it
Since you mentioned Horizon and this video is largely about optimisation(like most game dev stuff really) it reminded me of that Horizon behind the scenes thing where you can see which chunks of the world are being rendered when the camera moves. It's here if you wanna see what I'm talking about. Horizon has like hour long developer videos about how they did their foiliage in general, like placement and design and how it's rendered and stuff, might give ideas for this even if you would be doing a much more basic version.
/r/gaming/comments/7v85ff/heres_whats_happening_in_horizon_zero_dawn_every/
That's really cool! I had never heard about this thank you
Are you talking about occlusion culling
I would test if a max cull distance for the individual grass instances would improve the performance even further.
I read some people who advice you to use grass meshes with 2 polygons only. I wouldn't say that this is always the best option, as in some circumstances this can lead to quad overdraws very easily (if you heavily rely on the alpha texture and have a lot of unused space in your grass mesh), which decrease performance and you have a hard time giving your grass a wind animation which makes them much more alive and less static.
I would recommend to use more polygons and model the grass so it kinda has the form of a single grass, and use a alphacut texture to make it look more detailed and use your uv space more efficiently. This way you can reduce quad overdraws. Then use LODs to reduce their polycount over distance. That's what i do with my grass in unreal, but i think that in unity it shouldn't make a big difference.
Cool very interesting I'll have to check it out
I would look into crafting an auto material with multiple grass types, dirt, rocks sand, underwater coral, seaweed and even bushes and ground clutter and based off of predetermined height and slope it will apply the correct material and meshes to your landscape. I have created quite a few for unreal I haven't used Unity in awhile but I'm fairly certain this is possible there as well. It takes a bit of time to set up and tweak to our liking but it will drastically help speed things up when prototyping new levels in the future.
That's a good idea
I have to say, the brighter Version sure suits the Game a lot more! The Style in which everything is rendered suits the more poppy colour you get from the new Skybox! I'd keep it. Makes it a lot more Cartoony.
I agree a cartoony look would suit it very well
removing the shadows from grass might help too. although i don’t know if the shadows are also gpu instanced.
I'll try it out
Maybe you could introduce some randomness to the density of the grass patches and the coloring of the grass blades. Off-coloring each individual blade and perphaps shading them depending on their height could make them pop out more and look less like one uniform green grassy shape. Also, lod grass could help the performance issues, you don't need that many polygons, especially for grass that is further away.
All good ideas. I will try to add those things
Howdy. If you are going to get an asset from the store I would highly recommend Amplify Imposters. It can make any game object that you have on your map an imposter and will really improve the FPS to it. Basically it turns the 3D object into a 2D plane and can really improve performance. The object will still look 3D. And at good distances you wont be able to tell it is a 2D plane. Also make sure you lod everything. Either by getting a LOD generating asset or doing it manually in a 3D program. Lods really help in that department. Mantis LOD Editor - Professional Edition comes with a standalone program to lod objects. And makes it easy to lod things directly in the editor or in the standalone program.
Lastly I would actually get Vegetation Studio it would really help with rendering grass and trees. But wait for when assets go on sale. Or get them through humble bundle. Having assets can actually make things go a lot better in the long run.
Thats really interesting I'll have to look more into it.
5:04 for this I would say learn knock back
The grass seems tall. And at first I thought that was bad, but I suppose no one is there to mow the grass in a robot apocalypse
Yeah I might decrease the size anyways to make it look better
I like the new skybox and the increased light
Great it's really been growing on me
You can absolutely use GPU instancing on trees. Collision isn't done on the GPU so that shouldn't be an issue. Though that should basically be a checkbox on the tree material to tell the game to do so inside of Unity. But if you could only instance completely static objects that are never altered it'd be completely useless in anything other than a static scene.
If your thanking on making a terain editing tool or something alike the you should to that soon because it's going to be very hard implement that in the future.
Yeah that would be smart
i think if you made the light from the sky warmer or changed the time of day to be closer to dawn/dusk that the feel would be much nicer. also you could not only chunk the grass, but allow chunks that are farther away to be lower res?
Good idea
Another great video
Appreciate it
Good job bro
Appreciate you
what about oct-trees or quad-trees to help identify the grass locations?
Around 4 minutes you're basically talking about LOD, where grass is rendered 100% when close, and 0% when far away. You could investigate how it would feel if you use a gradual fall off, multiple levels of LOD or even use a texture that looks like grass stems. This would also help when the game is played on low graphics settings, where foliage rendering is simply way too much.
Yeah I agree the cutoff right now is too drastic. I think a fade would look pretty nice
Great video! I'm not in a state, where I can write a proper constructive criticism, I need time to collect my thoughts, but I wanted to write a comment for the algorithm. Expect to see this comment change soon.
Can't wait
Looks fantastic!
Thanks glad you like it
You should try maybe making the grass shorter and adding some bushes and/or small flowers, you could probably take some inspiration from @Codeer , their game looks similar to yours
For example, fog
You can add grass via script to a terrain, you need to modify the terrain data. It is controlled via the detail properties.
I'll have to look into it more
@@overphildev I am working on a similar thing and its based off some older work so if I remember when I get round to it I will send some info if you like.
Yeah that'd be great thanks
I think the sky looks a bit weird right where its going behind the ground on the horizon, maybe fog could help
I think fog would help with a lot of things
Rather than using an actual, modeled blade of grass, use a flat plane (you can use 2 flat planes in an X pattern for an even better looking result) with an alpha clipped/transparent grass texture. This allows you to have multiple blades of grass per grass instance since the blades are actually just a texture and keeps the poly count even lower than what you have here. As well, you can cover a larger area of terrain with one grass instance this way. This is how games have done it for years now, great examples being the elder scrolls oblivion/skyrim if you want a good example to study (oblivion especially has really dense grass despite being a game from 2006 this way).
I'll check it out
Looks great, i like more hills, and maybe make the water look better
Appreciate the feedback
the tree shake looked better ngl
Cool glad to hear
I think a bit of fog would help the look a lot as well as hide the grass popping in and out.
I agree
Make the grass model bigger so you don't have to generate as many gameObjects but still cover the same area
I'm in a similiar situation as you were xD. I'm making a game about fishing and defending your island from planes (yeah sounds weird ik xD). My terrain is also procedurally generated. Right now it looks ok but your video convinced me to add grass since it did really help your game so I think It'll work in mine too.
That's a very it interesting game idea curious how it turns out. But yes I was surprised just how much grass added
I find the new light caused by the new skybox better than the older
Excellent
technically, you could use some empty objects with colliders to prevent player from going through the trees, and keep the graphics on gpu memory
You're not wrong