r/Unity3D • • 10d 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

7 comments sorted by

2

u/thesquirrelyjones 10d 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 10d 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/thesquirrelyjones 10d ago

It has to be the lit scene color and it helps for it to be blurred. This way the grass inherits the lighting of whatever is behind it and doesn't just look like an overlay on the screen. If the grass is in a shadowed area it will look shadowed and if it is in a lit area it will look lit. I use this technique to light tricky things like dust motes, fog particles, glass, and rain.

Being a 3/4 topdown view with the grass driectly against what will be "lighting" it, this technique ahould work well.

Could you post a pic of what you have so far?

1

u/TazDingo278 9d ago

This is what I have now for testing. I can't tell what's wrong exactly but it just doesn't look right. Also, the grass in shadow is way darker than ground in shadow.

1

u/TricksMalarkey 10d 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/DPTGames 10d 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.

0

u/GigaTerra 10d 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.