1
$\begingroup$

enter image description here

Hello persons, so I'm trying to achive ghibli or breath of the wild style grass using only generated texture nodes, (ie not image textures, math) and that much is turning out okay. However the issue I'm currently stumped on are the grass shadows.

To achieve toon-like / watercolor-like grass it has to be shadeless as to not cast shadows on itself, but I also want objects like trees and people to cast shadows on the grass as well. As much as I looked, I couldn't find a way to keep the grass from casting on itself, but also allow it to receive shadows (or something comparable) from other objects.

enter image description here

^ As you can see in this provided image, the result from the front (left image) appears as I would want it to look, however the moment you view the grass from an angle facing away from the light source (right image,) it's made apparent the grass is casting shadows upon itself, making the whole thing appear dark. I'm looking for a way to prevent the grass from casting a shadow onto itself, but allowing other objects like a cube to cast shadows on the grass.

Misc details: Running real time in Eevee. Currently rendering particles as paths (not objects,) texture is plugged into an emmisive material node to achieve simple toon effect, so it isn't a diffuse material; the current shadow effect is instead just a color hue shift determined by a Diffuse > RGB to Shader > Color Ramp > Mix RGB (fac) mask. However as explained, it isn't solving my issue at hand.

Any advice or attempt help is much appreciated, thank you.

$\endgroup$
1
$\begingroup$

I have an "okay" solution for your problem (in cycles) and it is only working with gras meshes (not billboards) so far. I know exactly what you are struggeling with, because I asked a similar question a while back but without an answer. Recently I tried something that works best:

you need to render your scene 2 times.

First time:

Everything + the shadeless grass.

second time:

Check "shadow catcher" for the grass meshes + Instead of the Emissionshader give the grass a Diffuseshader. For everything else check "Holdout" (both checks are in the Object Properties). And under Render Properties -> Film -> Check Transperent (for a transperent background).

now you can combine both images in the compositor or in a programm like photoshop.

here is a quick example: [shadeless grass with sword shadow 2

but i hope aswell we will get a better solution in the future, it must be possible because EEVEE is using the same technology as Game engines, and this is a well used and very common style in (indie)games (dauntless, the witness, zelda: botw, fortnite).

| improve this answer | |
$\endgroup$
  • $\begingroup$ You can actually create a shadow catcher / mask in Eevee with a Diffuse > Shader to RGB > ColorRamp > Mix Shader (fac) , however this isn't useful when it's applied to the grass, as the grass is still casting shadows on itself. However, if there was a way to pull this data from ANOTHER material and object (ie the ground plane) I wonder if it would produce a competent effect. -Tho idk if it would even work, or if it's even possible to get shadow catch data from another object, material, or via the camera in Eevee. $\endgroup$ – LanceBeryl Sep 4 at 17:49
  • $\begingroup$ I'll look into your fix, but I don't like the prospect of rerendering a scene; especially as this grass it intended to be used for an animation. I feel like this should be WAY easier to solve than it is. Other engines (particularly game engines) have achieved the results years ago. I feel like it should be possible, but as much as I search I cannot find anything to suggest that it is, which is just.. weird. $\endgroup$ – LanceBeryl Sep 4 at 18:23
  • $\begingroup$ "However, if there was a way to pull this data from ANOTHER material and object (ie the ground plane) " that works. I explained it, in the theard i posted, in my answere. You can bake the shadow onto the (white) plane, and use it as a mask. But it only works with an emitter particle system (as far as i know). Hier is the explanation with a picture blender.stackexchange.com/a/143362/105722 but still a workaround :( $\endgroup$ – justQb Sep 4 at 20:03
  • $\begingroup$ Yeah sorry I thought you were referring to post-processing. While effective for static renders, I was wanting something that offers way more flexibility and control. (i.e. dynamically adapting with the light source.) But it's okay, because guess what. I figured it out! I'll get started on a tutorial soon and post it here as answer cuz it's pretty complicated, but yeah, I got dynamic toon grass shadows working in Eevee. (Doesn't seem to work in Cycles tho.) I don't know how to post images here within a standard comment, so uh.. I'll update later with the results. $\endgroup$ – LanceBeryl Sep 12 at 6:04
0
$\begingroup$

I found a solution for Grassbillboards. But it is not as precise as LanceBeryl's Solution (for 3d objects), which I would recommend if possible :) .

the Idea is to let white Billboards catch the shadow, and get this white and grey/black information with the help of an "Shader to RGB" node. Plug a color ramp node after that node to make grey shadows also black. than use this coloramp as a factor to decide between a bright grass color (for grass in light) and a dark grass color (for grass in shadow).

A full explanation can be found here: https://www.youtube.com/watch?v=AzDoFjx9skQ

| improve this answer | |
$\endgroup$
0
$\begingroup$

Hey so after a lot of research and thinking, I figured it out!

Edit: While my first answer posted here was the first known way of getting real-time stylized grass shadows in Blender Eevee, it was extremely complicated, requiring a lot of complex work arounds, and came with a few caveats (notably: you were limited to "object" as your tex coords, you had to render hairs as objects, you needed to use a datatranfer modifier, among many other things..)

Since then artist and twitter user Kidane (@Puffertron) saw my original tutorial and revised the method using only materials. After seeing his post I was able to refine the method even further, giving the user more creative control over things like shadow color, transitional sharpness, and overall the effect is a lot cleaner/simpler. Thanks to Kidane it is leaps and bounds better than my original method. One thing to note is that it works with hair paths, not hair objects. Full explanation on new method here:

enter image description here https://youtu.be/zjKKZL03HNs

User JustQB has also suggested another possible method using billboards, which supposedly comes with it's own set of benefits. I know little about billboards, so I will likely look into it and update my answer here if the method is found to be just as useful. (His comment and video in regards to billboards can be found below.)

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.