Creating a light which only creates shadows

Hello!

What I want - is to be able to create some kind of “light” component, which will not generate light, but only shadows. It should be able to “shadow” already existing lights and shadows (basically after all calculation of shadow and lights, some kind of postprocessing them), shadowing all that is not “lit” by this “invisible light”.

It seems that I need to go inside rendering, but I just don’t get how and where. Can someone give me an advice what should be known to do such a thing, which classes I should investigate, and maybe there is even a some kind of API for that?

Thanks in advance!

Hey Evengard,

Check out this Archive post about Negative Lighting:

Hope that helps!

Hello!

Unfortunately this is not what I need (I saw that already). This is “substractive light” while I need “substractive shadows” which doesn’t affect non shadowed lights. I hope I explain it clearly enough :slight_smile:

At least can someone explain rendering of lights? At least - which methods are being called for their rendering each frame in which direction. Because I see associated functions (like AddLight, ModifyLight, their rendering counterparts, etc), but I am lost about their call order.

Regular shadows are not actually drawn, they are absence of light from a particular light casting object. I think you are thinking of lights as drawing both light and shadow as two different components, and you wish to simply not draw light one. This will not work.

I think you should move away from lights in regular sense and look for information on how to project an image onto world. Lights using light functions and decals use this in one way or another.

What you want to do is capture an image of what this invisible light hits, color all that black/grey and project this black image to pixels that are behind ones in projected image.

I don’t really understand what you want, is it shadows like ghosts in metro 2033 ? you know… :

http://cloud-2.steampowered.com/ugc/486694762777401332/FA2BE0FA38A54371E7C55F7BC69FE392B31F42FD/2048x1152.resizedimage

http://cloud-2.steampowered.com/ugc/486694762777403566/1497E4E3D456A28F7511B66137A569F66C4B15B5/2048x1152.resizedimage

Edit : silly me, this ain’t shadows at all, just black transluent models shown by flashlight…

Yeah, totally different. :slight_smile:

Well, probably you are completely right! But I just can’t get how to do that. Can you guide me on some UE APIs on how to do that?

And I don’t understand what functions like FDeferredShadingSceneRenderer::CreatePerObjectProjectedShadow etc are actually doing?

By way looking at code - are lights unrendered when you don’t have DX10 at least? Requiring Shader Model 4 for that?

More like a fog of war in strategies - but more realistic and applied to a person viewpoint.

Noone can help me? :frowning: There is a little about actual renderer in documentation…

As far as I understood - i need to create an attenuation buffer, but apply it not to light, but to whole scene, and do not render light… Am I right?

Actually shadow seems to be present in attenuation buffer, which is then applied wher rendering light. But well I don’t get how it gets transformed into ColorBuffer of light, and how to override to go straight into ColorBuffer of scene itself… Seems like it is doing that by some means of shaders…

I wish I could help you more but all I can say is that traditionally lights that cast shadows draw a depth map from their point of view to map surfaces that are closest to them. These are surfaces that will be lit. Later on when lighting is applied to scene that is rendered from players point of view, pixels in this view will be compared to values in lights depth map. If depth greater then value in map, that means pixel is behind a surface in lights view. That means it should not recieve light and will be shadowed.

Now this is generally speaking and there are other ways to create shadow effects, I don’t know for sure what implementation UE4 uses and being a state of art engine it’s quite possible it’s using more advanced techniques that I am not aware of. So feel free to take my advice with a grain of salt :slight_smile:

If only one of UE4 devs could help me… :slight_smile: Thank you a lot, but I am completely lost now :frowning:

A dirty way of doing it would be to add shadows to texture. You could render to texture in 3ds Max. That would require a complete scene to be done in 3ds Max, then exported.

Nope, definitely not a solution. I need to recalculate it dynamically at each frame - this “light” will be bound to character. Actually I need all of that to hide from player things his character can’t see (i am using a top down camera). Some kind of “fog of war”.

Definitely not a solution for that.