Jump to content


Photo

How do "path" material/textures work?


6 replies to this topic

#1 The Wheezing Geyser

The Wheezing Geyser

    Member

  • Member
  • PipPip
  • 32 posts

Posted 15 August 2017 - 02:52 AM

For example, textures/darkmod/nature/grass/grass_edge/path/dirt/dirt_001_path defined in

materials/tdm_nature_grass_edge.mtr.

 

First problem, all of these 'path' textures display as the identical black and white alpha image in DR, so it's 100% guesswork as to what they might look like in game. 

Next, when I make a patch and apply the above shader it doesn't even display in game.  There's no indication whatsoever that I placed a patch with shader in the location.  

At one point I copy/pasted a path from I think Bikerdude's Alberic (might be another FM) and it was actually a concatenation of two patches, a dirt_solid_nodraw texture on a patch cloned over a patch that'd been turned into a func_static (which seems to be necessary) with a shaderparm3 with value 0.9, and having a textures/darkmod/nature/grass/grass_edge/path/dirt/dirt_002_dark_path shader.

 

Is there any wiki or whatever that explains what's happening here?

 

eta: definitely shaderparm3 is essential to having the shader show at all.  The wiki on shaderparm variables doesn't explain very well - why is it necessary on these paths and not on the decals I've applied, and transparent materials I've made?  What should I keep in mind when giving it a value between 0 and 1?  

The dirt_001_path is totally wrong for the area.  Rats.  And with no easy previews, the rats triumphant.  Maybe I should make my own shaders for this kind of stuff.


Edited by The Wheezing Geyser, 15 August 2017 - 03:29 AM.


#2 Dragofer

Dragofer

    Modeler

  • Member
  • PipPip
  • 462 posts

Posted 15 August 2017 - 03:50 AM

There are 2 types of path textures:
  • The normal ones are dirt with alpha along the edges so they blend in smoothly with the surroundings. You can just put them on top of the grass to get a path.
  • The ones with the _edge suffix are grass textures with alpha, you put them along the border between dirt and grass to conceal the transition. This can also be used for other things than just paths, i.e. if you have a beach.
The first method is easier. You could combine both methods, but I don't think it's necessary.
 
You need to turn the path patches into func_static and use shaderParm3 to control how strongly visible the path textures are. By default they're invisible, so that's why you didn't see anything.

As for what they look like ingame: all path textures are derived from existing dirt or grass textures, you can see which one they're based on by looking at the name.

 
This tutorial by Sotha teaches how to use _edge textures:
Roads

Edited by Dragofer, 15 August 2017 - 03:52 AM.


#3 The Wheezing Geyser

The Wheezing Geyser

    Member

  • Member
  • PipPip
  • 32 posts

Posted 15 August 2017 - 04:22 AM

Thanks dragofer.  
Sotha's tutorials are excellent.

I think I will be making my own materials to do this kind of thing.

 

The textures/darkmod/nature/grass/grass_edge/path/dirt/dirt_001_path isn't really an "edge".  It's a whole path made of a center and two sides that fade out into alpha.

 

I hope I don't come across as whiny.  

 

eta: oops, I see it's only got one "grass" side, and about 90% of it is "center".  With no way of seeing this in DR, there's no way of controlling the placement by eye, except to dmap and play it in TDM and remember how out of whack my placement is.  But there's really no way to edit it, to know wtf my changes to surface properties are doing, except by ...  dmaping and playing again (I have to dmap again because I have to change it back and forth from func_static).   Sure, I know it's "grass" and "dirt", somehow placed in the b&w alphamap that I see in the editor, but that doesn't amount to anything.


Edited by The Wheezing Geyser, 15 August 2017 - 04:45 AM.


#4 Dragofer

Dragofer

    Modeler

  • Member
  • PipPip
  • 462 posts

Posted 15 August 2017 - 04:51 AM

eta: oops, I see it's only got one "grass" side, and about 90% of it is "center".


That sounds like the texture isn't properly aligned to the surface. You could use the surface inspector, S, then 'fit' the texture to make a start on it.

#5 The Wheezing Geyser

The Wheezing Geyser

    Member

  • Member
  • PipPip
  • 32 posts

Posted 15 August 2017 - 05:03 AM

I make my modules to fit my map, I don't make my map to fit modules.
There's no way I want to work with shaders that require I turn the underlying brushes and patches into func_statics just to see them in the game, where I can't even preview what is expected in the DR editor.  No way.  Not just to make a path through a woods, or a cavern.



#6 Dragofer

Dragofer

    Modeler

  • Member
  • PipPip
  • 462 posts

Posted 15 August 2017 - 05:10 AM

You only need to make the path-bearing patches into func_static, which is what you'd eventually do anyway in the name of optimisation. That the path needs a shaderParm is a nuisance for which I don't see any need, but I see it as a quirk of the editor. By the way: you can resize func_statics without reverting them to worldspawn by pressing tab. Useful if you don't want them to lose spawnargs, like here.


I make my modules to fit my map, I don't make my map to fit modules.


You're working with modules then? Or is this in the sense of fitting textures to patches?

#7 The Wheezing Geyser

The Wheezing Geyser

    Member

  • Member
  • PipPip
  • 32 posts

Posted 15 August 2017 - 06:09 AM

dragofer, I've been studying your "river" and have learned much, about how to make an area, use "seed", and I stole your foliage.ase because it's perfect size for... well, just about for general anything.  I found out about how to use func_relays, etc., and I've hardly started learning.  I hardly have a clue how you do it but you sure do keep things fun. (jeez, you even had a perfect carriage, with horses trotting along,...)
 

I find it difficult to work with premade model "modules".  Inevitably I almost instantly find that I have to make a copy of the model in DR made out of brushes and patches, and sometimes with interchangeable brushes and patches (e.g. part of a wall that's a patch, and that has a brush equivalent to replace it in certain circumstances), and which can be retextured, resized, split and decomposed, at will, so I have a fluid working space.  Then I can make my own "corners" since it's part of the underlying geometry.  What I learn from the premade models is about dimensions and style, and it seems to me that there's now a certain "DM Classic" style that I want my maps to belong to.

 

Sotha's tutorial on "roads" was a demonstration of how to make a certain modular "road" out of patches and shaders, with these "edge" textures featured as transition shaders.  But that isn't exactly the application I have in mind and I was trying to use the shaders inappropriately.





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users