question: how to change the culling mask of all kinds of lights we have

Discuss coding questions, pull requests, and implementation details.
Post Reply
User avatar
Nystul
Posts: 1351
Joined: Mon Mar 23, 2015 8:31 am

question: how to change the culling mask of all kinds of lights we have

Post by Nystul » Tue Jun 11, 2019 6:58 pm

Hey guys,
When reworking the automap I realized that it would be best that any kind of scene light (dungeon lights, lights of magic spells, player torch, etc.) should not affect automap rendering.
So to make it behave that way all the lights need to have their culling mask exclude the automap layer.
Now the question is, what would be the best way to achieve this?
options are:
  • changing light prefabs (if lights are spawned from prefabs - e.g. DaggerfallLight [Dungeon].prefab)
  • changing the gameobject in scene for lights that are part of the loaded scene (in DaggerfallUnityGame.unity) - e.g. player torch
  • by scripting when light is instantiated from prefab or for scene lights on specific events
My first feeling was that changing prefabs + scene (a combination of 1+2) would be the cleanest way to do it. But now I am unsure since changing the culling mask in the prefab results - I think - in the bitmask being written to the prefab. This depends on the layers the developer has setup in his layer settings I think - leading to maybe different values depending on what is configured how. I am a bit afraid that this could lead to wrong culling masks depending on the settings on different developers' systems. Or do you think it should work anyway without problems?

Would like to hear your thoughts guys, and which route I should take. ;)

User avatar
Interkarma
Posts: 4690
Joined: Sun Mar 22, 2015 1:51 am

Re: question: how to change the culling mask of all kinds of lights we have

Post by Interkarma » Wed Jun 12, 2019 2:51 am

I think you're on the right track by changing prefab + scene. The layers are defined in project settings, so as long as this is done we'll all have the same values for masks. Just let me know if there's anything I can do to help. :)

Post Reply