Suggestion: Transparency masks?

Started by InCreator, Sun 15/05/2005 20:29:14

Previous topic - Next topic

InCreator

I'm afraid that this has been asked before, but since I couldn't find similar thread, I'll just ask.

Current light/region system needs very much manual work if I'd want to light character continously, gradient-like. So I came to this idea:

An extra lightning layer, which is in grayscale and specifies characters/objects light amount, like it is in many 3D-modelling programs. Basically a gray layer, where gray is default, darker spots darken character and lighter ones lighten. Just like transparency/transcluency/bump/etc maps in 3D graphics.

The opacity of layer could be set from AGS also...

Wouldn't it be easier and faster for lighting system instead of using many regions?

I believe that this can be done even now, just by covering BG with object of same size and using alpha, but this sounds somewhat... slow. Or not?

Turning on/off or changing the mask in game (animating?) could also serve purpose, for switchable lights, shadows, etc...

Also, partial character lighting would be always possible, like making volumetric lights, light rays, - spots, etc. And shadows!

Anyway, engine could support such thing. Sorry if such idea has been explained 100 times beforeÃ,  :-\...

Pumaman

It's a good idea and I can see the benefits, but realistically speaking I can't see it being implemented any time soon.

Is this something that is important to anyone else?

InCreator

To support my idea a little and fight my usual unavailability to explain myself clear, I illustrate my idea:


Usually, when drawing background art in paint program, I make the room itself first:



Then, I have to make light & shading, so I draw (usually onto extra layer) the thingy I called "transparency mask" here (which may be wrong definition), it's basically a black void with some "holes" cut in, transparent areas with gradient-like opacity. On this picture, consider pure white as completely transparent, and gray shades as semi-transparent, depending their darkness.



So, the final step is to put this "transparency mask" onto background, so it covers it. I also give it a bit lower opacity, so room is visible even under totally black portions.



So, drawing led me to an idea - why not apply the mask not in paint program, but directly in AGS itsself? This'll give me automatically all the character/object shading I need, and so that it may be only partial, i.e. characters hand or face is in darkness, while body is exposed to light, etc.

Of course, I clearly see disadvantages of such system.

* Games will take up to 200% more disk space from bg's since there's 2 images now for every room
* Current system is very simple, and there's no way that my idea could be the only lighting system. Only as an extra possibility, maybe, for expert users.
* I'm still not sure how fast/slow such thing would be. Alphas and large images equal usually with "low fps" :D
* This is not usable in 8-bit games. Not sure about 16-bit...

But well, suggestion is made. Maybe this will someday grow into atleast some part of better AGS light system.


strazer

I would like that.

Btw, we have a similar tracker entry in which intermalte suggested the same thing.

Kweepa

It's a pretty good idea I think.
(And by the way, that background is bloody good - you keep getting better!)

The lighting layer wouldn't have to be black and white - you could for example have a red light bulb and red highlights on the character. It could act like a multiply layer in photoshop.
For game size, this would not compress very well with the current background compression scheme (RLE). So yeah, it could bloat up.
Should work fine in 16 bit.

There are some layouts where it wouldn't make a lot of sense though, eg shadow behind the character that the character is clearly not standing in...


Still waiting for Purity of the Surf II

Ubel

At first I didn't really understand what InCreator meant by this but now that I do, I think it would be great feature in AGS. Though I don't think if I would ever need it, but it's cool idea anyway.

scotch

I don't think it sounds like a good idea, lighting just doesn't work like that, it's meant to be in 3d space and it'd just look wrong with a character moving about underneath this light overlay (your idea about using an object would work, give it a try to see what I mean).  What I think could work though, is using a greyscale bitmap to decide the light level of objects/characters that are standing on those locations, kind of like a smoother version of the regions lighting (could be stored at a lower resolution than the room to save memory becase it doesn't need per pixel accuracy).  I'd use that.

Kinoko

Sorry, I disagree scotch ^_^ I would use this feature all over the place! This sort of thing is very commonplace is old-style RPGs and there are all sorts of situations where it would be handy for me.

InCreator

#8
Sure,
Quote
There are some layouts where it wouldn't make a lot of sense though, eg shadow behind the character that the character is clearly not standing in...
such thing should be used very carefully... And I think that staight-lines-style artists won't find much from it. Like this image you provided: the shadow on feet doesn't count feet as 3D objects and doesn't "round" around them, thus making feet look very flat.
But with fuzzy/softly bushed/distorted/antialiased/bah, once again lack of english language/the way I did - the flattening effect wouldn't be so strong.

I followed scotch' advice and used mask as object. It worked and... sorry, but I liked what I saw  :-\

Then again -- it can be used ONLY as light/shadows in FRONT of characters and objects - notice the dark corner near the fridge - when it covered the character, thing really did look very weird. Scotch is right.

Eh, well... I guess I simply found a way to add a little piece of quality to my games so other AGSers would be amazed how did I do that ("You can't do that with AGS, dude!") :)

Conclusion is - It's interesting, but clearly not anything revolutionary, atleast not enough to make CJ waste time on this, thus delaying other improvements.

scotch

Yeah, I think if you do it very softly it could work acceptably, and it does have some uses, I just don't think in general it's a good idea for scene lighting.  It's also good for stuff kinoko would use it for, special effects.
Something like 3d game lightmapping would work best, allowing you to lighten or darken the screen in whatever colour you like with one overlay... I might look in to that... could be a nice plugin, but doesn't need to be part of the engine.

Dee Ess

A-V-Os flashlight plugin has a feature similar to this, might be worth investigating.

Kinoko

The kind of things you often see it used for in RPGs are lighting effects in dark rooms or caves, where the light is coming from a somewhat narrow source. ie Light from windows in a room, or light streaming in from holes in a cave ceiling. The rooms thing especially interests me because it always looks good. It's not a dramatic effect and should never be overused, but when used appropriately, just adds a certain something to the look of a room.

SMF spam blocked by CleanTalk