Inside3D!
     

Shader help (Darkplaces)

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> General Programming
View previous topic :: View next topic  
Author Message
jim



Joined: 05 Aug 2005
Posts: 400
Location: In The Sun

PostPosted: Thu Oct 16, 2008 8:56 pm    Post subject: Shader help (Darkplaces) Reply with quote

I need some help. I want to make a shader for windows in a texture. I want the window part in the texture to reflect stuff. Everything I've done so far, has not worked.

I've not even been able to get a texture overlay another. Like this here:

Code:

textures/test/window_basic_one_00
{
   {
      map textures/test/window_basic_one_00.png
      rgbGen identity
   }
   {
      map $lightmap
      blendfunc filter
      tcGen lightmap
   }
   {
      map textures/liquid/blood.png
      blendfunc add
   }
}


The blood texture is not displayed at all (not that I really want additive blood on walls, but it just don't work!). Is Darkplaces shader support limited to only allow one texture in a shader?
_________________
zbang!
Back to top
View user's profile Send private message Visit poster's website
VorteX



Joined: 14 Jan 2005
Posts: 12

PostPosted: Fri Oct 31, 2008 6:01 am    Post subject: Reply with quote

Currently darkplaces do not allow more than 2 stages for shader, one of stages is lightmap.

But there is a semi-hacky way to do layers, it works just fine. Use q3map_cloneShader <shadername> - this is compiler directive that lets q3map2 to place cloned surface infront of current with different shader (doubling total triangles count of a surface).

Code:

textures/test/window_basic_one_00-additive
{
    surfaceparm trans
    surfaceparm nolightmap
    surfaceparm nonsolid
    surfaceparm trans
    surfaceparm nomarks
    surfaceparm noimpact

    {
       map textures/liquid/blood.png
       blendfunc add
    }
}

textures/test/window_basic_one_00
{
   q3map_cloneShader  textures/test/window_basic_one_00-additive
   {
      map textures/test/window_basic_one_00.png
      rgbGen identity
   }
   {
      map $lightmap
      blendfunc filter
   }
}


Since this is compiler feature, you can see additional layers only when you recompile your map with q3map2.
Back to top
View user's profile Send private message
jim



Joined: 05 Aug 2005
Posts: 400
Location: In The Sun

PostPosted: Sat Nov 01, 2008 12:56 am    Post subject: Reply with quote

Haa, great, thanks for this! I hope the triangle count doubling don't have too much performance hit though...
_________________
zbang!
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> General Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group