Directional Lights and HDRP

Hey y’all! I’m having some difficulties with the directional light, and I’d appreciate any help.

The first issue I’m having is that only one directional light can be active at a time. If I enable any other ones, the first one is immediately overridden. Is there a way to have two directional lights?

The second issue I’m having is with adding cookies to the directional light. I’ve managed to get it to project, but since the texture type has to be “default” instead of “cookie”, I can’t seem to stop the texture from repeating like before by setting it to “spotlight”.

Thanks!

What version of HDRP are you using? I just tried adding two directional lights to a scene, and it seemed to work fine in HDRP 7.4, though I do feel like I’ve seen it mentioned that only one directional light is allowed.

Anyway, as for the cookie, it seems I can get a cookie-like feel with normal textures by setting the Cookie and the Surface Texture. Not sure if that’ll work in your case.

5963588--639488--upload_2020-6-10_12-35-31.png

Thanks for the help and reply! The issue I’m having with the cookie isn’t so much that it’s not appearing, but rather that it’s appearing and tiling itself. I can’t seem to get it to only display once. I appreciate your help, though!

Well, if it’s a directional light, I don’t think there’s any choice but to tile it. A directional light is effectively infinitely wide, so it doesn’t really make any sense to just display the texture “once”. For example, let’s say you have a large outdoor scene lit by a directional light. The area might be a mile wide. You’d need an impossibly large cookie to apply any reasonable detail to an area like that.

Unless I’m misunderstanding. Do you have an visual example of what you’re trying to achieve?

Hi,

he first issue I’m having is that only one directional light can be active at a time. If I enable any other ones, the first one >is immediately overridden. Is there a way to have two directional lights?

You can’t have more than one directional light casting shadow, but you can have lot of directional lights, as long as only one cast shadow.

but rather that it’s appearing and tiling itself
Expected with directional light, guess what you are looking for is local directional light, that we call Box light:
Redirecting to latest version of com.unity.render-pipelines.high-definition
(See box shape in spotlight)

Thanks for the help, both of you! I’ll give the box light a try. I could be wrong, but I thought in the standard render pipeline, adjusting the cookie type allowed directional lights to have cookies behave the same way as spotlights. I might be completely wrong though, it’s been a while since I touched Unity in general. :wink: Just wanted to remove some unwanted splotches of light.

I’ve tried disabling the shadows in the second light, but it seems to still disable my original light. Though it’s really just to add some light and color into the shadows so I think I’ll try giving the box light a try. Thanks! :slight_smile:

Is there any way to overcome the shadows limitations?
I’m able to sacrifice performance, but I want a multishadow

@dgoyette how did you create directional flowmap ?

I think it’s just something I downloaded while experimenting with cookies to inform this post. I think it came from this page: https://catlikecoding.com/unity/tutorials/flow/directional-flow/ I’m not actually using it in any of my projects, so I don’t know how useful it is. But that’s where it came from, anyway.

1 Like

Use Box light instead, they have no limit on shadow (as they don’t use cascade)