Jump to content

Alpha Blending NVIDIA issue?


Guest KENNITHH

Recommended Posts

Guest KENNITHH

So I met this guy on SOF2 a while ago whos pretty good at shaders. He tested something which looked pretty neat but apparently, it doesn't work on NVIDIA cards.. Does this happen in JK aswell? And if so is there a way around it?

 

 

Here's some more info about the shader and stuff.

 

Shader:

 

 

textures/mk_textures/multiblend_01
{
qer_editorimage textures/mk_textures/multiblend_01
q3map_globaltexture
    {
        map textures/mk_textures/block_base_01
    }
    {
        map textures/mk_textures/blender_01
        blendFunc GL_ZERO GL_ONE_MINUS_SRC_COLOR
        depthWrite
        tcMod scale 0.25 0.25
    }
    {
        map textures/mk_textures/cracks_01
        blendFunc GL_ONE_MINUS_DST_ALPHA GL_DST_ALPHA
        depthFunc equal
    }
    {
        map textures/mk_textures/blender_01
        blendFunc GL_ZERO GL_ONE_MINUS_SRC_COLOR
        depthWrite
        tcMod scale 0.2 0.2
    }
    {
        map textures/mk_textures/sand_01
        blendFunc GL_ONE_MINUS_DST_ALPHA GL_DST_ALPHA
        depthFunc equal
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}

 

 

 
What it should look like and what it looks like (notice the random sand and cracks):
12a9b72a7d.jpg
f3d6406129.jpg
 
And apparently it has to do something with this:
bbe9a1a9d4.jpg
Link to comment

I would remove all those depthWrite and depthFunc commands. They're not necessary and can cause problems like this.

 

textures/mk_textures/multiblend_01
{
    qer_editorimage textures/mk_textures/multiblend_01
    q3map_globaltexture
    {
        map textures/mk_textures/block_base_01
    }
    {
        map textures/mk_textures/blender_01
        blendFunc GL_ZERO GL_ONE_MINUS_SRC_COLOR
        tcMod scale 0.25 0.25
    }
    {
        map textures/mk_textures/cracks_01
        blendFunc GL_ONE_MINUS_DST_ALPHA GL_DST_ALPHA
    }
    {
        map textures/mk_textures/blender_01
        blendFunc GL_ZERO GL_ONE_MINUS_SRC_COLOR
        tcMod scale 0.2 0.2
    }
    {
        map textures/mk_textures/sand_01
        blendFunc GL_ONE_MINUS_DST_ALPHA GL_DST_ALPHA
    }
    {
        map $lightmap
        blendFunc GL_DST_COLOR GL_ZERO
    }
}
Link to comment
Guest KENNITHH

I would remove all those depthWrite and depthFunc commands. They're not necessary and can cause problems like this.

 

Thanks for joining in in this thread, but it didn't work :(

Link to comment
Guest KENNITHH

No, no errors at all. Here's what the maker of it said:

 

 

 

[21:33:56] nick: yeah, well, they're necessary since i take out the alpha channel for the next texture to be blent
[21:34:56] nick: so in the shader i use a blender, scale it, then write it's alpha with depthwrite for the next texture to use
[21:35:23] nick: did you tell them that the shader works on ati, but not on nvidia

 

EDIT: And apparently you're right about the depthfunc and depthwrite he said.
Btw , I just tried the BSP in JKA and it doesnt work there either

 

81195f1756.jpg

Edited by KENNITHH
Link to comment

Taking out the alpha channel doesn't stop depth from being written, even if it's completely transparent. At least I don't think it will.

 

So yeah, possibly a bug in nvidia's drivers. I'm interested in knowing why so many stages are needed to achieve that kind of effect though? What do the texture maps look like?

Link to comment

Taking out the alpha channel doesn't stop depth from being written, even if it's completely transparent. At least I don't think it will.

 

So yeah, possibly a bug in nvidia's drivers. I'm interested in knowing why so many stages are needed to achieve that kind of effect though? What do the texture maps look like?

from what I understand the "blender" stages are used as masks for the detail textures

Link to comment

Well, if there's a way to scale up the alpha channel without touching the texture holding it, that would be great! 

Here's how it looks on my 7770 amd
 

http://www.hostingpics.net/viewer.php?id=5554672303.jpg
 

http://www.hostingpics.net/viewer.php?id=6706327502.jpg

 

http://www.hostingpics.net/viewer.php?id=7371587701.jpg

 

No textures are scaled up except for the "blender", so the resolution stays nice. If anyone has an idea how to achieve this with full compatibility, please let me know ! 

 

Nick

Link to comment
Guest KENNITHH

So I fear there is no solution to this?

 

My idea was to use this blending for retouching original maps without the extra use of new textures or recompiling. Just shaders and new models and perhaps .ent files.

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...