mirror shader is too transparent with vertexlight

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
energizer_wd
Posts: 2
Joined: Sat Nov 25, 2006 12:04 am

mirror shader is too transparent with vertexlight

Post by energizer_wd »

Hi. Been a while since i played with radiant, but i have some free time and have been doodling. Here is a shader I modified using default textures.

textures/test2/sq_portal_sfx
{
surfaceparm nolightmap
portal

{
map textures/common/mirror1.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
depthWrite
}

{
map textures/sfx/mirror.tga
blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
depthfunc lequal
alphagen portal 1024
}

}

It works fine so long as r_vertexlight is set to 0. If set to 1, you can no longer tell there is a mirror there except from what you see in it. Any way of making this blendFunc show up regardless of the lighting method? Thanks in advance
Shallow
Posts: 167
Joined: Wed Feb 09, 2005 1:58 pm

Post by Shallow »

Are you sure it's just r_vertexlight you're turning off? If its a config you're switching to, r_fastsky may be on as well, and that disables the rendering of not just skies but all portal based effects.

EDIT: Oh hang on, just read it again, ignore the above although it is worth bearing in mind.

Actual problem: r_vertexlight simplifies most shaders to a single pass. Typically it uses their first non-lightmapped texture stage with rgbgenvertex applied. You can stop it messing with this shader by making an exact copy of it called something like textures/test2/sq_portal_sfx_vertex, and then adding

key: vertexremapshader1
value: textures/test2/sq_portal_sfx;textures/test2/sq_portal_sfx_vertex

into the worldspawn. This is useful for shaders where the first texture stage in't very representative of the overall texture.

If you need to remap more shaders call subequent keys vertexremapshader2, 3 etc.
energizer_wd
Posts: 2
Joined: Sat Nov 25, 2006 12:04 am

Post by energizer_wd »

Hey, thanks for the reply. I never saw anything about those commands before. It does allow me to use a different shader for vertex and non vertex light which is cool and useful, but the problem is if I use an exact copy, it still gets simplified to a single pass by vertexlight and displays the same thing. No biggie tho, im just putting a border around the mirror and callin it good for now. :) I tried putting a glass shader in front of it, but it just blocked the portal effect.
Post Reply