Hello, I’m running UE 5.2 and I’m using the Path Tracer to render cinematics. I’m trying to create a highly detailed procedural grass system using the landscape grass types. I’ve enabled a few console commands that are required to get this all to work, but I run into problems with shadows when using WPO with Landscape Grass + Path Tracer. The top image has no WPO, the bottom has values plugged into WPO (any value at all causes the issue).
It’s this ugly shadow circle that appears only on objects close to the viewport position. It’s especially odd since my grass renders fine outside this circle, and WPO works correctly. I read that WPO issues could be fixed by enabling “Evaluate World Position Offset” in the details panel of static meshes, and I see something similar for foliage objects, but there are no such checkboxes for landscape grass objects.
I don’t believe it’s a LOD issue since I’ve also tried foliage.ForceLOD 0, which made no difference other than hurting performance outside of the path tracer since the billboards were clearly replaced.
It could be a lot like issue #2 from William Faucher’s Troubleshooting FOLIAGE issues in Unreal Engine but I can’t use foliage actors or blueprints with landscape grass. And it’s weird how I’ve got this limited to a circle area.
Here are the console commands I’m using to at least get to this point:
r.RayTracing.Geometry.LandscapeGrass=1
r.RayTracing.Geometry.InstancedStaticMeshes.Culling=0
r.RayTracing.Geometry.InstancedStaticMeshes.EvaluateWPO=1
It’s just so odd that everything works fine outside this circle that it’s led me to believe it might be something I’m doing wrong or a bug.
Does anyone have any ideas as to how I could get around this issue? I’ve tried other procedural options like procedural foliage volumes but they take way too long to generate (if they don’t crash) for the density and coverage I’m going for.
Visual circles like that are usually a result of a post process or some engine feature that acts like it such as fog or similar.
Though, usually they look more circular. In your example it seems offset to the left, which could mean its something else.
Test it anyway by removing the items or changing the distances on them.
Also, I wouldn’t do shadows on grass even for cinematics. It just looks more relaistic if you fake it by blending the color with a vertex based white to black shade, on top of costing a whole lot less.
For a realistic feel it may be better to blend in some cloud map over the grass using world position so that you have a moving shadow sort of thing as you would from cloud cover than it is to avcurately render the shadow of each blade of grass…
However it you are sure that’s what you need keep poking around the common culprits mentioned above…
Hey, yeah the circle is centered it’s just the terrain slope making it look offset.
I don’t know how someone would go about turning “off” shadows in a path-traced scene but I’m actually pretty satisfied with appearances outside this circle.
I created a test level that only has the terrain, landscape grass with wpo in its material, and a directional light, so I don’t think there’s anything else to remove.
I’m really trying to get it to look like the area outside the poorly shadowed area anyway, so maybe there’s a way to disable these shadows when using wpo?
(Above image is the desired effect but has WPO unplugged)
Another thing maybe worth mentioning is that the shadow in the circle wiggles and changes depending on where my camera is, looks kinda like I’m changing a seed value of noise whenever I move around in the viewport.
If my camera is far enough away from the terrain, the circle fades away and I think it looks quite nice (my main level with wpo enabled+color var here, cam is far enough from terrain that there’s no circle):
It looks to me like there are actually shadows here, so I know it should be able to work properly.
In the test level, I’ve also tried adding an unbound post-process volume and turning every related setting on and off (ao, translucency etc.) but nothing seems to happen except when I adjust path tracing settings (which I would expect since it’s a path-traced scene, not lumen)
I’m not sure what else I can turn off, and my understanding is that there are limited settings available to tweak using path tracer anyway.
What of the directional light settings? The halo could be related to when cascade kicks in or something similar in regards to the tracing.
I’m guessing the path tracing isn’t active for the entierty of the scene.
Additonally maybe the model LODs are kicking in and lit with a different material.
Havong the vertex grass completely path traced would slow rendering to a crawl if you had LOD0 everywhere - I think, depends on overall final output resolution/pie size.
Still, something to look into.
Contact shadows / any other screen space effect is usually visible by bleeding in at the screen edges. Based on the screencap I think you can rule it out.
Aside those, You may want to grab a mod to move this to the rendering section, as you would be more likely to run into readers who ran into this specific issue before.
Ps:
You could try not using the grass and painting the grass with the paint tool in a copy of the scene to see if mesh settings make a difference here. Some times for cinematics you just have to since grass doesn’t necessarily use the same shadowing/rendering as static meshes. Foliage does.
I’m playing with the cascade values now, though it doesn’t seem affect anything in this scene, but I doubt it’s the directional light’s fault since the same happens in my main scene with only an hdri dome + skylight.
I’m not sure what exactly is going on with the LODs since they are easily apparent in unlit/lit mode but aren’t in path tracing. I’m guessing path trace mode auto disables LODs or something because I can’t tell anything apart. Performance is actually quite good in path tracing, the grass hurts performance a bit but not anything crazy (it’s actually better than some other DCCs I’ve tried with similar scenes).
I wouldn’t think it’s the model LODs causing the circle since I’ve also tried forcing them to LOD0 via console command, but maybe this is something Path Tracing overrides? I might try manually deleting every LOD except 0 on each grass mesh, but I have serious doubts that LODs are the problem given that I can’t see lower LODs anyway. Plus, intuitively, light should react to the WPO of every LOD the same, regardless. But I won’t rule it out yet since it seems like I’ve tried everything else.
I totally would go manual painting route but it seems like it takes up a lot more memory to do so given just how many instances there are. From what I understand, because you can manually manipulate each instance, it’s storing position, scale rotation values for each instance which consumes more memory than landscape grass (I don’t remember where I read this so my reasoning might be wrong). I’ve been running into a bunch of walls with landscape grass and would be happy to switch to something else, but nothing I’ve tried performs as well. I might try in the future to test painted foliage just to see if the circle disappears but it wouldn’t be a viable solution for me since I do remember it being a huge performance hit.
Do you have any idea how I could contact a mod? 5 minutes of Google searching yields no good results.
If you guys could please move the topic to the rendering section that would be great.
Re the rest, performance impact (of path tracing) likely depends severely on the gfx now. Also on the drivers in use. So I wouldn’t necessarily use it as a medium for even guessing what mode the engine is using to render.
I know that for proper ray tracing the grass node doesn’t usually cut it.
The memory performance in the end is also about the same - you kind of do want upwards of 32GB of ram to operate a path traced project anyway.
The engine is a memory hog himself.
If you want to avoid manual painting the grass, try the procedural tools. They do work. Even if they will require some processing time.
Also, this is probably nowhere near production or even beta ready. But they did just show case some kind of procedural generation tool that takes your base level work and randomizes bits and pieces to create peocedural areas that you may be able to levarage if you figure it out…
I wouldn’t even know where to look since in all honesty the GDC talk was basically just epic tooting their own horn throught the whole presentation, without absolutely any relevant performance information, all the while rendering probably at 720p or 1080p instead of the normal 4k. So the validity of any of the engine is still very much in question.
Yeah, I’m running 32GB RAM on a laptop RTX 3080 with 16GB of VRAM, latest Nvidia Studio drivers, plenty of cooling/good temps.
EDIT: Okay so I feel like a total idiot and deleted most of this comment because (I don’t know how I missed this) the WPO shadow issue is apparent in other modes besides landscape grass. This includes both foliage painting and other modes (with evaluate WPO in ray tracing enabled) and even nanite meshes (which don’t work right with landscape grass and WPO but that’s a separate issue. I’ve just had so many roadblocks with landscape grass I must’ve somehow thought that this issue was another landscape grass exclusive issue. Now I’m really stuck for what to do.
EDIT 2: Now that I’m trying other foliage modes, I’m able to try William Faucher’s tip#2 in his fixing foliage video. That does actually seem to fix it but is a massive hit performance-wise, I can hardly move around my scene even in unlit mode. Supposedly, this issue shouldn’t exist with static meshes (vs foliage actors), and there’s a really cool plugin called GraphN that creates an actor with hierarchical instanced static mesh components that performs wonderfully, though even these types of meshes still have the shadow bug even after checking “evaluate WPO in raytracing” for each mesh component. I obviously can’t hand-place actual static meshes so I don’t even think that’s worth testing.
Alright! I’ve got a working setup with great shadows and good performance. Here was my solution: I created a basic blueprint actor and placed my static mesh (my grass mesh) inside the blueprint and enabled “Evaluate World Position Offset in Ray Tracing” in the blueprint details. Got this tip from William’s Faucher’s video. However, I don’t ever create an actor foliage, instead, I just select the blueprint as a mesh I want to scatter using GraphN’s surface scatter tool. I set my density and raised the max instance count and the terrain filled up instantly. At first, none of the LODs were working which caused massive performance loss, but I restarted the engine and all seems to be functioning properly and performance is as good as ever.
(Basic WPO scale variation effect dramatized a bit here for clarity)
I will still need to hand-paint some smaller bits of foliage in the future so this issue will still be a problem in those occasions. However, for that, I’ll either disable WPO on those mesh’s materials or I’ll go through the full process in William’s second tip (depending on the mesh’s needs).
For anyone else coming across this issue, even though this solution doesn’t fix using landscape grass nodes, I really do encourage you to consider GraphN as an alternative despite it being a paid subscription. It’s a 30-day free trial and the scatters you’ve placed remain even if you cancel the subscription. Reasons being that:
it solves this extremely annoying shadow problem while being a fast procedural solution,
it’s actually unreasonably fast and stable compared to Unreal in terms of generation time, even faster than landscape grass (no grass shader compiling).
A big issue with landscape grass is that masking by terrain layers leads to jagged edges if cutting across the terrain diagonally, due to the large chunk sizes used while painting. GraphN works exactly where you specify with fine-control edges,
it has several masking options MUCH more intuitive and easier to use than landscape grass, with graph control for any additional functions, and
I can literally just select proximity objects and click 1 button to add them to a list that the scatterers PERFECTLY go around. Before I had to use complex custom depth setups to achieve the same effect or use less accurate RVT methods.
Finally, you can add non-landscape meshes to your scatter targets which is actually great for blending other more detailed pieces into the terrain.
There are also a bunch more features I’ve yet to try out (like making spline meshes, quick foliage cutouts, etc.).
I’ve just had so many issues with Landscape grass lately so I think this will be my main tool in the future. The devs of GraphN said UE5.2 is working inhouse but will only be available in the next update, which they told me would be sometime in the next month. So I’m using Unreal 5.1 for now.
Thx for all the help @MostHost_LA
Hi there, may I ask you a question? How does WPO work in path tracing? I’m currently using UE 5.1, but I’ve noticed that the trees and foliage in my scene don’t have any movement when using path tracing, whereas they do in real-time rendering. Can you help me understand why this is happening?
So far, I’ve only been trying to get static scale variation using wpo. Tbh, I started getting glitches again with wpo, but GraphN has real object scaling that doesn’t use materials so it worked for me. It’s been a while since I’ve tested this, but I remember seeing blurring in the areas of movement the path tracer viewport when using simple wind. It was kind of like it was averaging the pixels together as the object moved around. I would assume this is just a viewport problem and would be better in the movie render queue, but I haven’t tested that since I’ve been busy with school lately. Have you tried this in the MRQ yet?
Do you still get the blurring issue when in the sequencer as well? I read in UE documentation that moving objects show up in the sequencer for rendering properly.
What you see in the viewport of PIE after hitting play, is what you get everywhere else unless you have special parameters applied to that rendering (for instance a scene capture).