Is the big circle icon simply a white circle? Because that would be consistent with your results. If you want to light only the player, then what you need is a duplicate of their icon (with all of its overlays) on the lighting plane, using KEEP_TOGETHER and a matrix that forces the whole thing to be white. (In a future version I'd like to support a simpler way of doing this.)
What's the exact lighting effect you're going for?
The big circle is a glowing yellow circle(it has a glow effect to it, not just a simple white circle). Not sure if that's what you were asking, but I'm not just trying to light the player but also the area around it. The effect I'm going for is what's on the second pic which is a glowing circle around the player(I know it may be a bit hard to tell) and I am also trying to have other objects on the map have this effect as well.
|
To further clarify, the effect I want is that of a glowing yellow circle around the player; right now for some reason the glowing circle has no AA and it has no alpha pixels, something is causing it to render as just one big blob.
|
Is it possible you've got a color matrix being applied to the player or something like that? You could try setting RESET_COLOR and NO_CLIENT_COLOR on the glow.
|
In response to Lummox JR
|
|
None that I recall and I tried setting the RESET_COLOR and NO_CLIENT_COLOR on the glow and no luck.
edit: I've also tried RESET_ALPHA and KEEP_APART. Doesn't matter whether I add them to the overlays or the client.screen it always renders the same. I've been stuck with this for two days :/ |
Try changing your lighting plane to BLEND_OVERLAY just so you can see the lighting alone. That ought to give you some data to work with. I would also recommend you take a look at the light and get some output of what its color setting looks like, and what its parent color looks like, using json_encode() if either is a list.
|
When I change it to BLEND_OVERLAY this is what I get: I'm not sure what I am to make of this or how it helps.
The light itself has no color matrix applied it but this is what I got for the plane-master: planeMaster:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0.2,0.2,0.2,1] |
Oh shoot, I didn't even notice this earlier, but the fourth item in your color list for the plane master should be "#0000", not null. You want to zero out the plane's intrinsic alpha and set it to full with the last argument; what it's doing now is preserving alpha and adding full alpha to it, driving it past full which causes weird results on some video cards.
|
It didn't change anything, this is how the code looks:
obj this is what I get from json: planeMaster:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0.2,0.2,0.2,1] I'm pretty sure I tried this beforehand and it didn't help. The result is the same as before. |
I feel like the solution to this is very simple, I just can't seem to figure out what is causing it...
|
For others who are stuck on a similar issue with the lighting, the problem is that the color matrix being applied is adapting to the fact that the composite plane image--all of the lights added together--uses premultiplied alpha values.
The solution I found for this is to add a black backdrop to the lighting plane. The plane master is moved to screen_loc="CENTER", and the backdrop is an overlay. The backdrop has a black icon, a transform to scale it up beyond world.view in size so that it covers the screen, and then FLOAT_PLANE and BACKGROUND_LAYER. With the black backdrop in place, the plane is fully opaque, which means when the color matrix is applied the fact that the alpha has been premultiplied is meaningless. Result: happy lighting. |
Nice hair in the second gif.