STYLE_Shaded - ?
Moderator: GZDoom Developers
STYLE_Shaded - ?
I was poking around in the source (!) in hopes of solving a problem of mine. I *almost* found a solution, but it seems it's not implemented.
The feature in question: STYLE_Shaded. Its description in r-blend.h reads "Treat patch data as alpha values for alphacolor" -- Would I be correct in saying this acts like an "additive" STYLE_Stencil? (i.e. a pixel of color #FFFFFF would show as fully opaque while #000000 would be invisible, #888888 half-way between?)
I may be way off, but I can't test it. It seems this flag is not actually usable in DECORATE, and Stencil doesn't do what I hope for. If my understanding of this style is off, please correct me, but otherwise I have some use for it. Perhaps this could be added, if the case is yes?
Also, I've heard "rumors" of a subtractive blending style as well, but it seems it can't be used at the moment. Would it be terrible at all to allow us access to it? Sounds very interesting and would also provide a solution to my problem. I'm looking for a way to make a sprite have inverse-additive color: black is fully opaque while white is invisible. Currently, no way exists to pull this off, and that's a problem. Any help?
The feature in question: STYLE_Shaded. Its description in r-blend.h reads "Treat patch data as alpha values for alphacolor" -- Would I be correct in saying this acts like an "additive" STYLE_Stencil? (i.e. a pixel of color #FFFFFF would show as fully opaque while #000000 would be invisible, #888888 half-way between?)
I may be way off, but I can't test it. It seems this flag is not actually usable in DECORATE, and Stencil doesn't do what I hope for. If my understanding of this style is off, please correct me, but otherwise I have some use for it. Perhaps this could be added, if the case is yes?
Also, I've heard "rumors" of a subtractive blending style as well, but it seems it can't be used at the moment. Would it be terrible at all to allow us access to it? Sounds very interesting and would also provide a solution to my problem. I'm looking for a way to make a sprite have inverse-additive color: black is fully opaque while white is invisible. Currently, no way exists to pull this off, and that's a problem. Any help?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: STYLE_Shaded - ?
You are correct. This style isn't exposed to DECORATE. Shouldn't be too hard to add. What it does is to treat 8 bit indexed images as alpha maps (i.e. index 0 = fully translucent, index 255 = fully opaque.) For True Color images it only uses the red channel the same way. So it seems that it does what you need. FYI, this is the style most decals are drawn with.
As for subtractive, the reason it hasn't been exposed is that I still haven't figured out which combination of render styles to use. Randy has made the system fully flexible - which, even though it sounds good, isn't. Most render style combinations are more or less worthless and subtractive is particularly nasty when fog comes into play. So in order to make it useful the best combination has to be found first - if it exists.
As for subtractive, the reason it hasn't been exposed is that I still haven't figured out which combination of render styles to use. Randy has made the system fully flexible - which, even though it sounds good, isn't. Most render style combinations are more or less worthless and subtractive is particularly nasty when fog comes into play. So in order to make it useful the best combination has to be found first - if it exists.
Re: STYLE_Shaded - ?
Ah, yes. This is indeed exactly what I'm looking for. Though, if I'm reading you correctly, I should greyscale images and import them as .PNGs to achieve the desired effect (instead of using the doom palette)?
Hmm... I do recall a bit of deliberation on the subtractive blending among the developers, and I agree if it's technically "unfinished" it shouldn't be available just yet. I'm in no rush here -- Shaded works just as well for me.
Hmm... I do recall a bit of deliberation on the subtractive blending among the developers, and I agree if it's technically "unfinished" it shouldn't be available just yet. I'm in no rush here -- Shaded works just as well for me.
Re: STYLE_Shaded - ?
Yes, it works exactly like decals do.Xaser wrote:I should greyscale images and import them as .PNGs to achieve the desired effect (instead of using the doom palette)?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: STYLE_Shaded - ?
Added "Shaded" as a valid parameter for DECORATE's RenderStyle.
Re: STYLE_Shaded - ?
I hate to say it, but it's still not working.
Are you sure it's "RenderStyle Shaded"? I'm still getting a syntax error with the latest SVN (r908). Using 'STYLE_Shaded' doesn't help either. Did I screw up?
Are you sure it's "RenderStyle Shaded"? I'm still getting a syntax error with the latest SVN (r908). Using 'STYLE_Shaded' doesn't help either. Did I screw up?
Re: STYLE_Shaded - ?
According to the change log, this change was made in r865, but looking through the source file changes for that revision I wasn't able to find anything in the code that seemed to reference it. Could this have been overlooked?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: STYLE_Shaded - ?
The change must have gotten reverted by something so I had to add it again.
Re: STYLE_Shaded - ?
Huh. It's still not working right.
It appears that index 0 shows up as fully-opaque instead of fully-transparent. Now I have two full-opaque colors, which is not good.
I'm using this image:

And the end result is this:

Am I allowed to define .png transpacency with this renderstyle, at least? That could provide a temporary solution though judging from your description earlier, something's definitely wrong here. Oversight, perhaps?
Thanks for your help here though... sorry I keep reviving a dead horse here. ;P
It appears that index 0 shows up as fully-opaque instead of fully-transparent. Now I have two full-opaque colors, which is not good.
I'm using this image:

And the end result is this:

Am I allowed to define .png transpacency with this renderstyle, at least? That could provide a temporary solution though judging from your description earlier, something's definitely wrong here. Oversight, perhaps?
Thanks for your help here though... sorry I keep reviving a dead horse here. ;P