I made a new Shader, for increasing the brightness of an object by 50%.
I will add more in this thread later on.
Example for using GLSL:
X_LOADSHADER(0, "Bright.vert", "Bright.frag")
-
X_SETSHADER 0;
DRAWSPRITE
X_SETSHADER -1
-
X_SETSHADER 0;
X_DRAWOBJ
X_SETSHADER -1
-Hemlos
EDIT: This post is updated with the proper shader.
===============================================================
EDIT: COLOR SHADER BELOW:
I made a color shader, it adds color to your texture in the gpu.
This can also be used as a "brightness".
To use as brightness, increase R G B the same amount.
Remember, this is additive, so if your texture is already bright...itll push the color closer to white.
This will add some red:
X_COLORSHADER( 0.5, 0.0, 0.0 )
The colors in GLSL ranges from 0.0 to 1.0 which is the equivilant of 0x00 to 0xff
Put the shader files with the exe, and use this function to declare and set the color.
You call this function right before X_SETTEXTURE.
X_COLORSHADER( 0.5, 0.0, 0.0 )
X_SETTEXTURE Texture0 ,-1
X_DRAWOBJ Object0, 0
X_SETSHADER -1
You can reduce cycles by preloading the shader instead of putting it in the function.
FUNCTION X_COLORSHADER: R,G,B //RGB Addition
STATIC Initialize, Test
IF Initialize<>TRUE
Initialize=TRUE
Test=X_LOADSHADER(11,"Color.vert","Color.frag")
ENDIF
X_SETSHADER 11
X_PUTSHADER "R",R
X_PUTSHADER "G",G
X_PUTSHADER "B",B
RETURN Test
ENDFUNCTION
edit July 2012:
I reupload the colorshader.rar, it wasnt correct.
[attachment deleted by admin]