[Apple] Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.



 
HomeLatest imagesSearchRegisterLog in

 

 How Shaders work...

Go down 
AuthorMessage
KAS
Admin
KAS


Posts : 505
Join date : 2011-08-20
Location : Germany/Bosnia

How Shaders work... Empty
PostSubject: How Shaders work...   How Shaders work... EmptyTue Jan 31, 2012 2:27 pm

Shaders are living in your SCRIPTS Folder.
You just need one Shader for your Map with all Informations in it…
For Example i post the Shader of my Deathrun Map.
If you want to put some Informations in your Shader….you have to put 2 // before it!!!
Same if you want to disable a line…like this….
Code:
textures/Deathrun_kas/13:q3map
{
     surfaceparm slick
//   surfaceparm nodamage
}
Now just the slick line is working…nodamage is disabled!!!

Here my Deathrun Map Shader:
Code:

////////////////////////////////////////
///Slick/Walls///
////////////////////////////////////////

textures/Deathrun_kas/13:q3map
{
   surfaceparm slick
}

textures/Deathrun_kas/21_s:q3map
{
   surfaceparm slick
}

textures/Deathrun_kas/22_s:q3map
{
   surfaceparm slick
}

textures/Deathrun_kas_lights/34_s:q3map
{
   surfaceparm slick
}

////////////////////////////////////////
///camera///
////////////////////////////////////////

textures/Deathrun_kas_extras/camera
{
   qer_editorimage textures/Deathrun_kas_extras/camera.tga
   surfaceparm playerclip
   surfaceparm nolightmap
   portal
   {
      tcMod turb 0 0.25 0 0.05
      map textures/Deathrun_kas_extras/camera.tga
       blendFunc GL_ONE GL_ONE_MINUS_SRC_ALPHA
      depthWrite
      alphaGen portal 2048
    }
}


///////////////////////////////////////
///LAVA///
///////////////////////////////////////

textures/Deathrun_kas_extras/lava
{
    qer_editorimage textures/Deathrun_kas_extras/lava/protolava.tga
    qer_nocarve
    q3map_globaltexture
    surfaceparm trans
    surfaceparm noimpact
    surfaceparm lava
    surfaceparm nolightmap
    q3map_surfacelight 300
    q3map_tesssize 96
    cull disable
    {
        map textures/Deathrun_kas_extras/lava/protolava.tga
        tcmod scale 0.10 0.10
        tcmod scroll 0.04 0.03
        tcMod turb 0 0.02 0 0.01
        blendFunc gl_one gl_zero
        rgbGen identity
    }
    {
        map textures/Deathrun_kas_extras/lava/lavahell.jpg
        blendfunc blend
        tcMod turb 0 0.15 0 0.1
    }
}

textures/Deathrun_kas_extras/lavacaulk
{
    qer_editorimage textures/Deathrun_kas_extras/lavacaulk.jpg
    qer_trans 0.5
    qer_nocarve
    surfaceparm trans
    surfaceparm noimpact
    surfaceparm lava
    surfaceparm nodraw
    surfaceparm nolightmap
}


///////////////////////////////////////
///GLASS///
///////////////////////////////////////

textures/Deathrun_kas_extras/glass
{
   qer_editorimage textures/Deathrun_kas_extras/glass.tga
   qer_trans .5
   surfaceparm trans
   surfaceparm glass
   cull disable
   {
      map textures/Deathrun_kas_extras/tinfxkas.tga
      tcgen environment
      blendFunc gl_one gl_one
      rgbGen identity
   }
   {
      map $lightmap
      blendFunc gl_zero gl_one
      rgbGen identity
   }
}

textures/Deathrun_kas_extras/glass1
{
   qer_editorimage textures/Deathrun_kas_extras/glass1.tga
   qer_trans .5
   surfaceparm trans
   surfaceparm glass
   cull disable
   {
      map textures/Deathrun_kas_extras/tinfxkas.tga
      tcgen environment
      blendFunc gl_one gl_one
      rgbGen identity
   }
   {
      map $lightmap
      rgbGen identity
      blendFunc filter
   }
}

///////////////////////////////////////
///ROT/GRUEN///
///////////////////////////////////////

textures/Deathrun_kas_extras/rot
{
   qer_editorimage textures/Deathrun_kas_extras/rot/8.tga
   q3map_surfacelight 500
   q3map_tesssize 96
   surfaceparm nomarks
   surfaceparm nodamage
      {
      map $lightmap
      rgbGen identity
      }
      {
      map textures/Deathrun_kas_extras/rot/8.tga
      blendFunc GL_DST_COLOR GL_ZERO
      rgbGen identity
      }
      {
      map textures/Deathrun_kas_extras/rot/rot2.tga
      blendfunc GL_ONE GL_ONE
//      rgbGen wave square 0.5 0.5 0 1.1
      }
}

textures/Deathrun_kas_extras/gruen
{
   qer_editorimage textures/Deathrun_kas_extras/gruen/8.tga
   q3map_surfacelight 500
   surfaceparm nomarks
   surfaceparm nodamage
      {
      map $lightmap
      rgbGen identity
      }
      {
      map textures/Deathrun_kas_extras/gruen/8.tga
      blendFunc GL_DST_COLOR GL_ZERO
      rgbGen identity
      }
      {
      map textures/Deathrun_kas_extras/gruen/gruen2.tga
      blendfunc GL_ONE GL_ONE
      }
}


///////////////////////////////////////
///PARTICLES///
///////////////////////////////////////

textures/Deathrun_kas_extras/lavaparticles1
   {
   qer_editorimage textures/Deathrun_kas_extras/p1.jpg
   surfaceparm trans   
   surfaceparm nomarks
   surfaceparm nonsolid
   surfaceparm nodamage
   surfaceparm nolightmap
   nopicmip   
   qer_trans .5
   cull none
   deformVertexes bulge 128 1 2   
   {
      map textures/Deathrun_kas_extras/p1.jpg
      blendFunc GL_SRC_ALPHA GL_ONE
      rgbGen vertex
      tcMod Scroll 0 .04
   }
}
textures/Deathrun_kas_extras/lavaparticles2
   {
   qer_editorimage textures/Deathrun_kas_extras/p2.jpg
   surfaceparm trans   
   surfaceparm nomarks
   surfaceparm nodamage
   surfaceparm nonsolid
   surfaceparm nolightmap
   nopicmip   
   qer_trans .5
   cull none
   deformVertexes bulge 128 1 2   
   {
      map textures/Deathrun_kas_extras/p2.jpg
      blendFunc GL_SRC_ALPHA GL_ONE
      rgbGen vertex
      tcMod Scroll -0.03 .05
   }
}
textures/Deathrun_kas_extras/lavaparticles3
   {
   qer_editorimage textures/Deathrun_kas_extras/p3.jpg
   surfaceparm trans   
   surfaceparm nodamage
   surfaceparm nomarks
   surfaceparm nonsolid
   surfaceparm nolightmap
   nopicmip   
   qer_trans .5
   cull none
   deformVertexes bulge 128 1 2   
   {
      map textures/Deathrun_kas_extras/p3.jpg
      blendFunc GL_SRC_ALPHA GL_ONE
      rgbGen vertex
      tcMod Scroll 0 0.3
   }
}

///////////////////////////////////////
///LADDER///
///////////////////////////////////////

textures/Deathrun_kas_extras/ladderclip
{
   qer_editorimage textures/Deathrun_kas_extras/ladderclip.tga
        qer_trans 0.40
   surfaceparm nolightmap
   surfaceparm nomarks
   surfaceparm nodraw
   surfaceparm nonsolid
   surfaceparm playerclip
   surfaceparm noimpact
   surfaceparm ladder
   surfaceparm trans
}

///////////////////////////////////////
///LIGHTS///
///////////////////////////////////////

textures/Deathrun_kas_lights/spot
{
   qer_editorimage textures/Deathrun_kas_lights/l1.tga
   q3map_surfacelight 8000
   {
      map $lightmap
      rgbGen identity
   }
   {
      map textures/Deathrun_kas_lights/l1.tga
      blendFunc GL_DST_COLOR GL_ZERO
      //blendFunc blend
      rgbGen identity
   }
   {
      map textures/Deathrun_kas_lights/l1_b.tga
      blendfunc GL_ONE GL_ONE
   }
}

textures/Deathrun_kas_lights/deckenleuchte
{
   qer_editorimage textures/Deathrun_kas_lights/l2.tga
   q3map_surfacelight 8500
   {
      map $lightmap
      rgbGen identity
   }
   {
      map textures/Deathrun_kas_lights/l2.tga
      blendFunc GL_DST_COLOR GL_ZERO
      //blendFunc blend
      rgbGen identity
   }
   {
      map textures/Deathrun_kas_lights/l2_b.tga
      blendfunc GL_ONE GL_ONE
   }
}

textures/Deathrun_kas_lights/deckenleuchteklein
{
   qer_editorimage textures/Deathrun_kas_lights/l3.tga
   q3map_surfacelight 4000
   {
      map $lightmap
      rgbGen identity
   }
   {
      map textures/Deathrun_kas_lights/l3.tga
      blendFunc GL_DST_COLOR GL_ZERO
      //blendFunc blend
      rgbGen identity
   }
   {
      map textures/Deathrun_kas_lights/l3_b.tga
      blendfunc GL_ONE GL_ONE
   }
}

textures/Deathrun_kas_lights/anch
{
   qer_editorimage textures/Deathrun_kas_lights/l4.tga
   q3map_surfacelight 2500
   {
      map $lightmap
      rgbGen identity
   }
   {
      map textures/Deathrun_kas_lights/l4.tga
      blendFunc GL_DST_COLOR GL_ZERO
      //blendFunc blend
      rgbGen identity
   }
   {
      map textures/Deathrun_kas_lights/l4_b.tga
      blendfunc GL_ONE GL_ONE
   }
}

textures/Deathrun_kas_lights/kas
{
   qer_editorimage textures/Deathrun_kas_lights/l5.tga
   q3map_surfacelight 1000
   {
      map $lightmap
      rgbGen identity
   }
   {
      map textures/Deathrun_kas_lights/l5.tga
      blendFunc GL_DST_COLOR GL_ZERO
      //blendFunc blend
      rgbGen identity
   }
   {
      map textures/Deathrun_kas_lights/l5_b.tga
      blendfunc GL_ONE GL_ONE
   }
}

textures/Deathrun_kas_lights/skarabaeus
{
   qer_editorimage textures/Deathrun_kas_lights/l6.tga
   q3map_surfacelight 2500
   {
      map $lightmap
      rgbGen identity
   }
   {
      map textures/Deathrun_kas_lights/l6.tga
      blendFunc GL_DST_COLOR GL_ZERO
      //blendFunc blend
      rgbGen identity
   }
   {
      map textures/Deathrun_kas_lights/l6_b.tga
      blendfunc GL_ONE GL_ONE
   }
}

textures/Deathrun_kas_lights/deckenleuchtebreit
{
   qer_editorimage textures/Deathrun_kas_lights/l7.tga
   q3map_surfacelight 3000
   {
      map $lightmap
      rgbGen identity
   }
   {
      map textures/Deathrun_kas_lights/l7.tga
      blendFunc GL_DST_COLOR GL_ZERO
      //blendFunc blend
      rgbGen identity
   }
   {
      map textures/Deathrun_kas_lights/l7_b.tga
      blendfunc GL_ONE GL_ONE
   }
}

textures/Deathrun_kas_lights/lichtrot
{
    deformVertexes autoSprite
    surfaceparm trans
    surfaceparm nomarks
    surfaceparm nonsolid
    surfaceparm noimpact
    surfaceparm nolightmap
    cull none
          {
            map textures/Deathrun_kas_lights/lichtrot.jpg
            blendFunc GL_ONE GL_ONE
          }
}

If you making a new Shader its IMPORTANT to edit your Shaderlist.txt file.
So if your Shader calls test.shader… you write test in your Shaderlist…

EXAMPLE: there are 3 shaders active…test, ladder and water!!!
Code:
//********************
//*****Shaderlist*****
//********************

test
ladder
water
Back to top Go down
http://apple-urt.tk
 
How Shaders work...
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
[Apple] Forum :: Urban Terror Mapping :: All about Mapping "GTK/NET Radiant"-
Jump to: