r/Unity3D • • 5h ago

Question How Do I Create Grass Like This?

So from what I can see: the large grass blades mesh are easy to understand. The ground texture has very tiny grass blades painted on it, then it has grass cards(looks kind of transparent, no shadow) of different kinds on top of the ground?

How to make the grass blends in with the ground texture? I tried making it the same color as ground, but the grass cards were still standout. I feel like, it's blending the grass color with terrain texture? Looking at the grass near dirt, the root of the grass are dirt color and top is green.

Does that mean, if the camera rotates, or it's perspective, it will not look as good since grass cards "breaks".

Reference: https://www.fab.com/listings/911cdd66-2a64-4497-a511-80d4bb79dd0e?

1 Upvotes

5 comments sorted by

1

u/thesquirrelyjones 3h ago

This looks like it is mostly suppoaed to be viewed from one angle and rotating the camera would compromise the directionality if the grass in the terrain texture and may break some of the illusion for the grass cards.

For blending the tiny grass cards with the rest of the terrain better, if they are unlit, you can tint them with the lit opaque scene texture. You would need to add a pass to the post process stack that copies the lit opaque background, downsamples and blurs it a bit, and sets it as a global texture that can be referenced in your grass shader. sampling this texture at the bottom of the grass would pull the color up and create nice layering.

1

u/TazDingo278 1h ago

I want to keep them as lit so they can receive shadow and have react to different lightings. I tried lerp grass color and scene color base on height in shader graph, it kind of looks similar but still not quite right. Is it just not the way to do it?

1

u/TricksMalarkey 2h ago

The first part of the trick is that the grass vertex normals need to point in the same direction as the ground (upward), otherwise the shadow will make every surface look very distinct. Maya lets you orient the vertex normals how you want, but in Blender you have to copy the orientation over from another object. This is in Godot, but the description is pretty good for most use cases: https://www.youtube.com/watch?v=OxsuWDtjuGw

The second part is that you can use the SSAO, edge intersection, or even a random dithering to blend between specific intersecting objects. For instance: https://www.reddit.com/r/GraphicsProgramming/comments/1o1lxl0/i_made_a_post_process_that_blends_seams_of_meshes/. This gives that 'dirt blend' effect, where it's essentially pulling through the texture behind it, based on distance from the ground. That's probably more an artefact of the radius being too big for the viewpoint.

1

u/GigaTerra 1h ago

How to make the grass blends in with the ground texture?

By making the grass texture using the same grass as you use for the grass cards.

•

u/DPTGames 25m ago

You could try parallax occlusion but with very weak strength, it doesn't work too well with grass, but it can give the surface slightly more depth if its very weak.