Author Topic: How to engine works with common textures?  (Read 580 times)

0 Members and 1 Guest are viewing this topic.

bitterman

  • Sr. Member
  • ****
  • Posts: 250
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
How to engine works with common textures?
« on: August 29, 2016, 06:27:13 AM »
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

  • Newbie
  • *
  • Posts: 22
  • Karma: +10/-0
  • Doom Newbie
    • View Profile
Re: How to engine works with common textures?
« Reply #1 on: August 29, 2016, 09:20:38 AM »
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

  • Jr. Member
  • **
  • Posts: 96
  • Karma: +13/-8
  • Doom Newbie
    • View Profile
Re: How to engine works with common textures?
« Reply #2 on: August 29, 2016, 03:20:32 PM »
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

  • Sr. Member
  • ****
  • Posts: 250
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Re: How to engine works with common textures?
« Reply #3 on: August 30, 2016, 01:25:03 AM »
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

Code: [Select]
// 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):

Code: [Select]
/*
=================
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 ) {
« Last Edit: August 30, 2016, 01:34:59 AM by bitterman »

motorsep

  • Hero Member
  • *****
  • Posts: 960
  • Karma: +74/-127
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: How to engine works with common textures?
« Reply #4 on: August 30, 2016, 09:50:08 AM »
@bitterman

What are you trying to accomplish?

bitterman

  • Sr. Member
  • ****
  • Posts: 250
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Re: How to engine works with common textures?
« Reply #5 on: August 30, 2016, 11:34:47 AM »
Just dig some arena tuts and tried to compile.
Material's part was reworked.
« Last Edit: August 30, 2016, 11:36:26 AM by bitterman »

The Happy Friar

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 852
  • Karma: +41/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: How to engine works with common textures?
« Reply #6 on: August 30, 2016, 04:51:52 PM »
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

  • Sr. Member
  • ****
  • Posts: 250
  • Karma: +8/-5
  • Doom Newbie
    • View Profile
Re: How to engine works with common textures?
« Reply #7 on: August 30, 2016, 09:47:57 PM »
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

  • Hero Member
  • *****
  • Posts: 960
  • Karma: +74/-127
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: How to engine works with common textures?
« Reply #8 on: August 30, 2016, 09:52:14 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

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 852
  • Karma: +41/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: How to engine works with common textures?
« Reply #9 on: August 31, 2016, 07:03:45 AM »
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

  • Jr. Member
  • **
  • Posts: 96
  • Karma: +12/-2
  • Doom Newbie
    • View Profile
Re: How to engine works with common textures?
« Reply #10 on: August 31, 2016, 01:43:02 PM »
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

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 852
  • Karma: +41/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: How to engine works with common textures?
« Reply #11 on: August 31, 2016, 02:52:33 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

  • Jr. Member
  • **
  • Posts: 96
  • Karma: +12/-2
  • Doom Newbie
    • View Profile
Re: How to engine works with common textures?
« Reply #12 on: September 01, 2016, 10:15:00 AM »
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

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 852
  • Karma: +41/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: How to engine works with common textures?
« Reply #13 on: September 02, 2016, 07:23:53 AM »
Could be some of them don't show decals but others do, another difference between nodraw vs collision materials.

BielBdeLuna

  • Full Member
  • ***
  • Posts: 242
  • Karma: +8/-20
  • Doom Newbie
    • View Profile
    • my Github repositories
Re: How to engine works with common textures?
« Reply #14 on: September 02, 2016, 06:55:01 PM »
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)