Author Topic: Would like to add a light source to new walls  (Read 453 times)

MightyMonte88

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Would like to add a light source to new walls
« on: December 04, 2020, 02:59:19 pm »
I added a new structure tier, made from a new resource called refined pragmium. How can i go about giving the walls/ floors a slight glow? I've seen some other objects in game (pragmium sources) have a slight glow and it would be neat to add that affect to these walls/floors being that they are made of pragmium.

ai_enabled

  • AtomicTorch Founder
  • Hero Member
  • *****
  • Posts: 1963
    • View Profile
Re: Would like to add a light source to new walls
« Reply #1 on: December 05, 2020, 05:27:04 pm »
Hello!
You can create a light source component easily. Here is an example https://github.com/AtomicTorchStudio/CryoFall/blob/4a652eb58121d9ff37711e2ee7323c6cae94d09c/Core.cpk/Scripts/StaticObjects/Structures/Decorations/ObjectDecorationStatuePragmium.cs#L34
You can pass a scene object or a world object in place of it.
The best place to add this piece of code is in the ClientInitialize method override in your new wall class.
It's best not to make it as large as in the sample above. The walls are usually built close and in a significant number so they may cause rendering performance degradation when you add that many large light sources.
First, experiment with a very small light source to select the best light position offset, then adjust its size.

Regards!
« Last Edit: December 05, 2020, 05:30:30 pm by ai_enabled »