Hi, sorry if this has an obvious answer, but I haven’t been able to find anything that works.
A while ago I wrote a custom shader to achieve a certain lighting effect using emission from an object, but never got it working properly with actual emission (only the albedo colour seems to be present). Since reading up more on lighting in Unity I took my test scene back to basics and still can’t get even standard stuff working.
Scene has:
cube with standard shader, emitting red light, set to dynamic
plane with standard shader, set to dynamic
sphere with standard shader set to dynamic
realtime GI enabled
light probe in the middle of the scene covering all objects
no directional lighting, no skybox or ambient light in the scene at all
Nothing I’ve tried will get lighting to show up on the plane or sphere in the scene from the emission on the cube. Putting them all into static mode immediately shows emitted light, but in dynamic mode the scene is completely dark.
No scripts, custom shaders or materials. What am I doing wrong?
Been a long time since I worked with this, but don’t dynamic objects require light probes in order to pick up emission light that is shining? Possibly you need more than one.
Normally only static objects will receive emission, and that’s due to the application of the emission through baking. You didn’t mention baking, but I assume you are doing it.
So depending on how you set this up and what you are doing, there could be issues.
I’d say keep playing with it, changing things here and there. That’s often the best way to learn. Often it’s really simple stuff that causes the problem.
Yes, I’m having trouble. I did read through the entire lighting section but somehow it’s not clear to me if a dynamic emissive object is even possible with realtime GI. That at least seems to be the result I’m seeing now.
I just messed with it a little, and it seems your emitter object needs to be light static, even with light probes. Maybe that’s the issue?
Additional things to play with: emission intensity, and placement of the light probes (like, do you have probes between the light and the object to be lit?).
Yeah, I just don’t know if that’s a fundamental limitation of the system? Clearly regular lights can be dynamic and still influence realtime GI. I know about the 4 light source limitation of forward rendering etc, but I only have one light source in the scene - the emissive cube.
Well, for the particular effect I was going for with the custom shader, the object also needs to move around, although maybe I can fake it by using a vertex shader and moving the vertices there. Then I could keep the object static presumably.
I get this scene, using the cube for emission, with only the cube set to lightmap static, a light probe group, and baking. The emission intensity of the cube is 1.1.
If you need moving emissive lighting that lights up other objects, you’ll need something for dynamic GI like SEGI.
Basically, baked lighting is “free” because of the precomputing. But if you want dynamic emissive lighting, then you will incur what is essentially the cost of continuous baking.
Wow, I’ll take a look into that, although it’s probably overkill for the small things I want to do. Seeing as what I originally had in mind seems to be impossible I’ll look into doing it another simpler way, perhaps with a point light.
No problem. While a lot of people use baked light all the time, especially for mobile, it’s not a great solution for me. But when you go for non-baked lighting, you either have to go with actual lights - not emission - or something like SEGI. And SEGI requires a modern desktop GPU.
I guess given that a regular light emits from a single point, and geometry can take on any arbitrary shape, it makes sense that real-time emission from geometry would be difficult to achieve while that geometry is moving. Perhaps the documentation could be clearer around that - probably to seasoned game developers or lighting people it would be obvious due to the complexity, but I’m still learning.