Jump to content

Alpha Blending NVIDIA issue?


Guest KENNITHH

Recommended Posts

Guest KENNITHH
Posted

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
Posted

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
    }
}
Guest KENNITHH
Posted

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 :(

Guest KENNITHH
Posted (edited)

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
Posted

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?

Posted

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

Posted

That seems unnecessary when you can use the alpha channel of the same texture though. Or better yet, add all the detail on to a separate texture and you save yourself 4 extra renders :D

Posted

this may not be super effective on the renderer, but this creates semi-random decals all over surfaces allowing you to create more texture variation without extra work

Posted

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

Guest KENNITHH
Posted

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.

Guest KENNITHH
Posted

Hm alright, a huge pitty though, it could really improve the default maps if I could use. Thanks for looking into this

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