Trying to create an unlit celshanding with point light influence.

Recently I have been applying a game shader to extract the location vectors to redirect them as coordinate information.

My goal: To have the color of the point light influence an unlit material. “But why not use an opaque material?” - Due to its complexity, the opaque material has unnecessary information for celshading. The only interesting part is the influence of light points. Even if I used an opaque material, it would have a natural gradient influence, which does not match the design of my project. The second option would be post-processing, but I would lose out on optimization, in addition to having to recreate all the logic of my celshading.

So far, everything is flowing perfectly, the problem is that the coordinate capture event present in my component only occurs once at the start of the game.

1 - This is the logic of the parent component, where it checks the actors that have light emitters, and then stores them in an array.

2 - The second part is in the child of the first component. In this case, the child component serves to capture all the materials present in the skeletal mesh.

2.1 - In the second part, I have a checker that asks what type of material is being checked, comparing it to the array with a filter list. This is to prevent the code from being executed for shaders that do not have the appropriate node logic. After the check, the suitable materials gain a dynamic duplicate ready for modification.


2.2 - This part contains the vector capture event. There are a maximum of 3 vectors at a time. If there are more than 4 light points, it is ignored (I believe that more influence points are unnecessary). This event is executed inside an actor created by me, which has the event trigger.

3 - This step consisted of creating an actor that could be verified by the component, in addition to being able to transfer the result of the light to the material. This is the simplest part. It checks if the component present in the other actor is valid (if it exists) and then asks for the size of the array. After checking, it directs it to its pending slot.

Conclusion: Everything is working so far, but I have a problem with the response update. In fact, the light coordinate is static, but the mesh position is dynamic, so the only thing that needs to be updated is the vertex normal present within my material. It is calculated with the light coordinate to execute the appropriate effect, but this execution only occurs once. I could think that I actually need a loop or a continuous event to update, but they would only update the position of the light. Which doesn’t make sense, since the light is static.