Shader not working -1 reply

  • 1
  • 2

Please wait...

NAB622

EAT ME!

50 XP

8th October 2005

0 Uploads

6,921 Posts

0 Threads

#11 9 years ago

textures/viper/grate { qer_editorimage textures/viper/fgrate cull twosided { map textures/viper/grate alphaFunc GE128 blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA depthWrite rgbGen identity } { map $lightmap alphaFunc GE128 blendFunc GL_DST_COLOR GL_SRC_COLOR } } There are visual problems with the shader.

First off, you're applying two different alpha blends to a single texture. This is going to royally mess it up during rendering. All you need on the grate itself is the AlphaFunc, and inside the texture, you'll just need an appropriate alpha mask.

Now, like I said before, the lightmap has the alphaFunc applied to it as well. Lightmaps do not have any alpha data in them - this should generate an error. I'm surprised if it isn't.

What I would suggest is modifying the shader like so...

textures/viper/grate { qer_editorimage textures/viper/fgrate cull twosided { map textures/viper/grate alphaFunc GE128 depthWrite } { map $lightmap depthFunc equal blendFunc GL_DST_COLOR GL_SRC_COLOR } }

That should take care of both errors and fix the lightmap.

Now, you MAY have to fiddle with that depthFunc...I'm not sure if "equal" is the correct parameter for a lightmap on an alpha'd texture (The other values are "lequal" and "none"), but it doesn't hurt to try. :)




  • 1
  • 2