One Minute Game Review by The Happy Friar:
Also on Rumble:

idTech 4 (aka Doom 3 tech) Discord Server!

Main Menu

How to engine works with common textures?

Started by bitterman, August 29, 2016, 06:27:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


I mean 'common/caulk', 'common/nodraw' etc.

I found where this textures are placed ('\textures\common') but I can't find out which part of Code works with them (can't find keywords 'caulk', 'nodraw' in Code).

How to engine works with common textures (interaction aspect)?



the engine usually treats them just like other textures/materials.

common/caulk is not special, it is just defined in such a way (see, that the dmap compiler does not generate visible geometry for it (so the renderer does not know about it).
But it still seals the levels and generates collision geometry.

common/nodraw is similar, just look at its definition.


Clip textures get converted to surface flags for path \ area determination in dmap.
They usually have the forceOpaque keyword.


else if ( !token.Icmp( "forceOpaque" ) ) {
         coverage = MC_OPAQUE;


for ( i=1 ; i<b->numsides ; i++, s++ ) {
      s = &b->sides;

      if ( !s->material ) {

      c2 = s->material->GetContentFlags();
      if (c2 != contents) {
         mixed = true;
         contents |= c2;

      if ( s->material->Coverage() != MC_OPAQUE ) {
         b->opaque = false;

   if ( contents & CONTENTS_AREAPORTAL ) {

   b->contents = contents;


Yes, now I see. They are not internal variables but just definitions in .mtr (like a set of predefined internal flags wich in turn will handled by the engine).
I think I can define 'textures/specials/my_own_very_cool_caulk' with same flags and use it just like as native 'textures/common/caulk'.

Thanks, guys.

// a caulk brush will behave as a normal solid surface
// for collision detection and utility flood filling, and
// should be used whenever you know the area isn't going to
// be visible, but it needs to be closed off for things to
// work right.  Curves and models don't stop the utility
// flood filling, so you need to have solid brushes behind
// them.  Setting the faces that won't ever be seen to
// caulk will save some rendering time and data space.
qer_editorimage textures/common/caulk.tga
forceOpaque // will still seal levels
// nodraw is used for surfaces that don't have any automatic
// interaction with anything
qer_editorimage textures/common/nodraw.tga

This procedure contains a full list of flags (as I think):


The current text pointer is at the explicit text definition of the
Parse it into the global material variable. Later functions will optimize it.

If there is any error during parsing, defaultShader will be set.
void idMaterial::ParseMaterial( idLexer &src ) {



What are you trying to accomplish?


Just dig some arena tuts and tried to compile.
Material's part was reworked.

The Happy Friar

I don't think caulk is used the same way as it was in the Q3A engine games in D3.  It does just what that description says for D3 vs in Quake engine games you'd want it on everything you wouldn't see (like the outside of brushes facing the void).



Moreover, Q3A has some common textures wich I can't find in D3
E.g. 'textures/common/origin' wich used as rotation's point for other brush/entity.

But arena's tutorials are very informative and it would be usefull to reviewed them for D3/D3BFG modding purposes IMO.


Quote from: bitterman on August 30, 2016, 09:47:57 PM
But arena's tutorials are very informative and it would be usefull to reviewed them for D3/D3BFG modding purposes IMO.

You can open any Doom 3 map and see how they did it. It's not a tutorial, but quite useful. Something you couldn't do with Q3A.


I wish they uploaded those vids to YouTube. Those the the only training videos about Doom 3 mapping :/

The Happy Friar

I agree, would be nice to have those on youtube.  I just checked & you can look at the source code for the pages & find the .mp4 links to the tutorials.  So, they could be downloaded & saved.

The Only downside of opening up the D3 maps is they've got a lot of stuff in them to wade through to figure things out.  But as for the "how to map", reading Q1 tut's will get the basics down.  Anything new in D3 either how to light stuff vs the old way or replacing old ways with new (like typing in origin's vs using a brush, scripting instead, etc).


I can't remember exactly what the actual differences were between nodraw and caulk.  However caulk is generally used as a non-rendered seal for the map.  eg. place it behind patches/meshes to create a sealed room, but the engine won't process any rendering for the caulk surfaces. 

As for nodraw, all I remember is that I used it a lot for any invisible collision on meshes.  If memory serves, it doesn't generate AAS.

So, how about you put together a testmap to work it out if you're not sure.  See what their collision/draw/culling values are like.

The Happy Friar

Quote from: bkt on August 31, 2016, 01:43:02 PM
As for nodraw, all I remember is that I used it a lot for any invisible collision on meshes.  If memory serves, it doesn't generate AAS.

That's what the material says.  In the Quake tech days I'd use it for one way walls.  :)  Kinda frowned upon once players considered neat traps "cheap".  :D


I'm trying to remember what scenarios I used it in other than for model collision... because there was a collision material for models too...

I don't have the False Dawn source files handy to check against.  Though caulk is still the most valuable of the common materials.  The majority of that project was bright pink in the editor.

The Happy Friar

Could be some of them don't show decals but others do, another difference between nodraw vs collision materials.


caulk textures when sealing the level from the void from within the level show a black image, they are perfect for sealing the levels behind models because they don't create any new poly

in RBdoom3BFG caulk though doesn't seal the level from the sun, it's invisible from the sun, so caulk doesn't generate shadow when using shadow maps (for stencil polys the engine works like doom3, and so caulk is visible to sun, therefore creates shadows)