Page 1 of 2

Shader Help

Posted: Sat Oct 29, 2011 8:31 pm
by xandaxs
Hello guys!

I'm giving some final touchs to a fun CAH map made by Swi!t.
I'm facing a problem and so i need your help.

I've a decal on the wall (gold symbol) and so, I added surfacelight 25 t it, and now i want it to reflect light, or at least give that effect.

I've this shader for the decal:

Code: Select all

textures/aztek/aztec
{
qer_editorimage textures/aztek/aztec.tga
polygonOffset
nomipmaps
nopicmip
surfaceparm trans
q3map_surfacelight 25
{
map textures/aztek/aztec.tga
blendfunc filter
}
}


And this one for the reflection:

Code: Select all

textures/aztek/chrome
{
        surfaceparm detail
        surfaceparm nodamage
        surfaceparm nomarks
        qer_editorimage textures/aztek/aztec.tga
        {
            map textures/aztek/chrome_tint.tga
            tcGen environment
        }
        {
            map textures/aztek/aztec.tga
            blendFunc GL_ONE GL_ONE
            tcMod scale 8 8
            rgbGen identity
        }
        {
            map $lightmap
            rgbgen identity
            blendFunc GL_DST_COLOR GL_ZERO
        }
}


I want t put the 2 of them together, so it works on the "aztec" texture - the decal.
How do i put them in 1 shader?

Re: Shader Help

Posted: Sat Oct 29, 2011 8:41 pm
by Delirium
want to upload the image so I can see what your trying to blend?

Re: Shader Help

Posted: Sat Oct 29, 2011 8:49 pm
by xandaxs
aztec.jpg
aztec.jpg (103.82 KiB) Viewed 12723 times

Re: Shader Help

Posted: Sat Oct 29, 2011 9:14 pm
by xandaxs
i can save it as .tga and it'll have ;)

Re: Shader Help

Posted: Sat Oct 29, 2011 9:17 pm
by Delirium
Actually I can't remember how its done with tcgen environment, cause I recall trying to do a similar thing in facade.
I actually cheated here though

Code: Select all

textures/aadel_facade/metal_1_red
{
   qer_editorimage textures/aadel_facade/metal_1_red.tga
   q3map_forcemeta
   q3map_clipmodel
   q3map_vertexScale 1.2

   surfaceparm trans
   nopicmip
   //cull none

   {
      map textures/aadel_facade/metal_1_red.tga
      rgbgen vertex
   }
   {
      map textures/aadel_facade/tinfx.tga
      tcgen environment
      blendFunc GL_ONE GL_ONE
      rgbgen vertex
   }
   {
      map textures/aadel_facade/metal_1_red.tga
         blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
      rgbgen vertex
   }
   //{
   //   map $lightmap
   //   blendfunc filter
   //}
}


Just make a nice specular texture for bumpy

Re: Shader Help

Posted: Sat Oct 29, 2011 9:18 pm
by Delirium
^ note that texture wasn't alpha blended like yours is... that texture was like a metal texture

Re: Shader Help

Posted: Sat Oct 29, 2011 9:21 pm
by xandaxs
can't yu please just edit mine? :O
I can't get a **** of your shader :/

Re: Shader Help

Posted: Sat Oct 29, 2011 9:28 pm
by Delirium
Delirium wrote:Actually I can't remember how its done with tcgen environment


Delirium wrote:Just make a nice specular texture for bumpy

Re: Shader Help

Posted: Sat Oct 29, 2011 9:38 pm
by xandaxs
Okay :(
I'll try it without the reflection to see if it looks okay.

Re: Shader Help

Posted: Sat Oct 29, 2011 9:47 pm
by Delirium

Code: Select all

textures/aztek/aztec_blend_shit_lololol
{
   qer_editorimage textures/aztek/aztec.tga
   polygonOffset
   //nomipmaps //dont use this on decals, it causes bad aliasing
   nopicmip
   surfaceparm trans
   surfaceparm nomarks
   surfaceparm nonsolid
   q3map_surfacelight 25 //Why are you using this?
   {
      map textures/aztek/aztec.tga
      blendfunc filter
   }
   {
      map textures/aztek/aztec.tga
      blendfunc filter
      tcGen environment
   }
}


Try that I guess, but IDK I think it will cause problems... you'd be better off trying a specular texture with bumpy