Tutorial about decal usage?


(thegnat) #1

Can somebody help me out here? Im searching for some good “how to use decals” tutorials for ET. :uhoh:
Thanks.


(SCDS_reyalP) #2

Make a brush out of common/nodraw
put your decal shader on one face.
Place the decal brush such that the face with the decal shader is exactly overlapping the thing surface you want it to show up on.

If you want to make your own decal shaders, have a look a the ones which come with ET. polygonoffset is the important bit. Be warned that even with polygonoffset, you may get z-fighting if you look at the decal from far away.


(sock) #3

Also make sure all your ‘decal’ brushwork is DETAIL so that it does not cut up the existing brushwork into alot of pieces. To convert your brushwork to detail type, Select the brush and press CTRL+M. To filter detail brushwork from the 2d/3d view press CTRL+D. (The filter is a toggle)

The q3map2 compiler also supports a new decal system using the _decal entity and info_null entities. This is something ydnar needs to explains better than me as he designed it. Unfortunately it was developed too late in the project to be effectively used in the SD maps.

Sock
:moo:


(rgoer) #4

I’ve been in touch with ydnar about how _decal works, and this is the basic idea:

  1. Make a simple patch mesh and texture it with whatever decal texture (something with “polygonOffset” in the shader code) you want projected onto brushwork.

  2. Position that patch mesh somewhere that is roughly correspondant to where the source of “projection” would be.

  3. Create an info_null entity and position it somewhere beyond (“beyond” as in “further along the same line of projection”) the brushwork you want the decal to be projected upon.

  4. Select the patch mesh and turn it into a _decal entity.

  5. Select the _decal entity and the info_null entity, and hit ctrl+K to target the decal at the info_null.

  6. (Supposedly) you can now compile and voila.

However, following these directions, I’ve been getting some slightly unpredictable _decal projection. And ydnar seems to have been really busy lately, so I haven’t really heard the definitive word.


(thegnat) #5

Thanks for your replies, mates!
So I guess the tracks on the road at fueldump are made with decals.
Are they done with the “new” decal system or the “old fashioned” way? :wink:
Any chance to get ydnar for a reply about the new decal system? :notworthy:


([rD]MrPink) #6

(sock) #7

[quote=“thegnat”]So I guess the tracks on the road at fueldump are made with decals. Are they done with the “new” decal system or the “old fashioned” way?quote]

The decals on the road in fueldump are patches lined up perfectly with the terrain (well except one area I can think of) and setup with a decal shader. As “rgoer” has discovered the compiler decal system is not perfect and I was pushed to get the map finished so kept the old system. If the new system can be more reliable then it certainly would be very good.

Sock
:moo:


(Mean Mr. Mustard) #8

What decal shader was used for the tracks on fueldump, if I may ask?

I’d like to add some tracks for a truck path to my map. I looked in the textures/decals, but nothing jumped out at me.


(Shallow) #9

snow_sd/snow_track*


(=PoW= Kernel 2.6.5) #10

I’ve also had many questions on decals.
So far, I have been cutting up brushes.
I take a small brush and texture one face with the decal, then place the brush into another brush (usually a wall).
Then I use CSG subtract.

I did try the ydnar method mentioned above with no success.
Perhaps I’m not doing it correctly but I did try it several different ways.

Am I an idiot for doing the way I have?
Should I use the brush inside of a brush method mentioned above?
Any tips on getting the _decal entity to work?

Thanks for any help on this.


(Shaderman) #11

You should never use CSG substract.

Any tips on getting the _decal entity to work?

Yes, here for example: http://splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=7201


(=PoW= Kernel 2.6.5) #12

I’ll check out the .def file.
Nothing useful in that thread as far as I could see.

Never use CSG Subtract? Uh oh. Care to point me in the right direction on that?
I use it lots and now you’ve got me worried.


(Shaderman) #13

Search this forum please! http://splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=4128

Now a small example for using the _decal entity. Use this shader

textures/shaderman/decal_test
{
	qer_editorimage textures/alpha/fence_c10.tga

	surfaceparm nomarks
	surfaceparm trans
	surfaceparm nolightmap
	polygonOffset
	cull none
	nopicmip

	{
		map textures/alpha/fence_c10.tga
		blendFunc GL_SRC_ALPHA GL_ONE
		rgbGen identity
	}
}

with this map:

// entity 0
{
"classname" "worldspawn"
// brush 0
{
( 2304 1024 448 ) ( -1792 1024 448 ) ( -1792 1024 -320 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( -3584 960 704 ) ( 512 960 704 ) ( -3584 960 -64 ) skies/sd_goldrush 0 0 0 0.500000 0.500000 0 0 0
( 1024 1024 192 ) ( 960 960 192 ) ( 1024 1024 960 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( -960 960 -64 ) ( -1024 1024 -64 ) ( -960 960 704 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( -1792 1024 -64 ) ( -1792 960 0 ) ( 2304 1024 -64 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( -1792 960 384 ) ( -1792 1024 448 ) ( 2304 960 384 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
}
// brush 1
{
( -1024 3584 704 ) ( -1024 512 704 ) ( -1024 512 -64 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( -960 -2560 448 ) ( -960 512 448 ) ( -960 -2560 -320 ) skies/sd_goldrush 0 0 0 0.500000 0.500000 0 0 0
( -960 -960 192 ) ( -1024 -1024 192 ) ( -960 -960 960 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( -1024 1024 -64 ) ( -960 960 -64 ) ( -1024 1024 704 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( -960 512 0 ) ( -1024 512 -64 ) ( -960 -3584 0 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( -1024 512 448 ) ( -960 512 384 ) ( -1024 -3584 448 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
}
// brush 2
{
( 1792 3584 -64 ) ( -2304 3584 -64 ) ( -2304 512 -64 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( -1792 512 0 ) ( 2304 512 0 ) ( -1792 -2560 0 ) goldrush/sandygrass_b_phong 0 0 0 0.500000 0.500000 0 0 0
( -1792 960 0 ) ( -1792 1024 -64 ) ( 2304 960 0 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( -1792 -1024 -64 ) ( -1792 -960 0 ) ( 2304 -1024 -64 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( -1024 512 -64 ) ( -960 512 0 ) ( -1024 -3584 -64 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 960 512 0 ) ( 1024 512 -64 ) ( 960 -3584 0 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
}
// brush 3
{
( -1024 -1024 704 ) ( 3072 -1024 704 ) ( 3072 -1024 -64 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 2304 -960 704 ) ( -1792 -960 704 ) ( 2304 -960 -64 ) skies/sd_goldrush 0 0 0 0.500000 0.500000 0 0 0
( -1024 -1024 192 ) ( -960 -960 192 ) ( -1024 -1024 960 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 960 -960 -64 ) ( 1024 -1024 -64 ) ( 960 -960 704 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( -1792 -960 0 ) ( -1792 -1024 -64 ) ( 2304 -960 0 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( -1792 -1024 448 ) ( -1792 -960 384 ) ( 2304 -1024 448 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
}
// brush 4
{
( 1024 -2560 704 ) ( 1024 512 704 ) ( 1024 512 -64 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 960 512 960 ) ( 960 -2560 960 ) ( 960 512 192 ) skies/sd_goldrush 0 0 0 0.500000 0.500000 0 0 0
( 1024 -1024 -64 ) ( 960 -960 -64 ) ( 1024 -1024 704 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 960 960 192 ) ( 1024 1024 192 ) ( 960 960 960 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 960 512 384 ) ( 1024 512 448 ) ( 960 -3584 384 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1024 512 -64 ) ( 960 512 0 ) ( 1024 -3584 -64 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
}
// brush 5
{
( -1792 -2560 448 ) ( -1792 512 448 ) ( 2304 512 448 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( -1792 512 384 ) ( -1792 -2560 384 ) ( 2304 512 384 ) skies/sd_goldrush 0 0 0 0.500000 0.500000 0 0 0
( -2048 -960 384 ) ( -2048 -1024 448 ) ( 2048 -960 384 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( -1792 1024 448 ) ( -1792 960 384 ) ( 2304 1024 448 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( -960 512 384 ) ( -1024 512 448 ) ( -960 -3584 384 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
( 1024 512 448 ) ( 960 512 384 ) ( 1024 -3584 448 ) common/caulk 0 0 0 0.500000 0.500000 0 4 0
}
// brush 6
{
( 112 304 0 ) ( 112 336 0 ) ( -112 336 0 ) metal_misc/ametal_m02 0 0 0 0.500000 0.500000 134217728 0 0
( -112 336 16 ) ( 112 336 16 ) ( 112 304 16 ) metal_misc/ametal_m02 0 0 0 0.500000 0.500000 134217728 0 0
( -128 336 16 ) ( -128 304 16 ) ( -128 304 0 ) metal_misc/ametal_m02 0 -128 0 0.500000 0.500000 134217728 0 0
( -112 192 16 ) ( 112 192 16 ) ( 112 192 0 ) metal_misc/ametal_m02 0 -128 0 0.500000 0.500000 134217728 0 0
( 128 304 16 ) ( 128 336 16 ) ( 128 336 0 ) metal_misc/ametal_m02 0 -128 0 0.500000 0.500000 134217728 0 0
( 112 448 16 ) ( -112 448 16 ) ( -112 448 0 ) metal_misc/ametal_m02 0 -128 0 0.500000 0.500000 134217728 0 0
}
}
// entity 1
{
"angle" "90"
"origin" "0 0 32"
"classname" "info_player_deathmatch"
}
// entity 2
{
"angle" "180"
"origin" "384 0 32"
"classname" "team_CTF_bluespawn"
}
// entity 3
{
"origin" "-384 0 32"
"classname" "team_CTF_redspawn"
}
// entity 4
{
"target" "t1"
"classname" "_decal"
// brush 0
{
patchDef2
{
shaderman/decal_test
( 3 3 0 0 0 )
(
( ( -64 256 64 -0.500000 -2 ) ( -64 320 64 -0.500000 -2.500000 ) ( -64 384 64 -0.500000 -3 ) )
( ( 0 256 64 0 -2 ) ( 0 320 64 0 -2.500000 ) ( 0 384 64 0 -3 ) )
( ( 64 256 64 0.500000 -2 ) ( 64 320 64 0.500000 -2.500000 ) ( 64 384 64 0.500000 -3 ) )
)
}
}
}
// entity 5
{
"targetname" "t1"
"origin" "-32 320 16"
"classname" "info_null"
}

Now you should see how it works :slight_smile:

Shaderman


(=PoW= Kernel 2.6.5) #14

Thanks Shaderman - once again you have come to the rescue.

I was soooooo close on the decals and your example set me straight.
My patch mesh was inverted. Everytime I create one the face that gets textured is always facing in the wrong direction.
I rotated it and now it works. The decal I used has some nice blending with the texture it’s projected on. WOW, nice feature.

As for the CSG subtract - OUCH.
Now I wish that tool wasn’t in Radiant so I would never have used it.

Decision time. Go back and fix all the holes I cut or just let it go?
This first map is relatively small and broken up by structural brushes.

I don’t fully understand vis blocking and how to get better performance from a map by reducing tri’s.
I read the postings and articles but don’t fully comprehend it yet.

This map that I’m working on is my first attempt at this but I’m trying to keep it from being a complete disaster.

I appreciate all the help I’ve received on these forums.


(Shaderman) #15

You could either search this forum and ask your questions in existing topics or start a new topic regarding your map for all your questions :slight_smile:


(kamikazee) #16

About CSG substract: just look at how the tool has split brushes. If it’s not that optimal, use the clipper tool and use CSG merge to glue seperate brushes together so they form a nicer pattern.
CSGSubstract has another problem: it can leave “splinters” around. Those are tiny brushes you can’t see, but it’s said they’re gone if you do a brush cleanup. (See the Bobtools toolbar)


(EB) #17

Just a reference towards the “decals” for future mappers…
dONKEY (a Quake mapper) put together a nice tutorial style thread: http://www.map-craft.com/modules.php?name=Forums&file=viewtopic&t=293


(sodsm live) #18

this is a very informative thread. i’ve been doing some testing with decals and now i’m trying to figure out which form of decals would be best for me. since using the entity form of decals will add to entity count i gave the old form a try. i don’t know if it’s because i’m using transparency with my decal or what but i’m getting zfighting with bullet marks on the decal. i guess it’s actually the bullet marks on the brush beneath the decal causing the zfighting with the decal since they are really both decals on the same plane?

any way to get around this without losing bullet/blast marks functionality?


(EB) #19

Add “sort 6” into the shader syntax for the decal.
(You may also try 9 or 16) [refer to shader manual]

EXAMPLE:
textures/blah/blah2
{
qer_editorimage textures/blah/blah2222.tga
surfaceparm trans
sort 6
{
map …etc. etc.

The Shader Manual is inside of your Radiant install or available here:
http://members.lycos.co.uk/quakeroats/q3map2/shader_manual/


(sodsm live) #20

thanks EB, 6 did it(16 [and possibly 9, can’t remember off hand]put it under the gun but in front of muzzle flash, looked kooky)

blast marks looked funny on the alpha mask at the edges of the decal but that was taken care of when i found the nomarks parm.

thanks again