How can I make a shader pass that emits dynamic light?
I have been reading the docs and searching around on google for a few hours, so I doubt there is an answer on this website, but if there is, please answer with a link. So, back to my question, I have a multi-pass shader, the objects which will use this shader emit a very strong light, so the player, and other dynamic objects need to cast shadows. Dynamic lighting is an absolute necessity for the scenes, meaning, it generates a lightmap every frame, I am aware that this will be very costly for performance, so this shader will be used very sparingly, in very small scenes. The light emitted will not have a color variable (it will always be pure white), but it will be multiplied by an intensity value. I am not asking anyone to program the entire shader for me, but I am completely new to this type of lighting, so if anyone could give snippets or documentation to look at that would be very helpful. I think this is a fragment shader (it does not cast shadows or receive lighting, it is always one color) Thanks in advance, I apologize for my lack of knowledge in this topic.
Shaders cannot emit lighting in the default version of unity. Why not use a point light, or something similar?
@Namey5 That's strange, I thought that you could, I'm not sure why. If I put the point light inside of the object, will it still shine through?
Well, technically you can have objects emit light, but they have to be static and baked. Realtime area lights are supposed to be co$$anonymous$$g sometime soon, but for the moment, as long as you set up a layer for your emissive objects and set the light to not render that object it should work.
Your answer
Follow this Question
Related Questions
Exporting graphically created shaders in Visual Studio to Unity. [.glsl to .shader] 0 Answers
Broken HDRP Lit and Unlit Shaders 0 Answers
Storing data from previous shader pass 0 Answers
Intercept last pass on a surface shader to change RGB of that pixel 0 Answers
how do i fix a black texture/shadow? 1 Answer