“Whenever lights get close to each other their intensities combine, making objects around them brighter than if only one light was present. I understand that this is realistically what should happen, but I only want objects to get so bright. Here is a picture to help explain:”
This question has been answered for the standard render-pipeline and I tried to apply the same methods in URP but it didn’t work and just made everything look trippy. The scenario I’m going for is the second or third image (either will suffice). But the first image is what occurs in URP, example:
The solution for the standard render-pipeline is to add ‘BlendOp Max’ in your shader code, example:
Pass {
Name "FORWARD_DELTA"
Tags {
"LightMode"="ForwardAdd"
}
BlendOp Max
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#define UNITY_PASS_FORWARDADD
Here’s what happens when you apply that solution in URP (editing Lit.shader):
As you can see it has no effect on the way the lighting is blended and it also made everything transluscent and makes everything leave trails in the skybox (there’s only one mountain despite the fact you can see two).
I need a way to blend the lights for a 3D FOV visualisation system.
Initially I used two light culls and two lights; One for the “peripheral vision” (the cylinder light cull the character in the image is standing in) and one for the view cone (think project zomboid) and I would set the lights to pink and set the intensities super high then I would render the camera to a texture with the lights enabled then render again to another texture with the lights disabled, pass both textures in to a shader and do a comparison to make a mask texture then overlay that texture over the screen and it worked but it had its issues the main one being the performance, as you can imagine my GPU didn’t like me very much for rendering the camera 3 times, I was ruining its life and it repayed me by destroying my games performance.
Any suggestions would be highly appreciated. If by some miracle I’m struck with lightening and get hit with an answer I will update this post. Thanks in advance to anybody who even took the time to ponder on my predicament.
I forgot to say, I’m using forward+ rendering, not sure if that will be helpful to know.
EDIT: I think I’ve found a work around, unfortunately I don’t have an answer to the initial question but I have an answer on how to make the 3D FOV in a very clean and perfomant way, need to add the finishing touches, do some tests and I’ll share my findings.