News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

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.

bitterman

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

Thanks.

eXistence

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

common/caulk is not special, it is just defined in such a way (see invisible.mtr), 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.

nbohr1more

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

Material.cpp

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


Dmap:

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

      if ( !s->material ) {
         continue;
      }

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

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

   if ( contents & CONTENTS_AREAPORTAL ) {
      c_areaportals++;
   }

   b->contents = contents;
}

bitterman

#3
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.

invisible.mtr

// 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.
textures/common/caulk
{
qer_editorimage textures/common/caulk.tga
noshadows
forceOpaque // will still seal levels
}
...
// nodraw is used for surfaces that don't have any automatic
// interaction with anything
textures/common/nodraw
{
qer_editorimage textures/common/nodraw.tga
nonsolid
noshadows
}


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

/*
=================
idMaterial::ParseMaterial

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

motorsep

@bitterman

What are you trying to accomplish?

bitterman

#5
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).

bitterman

Agree.

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.

motorsep

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.

Also: http://www.3dbuzz.com/training/view/doom-3-modding

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

bkt

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

bkt

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.

BielBdeLuna

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)