• Register

Wonhon: A Vengeful Spirit is a paranormal stealth action game where you play as a vengeful spirit of a girl who was killed during a bloody and cruel occupation of her country. Now, she has returned from the dead. Gifted with powers from the Jeoseung Saja, the God of Death, she sets out to exact terrible vengeance.

Post news Report RSS Interactive grass (March 12, 2019)

Characters can move grass now. This was fun to figure out. Basically, I have an invisible circle with x,y,z directions embedded into RGB colors under every moving character, and I can use this to bend the grass in the right direction near characters. It’s like 6 lines of code added to Unity’s built-in grass shader.

Posted by on

9

Interactive grass
Imgur.com

"Characters can move grass now. This was fun to figure out. Basically, I have an invisible circle with x,y,z directions embedded into RGB colors under every moving character, and I can use this to bend the grass in the right direction near characters. It’s like 6 lines of code added to Unity’s built-in grass shader. The grass shader already has code for moving grass blade vertices - for wind - so I just had to add the render texture for the grass camera (which only sees those hidden circles with character direction) and parse the colors into a direction and add that to the grass vertex displacement function. It sounds pretty complicated when written out, but it’s pretty simple actually.

I have to tweak some settings to make them look more convincing, but at least the functionality is there. Also, right now the terrain is rendering each grass blade separately, but I really should make a new grass texture with multiple grass blades to save some GPU power. Might not see each grass blade moving independently with many blades per texture, but grass blades aren’t the most important thing in this game.

How did Metal Gear Solid 3 do individually moving grass blades? I remember being impressed when I played that game for the first time. And all that stuff was running on PS2 hardware. How?! Man, my accomplishments in this game pale in comparison to those retro games and their black magic. MGS3 also had those flowers moving independently during the boss battle with The Boss. How did they do all that stuff? How does ThatGameCompany’s Flower render all those grass blades and flowers on PS3 hardware? Maybe there’s a better way to render and move these grass blades… Hmm." (c) Sean, the Wonhon: A Vengeful Spirit developer.

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: