Jump to content
The Dark Mod Forums
Sign in to follow this  
Skaruts

Troubles with transparent editor textures

Recommended Posts

As suggested by Obsttorte I've been trying to make the editor textures transparent myself. So I looked at the material file for most of them (tdm_internal_engine.mtr), and found a translucent one - overdrawtest.

 

translucent
{
 blend filter
 map  textures/common/overdraw.tga
}

 

I copied these definitions from there and pasted in all the others, and it worked, but not as I was hopping. I messed around with the blend modes and I couldn't get anything decent. I don't understand exactly what the blend modes do, so it's hard for me to find a balanced combination.

 

So I went looking for other textures that were already transparent. Rain_splashes don't have the translucent keyword, but they're still transparent. They have this:

 

   {  //needed to emit particles
  blend   filter
  map	  _white
  }

 

But this makes it too dark, in fact. And it turns out the keyword "translucent" seems to be irrelevant for the editor, I removed it from the others and they were still transparent.

 

RJFerret suggested Speakers, but it turns out their texture is only transparent when viewed in the speaker entity, not on brushes.

 

So, does anyone understand blend modes enough to suggest combinations that may give good results?

 

Some examples from the Hammer Editor. They can illustrate my goal. I'd like to get closer to that as I can.

Ex1, ex2, ex3, ex4, ex5

Edited by Skaruts

Share this post


Link to post
Share on other sites

Blend add lightens whatever is behind it by the brightness of the texture.

 

Blend filter darkens whatever is behind it by the darkness of the texture (like dirt decals)

 

I've never had a good handle on what gl_dst color does.

Share this post


Link to post
Share on other sites

Add, Filter, Modulate and all those seem to be presets that combine two of those gl_ arguments. They are listed here (search for Stage Keywords), but they don't explain what these arguments mean beyond the self explanatory names. Obviously they are related to opengl, but...

 

...hmm!

Edited by Skaruts

Share this post


Link to post
Share on other sites

what about

blend blend

and make an alpha channel in your images. adjust untill corect transparency..

another idea is that you could have the texture letters more bold (more white) in alpha channel

you might be able to use 1 alpha image and add another stage to shader

Share this post


Link to post
Share on other sites

It seems the blend modes are more or less the same as what photoshop does with layer blend modes. Except that you're actually imputing gl keywords to make them.

http://www.benmcdowe...odes-in-opengl/

 

I tried multiply, but it looks bad. I superimposed the same textures in photoshop just to double-check, and it looks exactly as bad. So a way to deal with the alpha directly is probably what I want instead of blend modes.

 

what about

blend blend

and make an alpha channel in your images. adjust untill corect transparency..

another idea is that you could have the texture letters more bold (more white) in alpha channel

you might be able to use 1 alpha image and add another stage to shader

 

And I was just now trying that, but it seems the alpha channel doesn't change anything. I must be missing other parameters in the material definitions for that end. (or I'm doing something wrong with the alpha)

 

As for having a separate alpha image, I don't yet know the parameters to use it either.

Edited by Skaruts

Share this post


Link to post
Share on other sites

I'm dumb... Of course an alpha channel doesn't work if you don't place the modified image back in the pk4...

:ph34r::blush:

 

But the blend blend mode is creating glitches for some reason.

Edited by Skaruts

Share this post


Link to post
Share on other sites

Didn't you want to make some textures transparent in the editor, or is this something else?


FM's: Builder Roads, Old Habits, Old Habits Rebuild

WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Let's Map TDM YouTube playlist:

Texture Blending in DR: DR ASE Blend Exporter

 

End of shameless self promotion.

Share this post


Link to post
Share on other sites

Didn't you want to make some textures transparent in the editor, or is this something else?

Yup, I did it, pretty much how you suggested. But the transparency didn't look any decent, so I'm trying to fix that.

Edited by Skaruts

Share this post


Link to post
Share on other sites

Ok I got the blend blend mode and the alpha channels working and it actually looks great, but there's a glitch that I can't get rid off... I solved it for NoDraw quite a while ago, but I can't remember what was the cause, and I just can't think of anything now. :(

You can see the vis portals on the back rendering in front.
(Alpha channel if full white just to make the glitch more noticeable.)
FK8sN3i.png



Any clues, anyone?

EDIT: Seems like I just solved it somehow. It's something to do with either the alpha channel or my tga saving settings. But still, the Wasser texture renders on top of the vis portal texture... I haven't messed around with the wasser. Damn...

EDIT2: Found the problem. It's a natural consequence from blending. I don't understand the math completely, but basically, with blend blend, the higher the opacity on the alpha the less visible the front texture becomes and the more visible the back texture becomes. So basically what's on the picture is the front image becoming fully transparent and the back one becoming fully opaque due to the equations involved, when being drawn to the buffer. Lowering the alpha (less opacity) solved it.

In some other cases the problem was that the other textures didn't have alpha yet, but had blend modes in the materials. So the "problem" is "solved". :)

I'll share this for whoever is interested in using it when it's ready. I'm doing a personalized version of the textures for a cleaner and clearer look, but I'll make transparency for the original ones too.

Thank you all for the help.

Edited by Skaruts
  • Like 2

Share this post


Link to post
Share on other sites

I was about to ask you what your blend options were but I'll wait for your final post. Thanks for sharing. NB you probably have fixed this bit already but if blend filter/add are having too much of an effect you can modulate that stage by adding rgb 0.5 or whatever value to the stage.

 

I don't know anything more about open gl blending btw, but I did spend one evening studying it last week when I wanted to get windows to look right both from the lit side and the dark side. The rgb and blend src/dest were the options I twiddled till I got the effect I wanted :-)

Share this post


Link to post
Share on other sites

I've been using translucent all along. I noticed later that it is actually necessary. When I said it wasn't I had probably forgotten to place the file back in the pk4. Sometime later I just unpacked it and worked from there, it's much easier and I don't make that sort of mistakes.

Share this post


Link to post
Share on other sites

Huh. That green thing is a the sword's clipmodel, and the belt has a nodraw texture in the basic skin.

Share this post


Link to post
Share on other sites
Huh. That green thing is a the sword's clipmodel, and the belt has a nodraw texture in the basic skin.

Indeed. And his eyepatch too.

 

Found another one... what the heck...

Edited by Skaruts

Share this post


Link to post
Share on other sites

Is there a difference between the material shader for the in-game texture and the material shader for the editor image?

Share this post


Link to post
Share on other sites

No clue. As far as I know there's only one material shader for each texture.

 

textures/common/collision
{
description  "on a model : surface will be used for collision detection instead of the visual surfaces. Used for simplifying physics with complex objects"
qer_editorimage textures/common/collision.tga
noshadows
collision
// translucent
// {
//	 blend  blend
//	 map  textures/common/collision.tga
// }
}

 

Commenting that part solved it, but this screws my plans.

Edited by Skaruts

Share this post


Link to post
Share on other sites

The qer_editorimage is the one used by DR. Not sure if you can add stages to it or not.

Share this post


Link to post
Share on other sites

With and without the translucency settings. (the black ones on the top are the default Shader Not Found - but those are as they should be)

 

The only ones that don't show up are those that I didn't place any translucency in, like caulk and shadows and some others. I have no clue what to do about this...

 

EDIT: It's really weird though, that in actual maps from FMs, only two or three of these textures show. Collision, nodraw and entityGUI. All others are invisible...

Edited by Skaruts

Share this post


Link to post
Share on other sites

It seems qer_trans and qer_alphafunc don't work with DR. I found some old posts from Greebo saying this isn't supported by Doom. :(

 

So it seems my plans are really screwed. If only I could understand why it's just those 3 textures that show up in game in FM maps as opposed to my test map where they all show up, then maybe...

 

I'm not too hopeful though.

Edited by Skaruts

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...