STYLE_Shaded - ?

Moderator: GZDoom Developers

Post Reply
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

STYLE_Shaded - ?

Post by Xaser »

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?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: STYLE_Shaded - ?

Post by Graf Zahl »

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.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: STYLE_Shaded - ?

Post by Xaser »

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.
User avatar
Kate
... in rememberance ...
Posts: 2975
Joined: Tue Jul 15, 2003 8:06 pm

Re: STYLE_Shaded - ?

Post by Kate »

Xaser wrote:I should greyscale images and import them as .PNGs to achieve the desired effect (instead of using the doom palette)?
Yes, it works exactly like decals do.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: STYLE_Shaded - ?

Post by Graf Zahl »

Added "Shaded" as a valid parameter for DECORATE's RenderStyle.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: STYLE_Shaded - ?

Post by Xaser »

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?
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Re: STYLE_Shaded - ?

Post by HotWax »

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?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: STYLE_Shaded - ?

Post by Graf Zahl »

The change must have gotten reverted by something so I had to add it again.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: STYLE_Shaded - ?

Post by Xaser »

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:
Image

And the end result is this:
Image


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
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”