ID:2029175
 
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
My ambition is to have some sort of pretty lighting and still have it perform well in a multiplayer environment.

Referring to this video... http://webmshare.com/DAWLx
For the shadows on the ground, I am creating an overlay for the light orb and modifying these overlays' transforms every server tick, and keeping the light orb on KEEP_TOGETHER and BLEND_ADD. This way the shadows can correctly interact with other light sources. However, I would prefer to not recompute and change these shadows transforms every tick, and instead do it maybe once every other or every third server tick. Because these shadows are overlays of the lights and not to the objects that are casting them, doing so will make the shadows look choppy.

The reason why the shadows move smoothly in this video is because their transforms and pixel offsets are updated every tick. The transform does not change much tick per tick, so if the shadows moved correctly with the objects that are casting them without having to remove and reapply the overlay and without having to update the pixel offset of the shadow appearance, the transform would not need to be recomputed and updated every tick.

I would like the shadows' location to be "parented" to the objects that are casting them, but I still want them to be "kept_together" with the lights to mask them to the light, so I can have multiple lightsources affecting the same object.

So in other words, in my ideal world shadows would be underlays to the mobs in the video, and the shadows' appearance would have some tie in to the lights that they are associated with so that they can be "kept_together" with the light.
I think I get what you're saying, but it sounds very difficult to pull off. The only grouping that's done between objects not sharing a parent is the PLANE_MASTER variety, and that only works based on the fact that all objects can be sorted by plane and then the whole plane can be made a child of the master object.
I think I get what you're saying, but it sounds very difficult to pull off.

Globally visible /image objects is what he's asking for.
In response to Ter13
Ter13 wrote:
Globally visible /image objects is what he's asking for.

Not quite, but those would be useful for other things. I want a shadow that's cast by a mob to be masked with a light source, and I don't want to need to constantly change the pixel offsets or translation of this shadow, relative to the lightsource, to keep it aligned with the mob.
I think you can do this with PLANE_MASTER. It appears to work with overlays on other objects if those overlays have the same plane as the master. I'll upload a proof-of-concept in a minute.
What about something like this:
http://files.byondhome.com/DarkCampainger/ PlaneMasterLightingTest_src.zip

(Double-click to place a lamp, drag a lamp to move it)
In response to DarkCampainger
Yeah that would work, but I'm not sure how I feel about having so many plane masters. I may try it out later.
We only have 201 planes to work with. Even assuming the rest of the game and the HUD are on their own planes and you don't need any others for anything, that's only 199 to work with.
In response to MisterPerson
MisterPerson wrote:
We only have 201 planes to work with. Even assuming the rest of the game and the HUD are on their own planes and you don't need any others for anything, that's only 199 to work with.

With my current lighting setup, I'm using planes from -3 to 11. So I would only have access, really, to 96 planes (or 184 if I shifted everything else upwards). I guess I don't see myself having THAT many dynamic lights per Z level (since lights on different Z levels can share the same planes using this convention), so it could be feasible.
Bamp. I figured bumping here would be better than creating a new feature request post; even though the application here is a bit different from what I had requested in my original post, it's still a somewhat similar feature.


What about something like a BLEND_ALPHA_SUBTRACT and BLEND_ALPHA_ADD where...
If you created an image with BLEND_ALPHA_SUBTRACT and added it as an overlay to some parent object, it would subtract the image icon's alpha, per pixel, from the parent icon. And for OR or ADD it would add the alpha. The blend_mode would do nothing for appearances that are not overlays.
What I'm actually thinking of is some kind of more advanced filter system, that can possibly take another image as an argument, where an alpha mask filter would be possible. (The catch: I'm not sure how I'd set that up, syntax-wise.)