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

    • Ansome

      Finally got my PC back from the shop after my SSD got corrupted a week ago and damaged my motherboard. Scary stuff, but thank goodness it happened right after two months of FM development instead of wiping all my work before I could release it. New SSD, repaired Motherboard and BIOS, and we're ready to start working on my second FM with some added version control in the cloud just to be safe!
      · 0 replies
    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
×
×
  • Create New...