Jump to content

"Stained Glass" Shader


Go to solution Solved by MoonDog,

Recommended Posts

Seems I've tried a dozen different variations to try and make a colored .tga design look like a stained glass window.

 

I've tried mapping in a Tcgen environment, mapping in a reflective glass. 

 

Even tried making the colored texture transparent and putting a pane of base glass behind it.

 

The best I've come up with is a surface light shader but then it just looks like a glowing wall rather than a window with light coming from behind it. Any ideas?

 

 

 

Best iteration so far:

 

 

 

textures/the_enclave/stglass
{
q3map_material Glass
surfaceparm nonopaque
surfaceparm trans
surfaceparm alphashadow
cull twosided
qer_trans 1.0
    {
        map textures/the_enclave/stglass
        alphaFunc GE128
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        depthWrite
    }
    { 
        map $lightmap 
        rgbGen identity 
        blendFunc GL_DST_COLOR GL_ZERO 
        depthFunc equal 
    }
    {
        map textures/the_enclave/stglass
        blendFunc GL_ONE GL_ONE
rgbGen identity
glow
    }
}
 
shot0071_zps6b011696.jpg

 

Just looks like a glowing wall. Is this the best I can hope for with the engine?

 

Link to comment
  • Solution
q3logo.jpgsurfaceparm lightfilter

Causes the Q3Map2 light stage to use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.

Link to comment

q3logo.jpgsurfaceparm lightfilter

Causes the Q3Map2 light stage to use the texture's RGB and alpha channels to generate colored alpha shadows in the lightmap. For example, this can be used to create the colored light effect cast by stained glass windows. This can be used with surfaceparm alphashadow.

 

 

So far as I can tell that didn't change anything. I even removed alphashadow to see if it was conflicted at all.

 

shot0072_zpsbe1dcb57.jpg

 

Current .shader settings

 

 

textures/the_enclave/stglass

{
q3map_material Glass
surfaceparm nonopaque
surfaceparm trans
surfaceparm lightfilter
cull twosided
qer_trans 1.0
    {
        map textures/the_enclave/stglass
        alphaFunc GE128
        blendFunc GL_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
        depthWrite
    }
    { 
        map $lightmap 
        rgbGen identity 
        blendFunc GL_DST_COLOR GL_ZERO 
        depthFunc equal 
    }
    {
        map textures/the_enclave/stglass
        blendFunc GL_ONE GL_ONE
rgbGen identity
glow
    }
}

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...