OpenArena Message Boards

OpenArena Contributions => Graphics => Topic started by: swizzler on December 24, 2018, 04:32:47 am



Title: Is this possible to do with shaders?
Post by: swizzler on December 24, 2018, 04:32:47 am
I'm trying to figure out ways to shift colors with shaders, it seems they only let you mess with brightness as far as I can tell in the shader manual. I thought up another possible way to do it, but I can't figure out if it's possible.

It's kind of tough to explain my logic so i've rendered out a 3D view of how I'm trying to construct the shader in blender and broke down the components.

(https://i.imgur.com/Wx0lHhs.png)

basically I want to borrow the alpha channel from the image the color data image is layered over, but still let the color-wheel image scroll without taking the alpha channel with it.

I'm guessing the answer is "no you can't do this" but I figured i'd ask just in case.


Title: Re: Is this possible to do with shaders?
Post by: Neon_Knight on December 24, 2018, 05:47:42 am
I guess your best bet is to try with triggerable shaders. They were the last feature added in Q3 1.32, and by proxy, OA also supports it. Only recently thanks to our own gamepacks we've started supporting it in the editor proper:

https://github.com/NeonKnightOA/oagamepack

As for how to use these shaders, here's a tutorial: http://www.simonoc.com/pages/articles/trigshaders1.htm


Title: Re: Is this possible to do with shaders?
Post by: fromhell on December 24, 2018, 07:43:29 pm
You can do an alphaFunc LT128 and depthWrite with the circle, and do depthFunc equal with your gradient stage, and then the additive blend circle stage after that

Untested unformatted psuedo code follows!!!

        
Code:
mycoolthing
{
        {
         map ball.tga
         alphafunc LT128
         depthWrite
        }
        {
         map colors.tga
         tcMod scale 1 0.01
         tcMod scroll 0 0.5
         depthFunc equal
        }
        {
         map ball.tga
         blendFunc add
         depthFunc equal
        }
}