Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Is it possible to have multiple lightmaps?

Hello, I'm trying to create a wet ground effect that would only affect areas exposed to the rain direction (not under a car, for instance). Usually, one would just manually paint those areas using vertex colors, but I'm trying to automate that process. Here's an example (notice how the ground is not as wet under the bridge):

alt text

So, since the rain has a global direction, and objects can block it, I was thinking about creating an extra lightmap with just a directional light casting shadows, and no light bounce, to use it as a mask for the wet effect latter in the shader.

However, I can't figure out how to store it without overwritting it when I bake the real lighting.

Lightmaps use the second UV channel, so maybe using the third one for this mask would be possible, but I have no idea how.

Does anybody have experience on this?

Thank you

Product Version: UE 4.16
rain.png (199.5 kB)
more ▼

asked Jul 07 '17 at 08:53 PM in Rendering

avatar image

1 2 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Your thinking direction seems to be the right one for specific purpose, but instead of lightmaps, you can just use scene capture actor with render target. Your logic would be to place scene capture actor above the scene and match its orientation to desired rain direction. You would then capture scene depth and write it to a render target. Now you have a texture, that virtually shows distance from rain origin to the nearest surface, exposed to the rain. For next step, in every scene material you should perform a check. You would need to transform pixel's position into rain coordinate space, and compare its depth-axis position with a depth stored in a render target. If it is less, the pixel is exposed to rain.

There are some challenges connected to implementing it, but overall it is doable with some efforts.

more ▼

answered Jul 09 '17 at 10:27 AM

avatar image

7.8k 130 31 292

avatar image ANAVAZA Jul 09 '17 at 12:26 PM

I guess the scene capture actor should be attached to the game camera, right? (Otherwise, you would only capture the fraction of the world right in front of it, and not the whole world).

Also, updating the render target every frame, as the camera moves through the world, might become expensive quickly, but I'll give it a try anyways, thank you!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question