Jump to content
The Dark Mod Forums

Problems with blending modes


Springheel

Recommended Posts

Frustration number four while working on the purchase screen. <_<

 

 

I am trying to add a blend effect to the object images. For some reason, however, if I point to a material file, the image will not be transparent. Instead, there are black (or white, depending on the blend mode I use) boxes around the image. The .tga itself is has a transparent background.

 

If I use blend blend, then the transparency renders properly, but that mode just looks like the object is drawn on top of the parchment--it doesn't actually 'blend' with the parchment at all.

 

Here's the material I'm using:

guis/assets/purchase_menu/lantern

{

 

{

blend modulate

map guis/assets/hud/inventory_icons/healthpotion_icon.tga

alpha parm3

}

}

 

And this is what it looks like:

 

image_problem1.jpg

 

Oddly, the black doesn't fill the entire dimensions of the image.

 

I know it's a longshot, but any ideas about why the blend modes aren't rendering the transparency properly?

Link to comment
Share on other sites

Assuming the image has an alpha channel, have you tried to add an "alphatest" expression to the shader?

 

edit: As for your screenshot: the black squares are in the actual RGB bitmap, it seems that the alpha channel (which is shaped correctly) is ignored.

Link to comment
Share on other sites

Assuming the image has an alpha channel, have you tried to add an "alphatest" expression to the shader?

 

I did try an alphaTest 0.5, but it didn't have any effect I could see. Adding "translucent" didn't seem to effect anything either.

 

the black squares are in the actual RGB bitmap

 

I'm not sure what you mean by this. I tried a few different images, and the black boxes seem to follow the shape of the object in the image for some reason.

Link to comment
Share on other sites

Hmm? This is what it looks like for me.

 

image_problem4.jpg

 

Is this a PS 7 problem again?

Have you tried to directly refer to the image file (instead of a shader)?

 

Yep, and that works fine. But it doesn't blend into the parchment and therefore doesn't look very good.

Link to comment
Share on other sites

Can you upload your current state to somewhere so that I can take a look at it? Perhaps I can think about something, or maybe angua (although she's not at home currently, but later this evening).

 

And yes, this is what the image looks like in my Photoshop CS. The black image is in the actual RGB bitmap, the alpha channel is correctly shaped.

Link to comment
Share on other sites

I just loaded it in my PS5.5 downstairs, and it looks like yours there. Clearly I need a new version of PS, because 7 does not render it like that all.

Link to comment
Share on other sites

Putting a white background instead of a transparency helped a lot. Here's what it looks like now, which is pretty close to what I wanted:

 

menuimage.jpg

Link to comment
Share on other sites

What's the diffrence between blend filter and blend modulate? Anytime I used it in my material shader it gave the same results.

 

Hmm? This is what it looks like for me.

If I do some textures with alpha channels I never use that Photoshop transparency. I just have background in solid colour (black or whatever) and then I create a greyscale channel called Alpha1 (or something like this - the default name anyway) and I save it as TGA 32-bit. If you want the bottle to be semitransparent then Alpha channel should be grey there and black at the background.

Link to comment
Share on other sites

Hmm? This is what it looks like for me.

The thing to remember in this situation is that two transparent pixels can actually have different RGBA values, and yet look exactly the same. For example, RGBA 0,0,0,255 is different from RGBA 255,255,255,255, even though they look exactly the same (i.e. they're completely transparent). That's what was happening with that health potion image; the alpha channel was being ignored entirely, so the RGBA 0,0,0,255 pixels were showing up black while the RGBA 255,255,255,255 pixels were showing up white. Greebo turned off the alpha channel in that image he posted in order to demonstrate this.

 

"Modulate" basically means "multiply" (using decimal values for the colours, i.e. 0.0 to 1.0 instead of 0 to 255), which is why white looks "transparent" with the modulate blend mode active. Since white is "RGB 1.0, 1.0, 1.0" (again using decimal notation), and 1.0 multiplied by any number is that number.

 

The end result looks cool, nice work. :)

 

@PinkDot: Modulate and filter are the same, according to this handy reference page.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

  • 9 years later...
  • Like 1

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 5 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...