Jump to content


Photo

Troubles with transparent editor textures


  • Please log in to reply
19 replies to this topic

#1 Skaruts

Skaruts

    Member

  • Member
  • PipPip
  • 279 posts

Posted 05 February 2014 - 07:34 PM

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, 06 February 2014 - 12:05 AM.


#2 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37406 posts

Posted 05 February 2014 - 08:42 PM

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.
TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#3 Skaruts

Skaruts

    Member

  • Member
  • PipPip
  • 279 posts

Posted 05 February 2014 - 09:05 PM

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, 05 February 2014 - 09:06 PM.


#4 hypov8

hypov8

    Member

  • Member
  • PipPip
  • 29 posts

Posted 05 February 2014 - 09:22 PM

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

#5 Skaruts

Skaruts

    Member

  • Member
  • PipPip
  • 279 posts

Posted 05 February 2014 - 09:41 PM

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, 05 February 2014 - 09:45 PM.


#6 Skaruts

Skaruts

    Member

  • Member
  • PipPip
  • 279 posts

Posted 05 February 2014 - 11:10 PM

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, 05 February 2014 - 11:13 PM.


#7 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPipPip
  • 5701 posts

Posted 05 February 2014 - 11:37 PM

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: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.

#8 Skaruts

Skaruts

    Member

  • Member
  • PipPip
  • 279 posts

Posted 06 February 2014 - 12:02 AM

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, 06 February 2014 - 12:03 AM.


#9 Skaruts

Skaruts

    Member

  • Member
  • PipPip
  • 279 posts

Posted 06 February 2014 - 04:41 AM

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, 22 October 2018 - 09:09 PM.

  • nbohr1more and SteveL like this

#10 SteveL

SteveL

    Hero Coder

  • Active Developer
  • PipPipPipPip
  • 3669 posts

Posted 06 February 2014 - 07:20 AM

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

#11 hypov8

hypov8

    Member

  • Member
  • PipPip
  • 29 posts

Posted 06 February 2014 - 08:00 AM

did u notice it appear when you are using translucent in your shaders.

#12 Skaruts

Skaruts

    Member

  • Member
  • PipPip
  • 279 posts

Posted 06 February 2014 - 08:40 AM

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.

#13 Skaruts

Skaruts

    Member

  • Member
  • PipPip
  • 279 posts

Posted 07 February 2014 - 02:31 PM

Now this was unexpected... :(

#14 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37406 posts

Posted 07 February 2014 - 02:36 PM

Huh. That green thing is a the sword's clipmodel, and the belt has a nodraw texture in the basic skin.
TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#15 Skaruts

Skaruts

    Member

  • Member
  • PipPip
  • 279 posts

Posted 07 February 2014 - 02:49 PM

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, 07 February 2014 - 02:50 PM.


#16 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37406 posts

Posted 07 February 2014 - 03:11 PM

Is there a difference between the material shader for the in-game texture and the material shader for the editor image?
TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#17 Skaruts

Skaruts

    Member

  • Member
  • PipPip
  • 279 posts

Posted 07 February 2014 - 03:21 PM

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, 07 February 2014 - 03:21 PM.


#18 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 37406 posts

Posted 07 February 2014 - 03:51 PM

The qer_editorimage is the one used by DR. Not sure if you can add stages to it or not.
TDM Missions:   A Score to Settle   *   A Reputation to Uphold   *   A New Job   *    A Matter of Hours
 
Video Series:   Springheel's Modules   *   Speedbuild Challenge   *   New Mappers Workshop  *   Building Traps

#19 Skaruts

Skaruts

    Member

  • Member
  • PipPip
  • 279 posts

Posted 07 February 2014 - 06:39 PM

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, 07 February 2014 - 09:23 PM.


#20 Skaruts

Skaruts

    Member

  • Member
  • PipPip
  • 279 posts

Posted 07 February 2014 - 10:23 PM

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, 07 February 2014 - 10:24 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users