BuddhaMaster@Posted: Tue Nov 20, 2007 2:21 am :
Hey hey,

I have changed the Imp's material code.

Why is the additional Overlay Texture at the end keep making the whole model black ? I know there is many question about "black textures" but my question is specific.
Please take a look at the last blend add

Code:
models/monsters/imp/imp
{
   unsmoothedTangents
   //noselfshadow
   flesh
   renderbump  -size 512 512 -aa 3 models/monsters/imp/imp_local.tga models/monsters/imp/work/imp_hp.lwo

   {   // burning corpse effect
      if   parm7         // only when dead
      
      // make a burned away alpha test for the normal skin
      blend   gl_zero, gl_one         // don't draw anything
      
      map models/monsters/imp/imp_dis.tga   // replace this with a monster-specific texture
      alphaTest 0.05 + 0.3 * (time - parm7)
   }
   {   // burning corpse effect
      if parm7         // only when dead

      // draw the fire burn at a negative polygonOffset, so it is behind the other stages
      privatePolygonOffset   -1      // stage-only polygon offset
        blend add   
        blend gl_one, gl_zero
      
      map models/monsters/imp/imp_dis.tga   // replace this with a monster-specific texture
      alphaTest 0.3 * (time - parm7)
   }
   forceOverlays   
   bumpmap   addnormals (models/monsters/imp/imp_local, heightmap (models/monsters/imp/imp_bmp.tga, 6) )
   diffusemap models/monsters/imp/imp_d

   //using specular map for glowing eyes
   {
         blend   add
         map    models/monsters/imp/imp_s
   }
   
   //added additional unlit layer
   {
      noshadows
      {
         blend  add
         map    models/monsters/imp/imp_glow
      }
   }


//   specularmap   models/monsters/imp/imp_s
}   



As soon as i add noshadows, noSelfShadows or any other interesting "feature" - the texture just comes black
= The only working way is to only blend add the texture = works
But i want to make it unlit ! (glowing in darkness).
Every material i see that uses glow, use NoShadows flag. Why is THIS Material just getting black everytime i try this ??

Now here comes the interesting part:
My biggest question leads to how the material works. Isn't that intended to overlay as many textures as you want and use the flags you want and put everything inside { }



LDAsh@Posted: Tue Nov 20, 2007 6:46 am :
Because "noshadows" is a keyword, it needs to be and can only be in the first partition of the script along with other keywords for the entire shader, and not for specific stages, the way you have it there. Cut and paste to the 4th line near "//noselfshadow".



BuddhaMaster@Posted: Tue Nov 20, 2007 2:37 pm :
Thanks for looking inside here.
I understand you say its a keyword, that answers me some stuff.
But i want only this particular layer to be "unlit". How could i do that ?

The texture that needs overlayed must be "added" so black parts are not visible, bright parts visible (As "screen/lighten" in every graphic-program does) on top of a standard model

I read "blend add" makes a texture already "unlit". That would worry my understanding. Because alot materials use it + NoShadow flag..



LDAsh@Posted: Tue Nov 20, 2007 4:43 pm :
Well "blend add" will do that already and you don't need "noshadows".
If you're getting a black model, maybe your material syntax is incorrect. Try "unnesting" (if that's the right term) the last stage, so it looks like this:-
Code:
...
  //added additional unlit layer
   {
         blend  add
         map    models/monsters/imp/imp_glow
   }

//   specularmap   models/monsters/imp/imp_s
}   



Springheel@Posted: Sun Nov 25, 2007 11:06 pm :
"Noshadows" has nothing to do with a texture appearing 'unlit', at least directly. It just means that any brush/model covered with that texture won't cast shadows.