x

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"

How to prevent a light from lighting a specific mesh?

Hello,

I am trying to add a dynamic, shadow casting light on a skeletal car mesh, to use as headlamps. I would like to avoid using multiple ones for performance reasons.

If I put the light right in front of the car, when getting close to a wall, you can see the light actually originates from the center of the car's hood and not its sides. Like this :

alt text

If I put the light back inside the car so the spotlight's cone fits with the position of the headlamps, it will then shadow the car's mesh and leave artifacts:

alt text

Both results are unsatisfactory. To me the solution would be to tell the light not to shadow the car's mesh, but I can't seem to find a way to do this.

Is there a solution I missed? How do car games like GTA avoid this problem?

Thank you for your help !

Product Version: UE 4.21
Tags:
more ▼

asked Mar 20 '19 at 09:51 AM in Rendering

avatar image

Seyroth
33 2 4 7

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

4 answers: sort voted first
  1. Static Mesh components contain the option "Cast shadows". Unchecking this will prevent it from creating dynamic shadows and exclude the object in a light bake.

  2. You can edit the material assigned to the static mesh and change it's shading model to unlit, this will prevent the material from being affected by light. You can then control the brightness of the material using the emissive colour.

alt text

unlit.png (149.4 kB)
more ▼

answered Mar 20 '19 at 12:12 PM

avatar image

Alekann01
441 4 5 6

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

Hi, you need to make the material of the headlamps emissive, and then put two spot facing out just in front of the lamps :)

more ▼

answered Mar 20 '19 at 10:25 AM

avatar image

ClockworkOcean
220 3 4 4

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

You cannot ask a light to ignore specific actors. To achieve the affect you want, you will need to look at setting up lighting channels in your project, note these can only be applied to moveable objects (as I currently understand).

There are tutorials etc on YouTube: https://www.youtube.com/watch?v=rv5OitYiNFU

more ▼

answered Mar 20 '19 at 12:37 PM

avatar image

Alekann01
441 4 5 6

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

Thank you both for answering but it does not solve my problem.

@ClockworkOcean , I was asking for a solution with a single light. My project cannot take the performance hit from doubling the number of dynamic shadow casting lights, and my light measurements will be for a single source, not two.

@Alekann01 , I still need the vehicle to cast shadows from other sources, and the mesh to have adequately lit materials.

more ▼

answered Mar 20 '19 at 12:26 PM

avatar image

Seyroth
33 2 4 7

avatar image ClockworkOcean Mar 20 '19 at 12:33 PM

I think you will struggle to make things look right without two lights... ( leakage etc ). :(

avatar image Alekann01 Mar 20 '19 at 12:38 PM

You cannot ask a light to ignore specific actors. To achieve the affect you want, you will need to look at setting up lighting channels in your project, note these can only be applied to moveable objects (as I currently understand).

There are tutorials etc on YouTube: https://www.youtube.com/watch?v=rv5OitYiNFU

(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