Grass Edges

From The DarkMod Wiki
Revision as of 19:07, 22 February 2011 by Fidcal (talk | contribs) (→‎Basic grass edge for all three grass types)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Introduction

written by Fidcal

This is about the grass edges, patches, and paths textures in update 1.03.

These are all textures under nature > grass > grass_edge.

I've not done prefabs at this time and I'm not sure it's worth it. The final versions consist of three types:


Basic grass edge for all three grass types

This is an endless 2-sided grass strip that you overlay over the hard join between grass and any other surface. You need to scale it approximately to the same as the grass but it does not need to be aligned with the grass particularly as its grass edge side blends in. You only need align the visible grass edge where you want it. There is a lot of space on this 1024 x 1024 tile, virtually half. This makes it easier to align (I tried using a 1024 x 512 tile without the space but however I adjusted and tweaked it was a nuisance to align.) You can also use this edge up against a wall by bevelling that edge a tiny amount up the wall. You can see many examples in the little courtyard in Biker's St. Alban's cathedral.

It's simple but hard to explain. Here is a guide: A summary would be create a long north south patch the same scale and alignment as your grass and give it the grass edge decal texture you want (making sure the white grass runs down the middle of the patch) then turn and move it to overlap the edge between your grass and any other surface. The patch needs to be a func_static with the property shaderparm3 and value 0.01 (thin) to 0.99 (thick) (0.5 is normally fine.)

  • You start with a grass-textured surface and any other surface side by side, let's use dirt and dark grass as an example.
  • So you have a straight hard edge between them.
  • Select one of the surfaces.
  • Menu > Brush > Create Decal Patches
  • If this is flush with the surface (depends on your setting) set grid size 0.125 and raise the patch just clear.
  • Leave the texture as _default or any texture for now.
  • Move the patch so it overlaps the join between the grass surface and the dirt and covers the length you want to cover.
  • The width depends on the texture scale. For 0.25 it is roughly between 48 and 64.
  • 64 is the width of one tile of the grass edge texture at that scale.
  • About half of that is blank to give you plent of room to manoeuvre.
  • If your patch is bigger than 64 then you will get part of the next tile so that is the max.
  • If you go too small, say 32 or less then you won't get all the texture.
  • So keep the patch width between 48 and 64 for texture scale 0.25
  • Rotate the patch temporarily so it lies north south length-wise
  • Copy and paste from the dark grass surface to the patch.
  • It should now be textured the same texture and scale as the grass and blend in perfectly with the grass.
  • Now give the patch the texture: textures/darkmod/nature/grass/grass_edge/short_dry_grass_dark_edge
  • You should see a long strip of white grass on black.
  • All the white should be within the patch and not overlap the edge (so there is full black on both the east and west edges with the white in the middle.)
  • If the white overlaps either edge then move the patch along and repeat the paste texture and retexture.
  • Now move and rotate the patch to overlap the grass and dirt edge you want to blend.
  • The full white centre should go over the centre join.
  • The blurred edge normally goes on the grass side and the grass blade edge over the dirt but you can do it the other way for a softer edge.
  • When in position it is OK to make slight adjustments of resizing but not large.
  • You need to make the patch a func_static
  • Then give it the property shaderparm3 with value 0.5
  • The value can be anywhere between 0.01 (thin) to 0.99 (thick)
  • When you first change it to func_static you need to dmap again.
  • Once dmapped you don't need to dmap again if you just change the shaderparm3 value
  • In game, the white parts should show as grass that blends with your brush grass and the black is transparent.

Grass patch

This is like a woolly bath mat. Place it over alignment errors, path ends, or just as a stand-alone grass patch.


Instant paths

These are endless 2-sided strips but they are the reverse of the above. They consist of many dirt and stone textures with grass blade alpha edges that blend into any grass texture. Just drop a patch onto any grass surface and give it one of these path textures and you've got a path with a soft edge. Width is limited to texture scale is the downside but at least once you've made the path you can stretch it sideways somewhat within reason. The long ends of these paths are hard so either you end them at some other surface like another path or doorstep or alternatively drop a grass patch over the end. I have provided all that seemed appropriate of our current dirt and cobble floor textures but it is relatively easy to copy one of those and make a new type if you need it. This path type might also work with materials other than grass to soften the edges but they are not random crumb; they are rough grass blade alpha. But you find dirt on straw or dirt on dirt stone on dirt might work I don't know.

When would you use one rather than another? The edges are more versatile and are not limited to just paths whereas the path types are quicker.

You can bend and twist both in all 3 directions so you can have a winding concave path with a dip in the middle up a curving hill. But the path type you cannot really make them go narrower or wider because the patch itself is the path whereas with the edge type they form a path by surrounding some other surface.