A bunch of basic ShaderNodes
This commit is contained in:
parent
0c27026978
commit
2c38efe051
@ -0,0 +1,19 @@
|
|||||||
|
ShaderNodeDefinitions{
|
||||||
|
ShaderNodeDefinition ColorAdd {
|
||||||
|
Type: Fragment
|
||||||
|
Shader GLSL100: Common/MatDefs/ShaderNodes/Basic/colorAdd.frag
|
||||||
|
Documentation{
|
||||||
|
Adds two colors
|
||||||
|
@input color1 the first color
|
||||||
|
@input color2 the second color
|
||||||
|
@output outColor the resulting color
|
||||||
|
}
|
||||||
|
Input {
|
||||||
|
vec4 color1
|
||||||
|
vec4 color2
|
||||||
|
}
|
||||||
|
Output {
|
||||||
|
vec4 outColor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
ShaderNodeDefinitions{
|
||||||
|
ShaderNodeDefinition ColorSplitter {
|
||||||
|
Type: Fragment
|
||||||
|
Shader GLSL100: Common/MatDefs/ShaderNodes/Basic/colorSplitter.frag
|
||||||
|
Documentation{
|
||||||
|
Retrives the individual color channels
|
||||||
|
@input color the color
|
||||||
|
@output red the red channel
|
||||||
|
@output green the green channel
|
||||||
|
@output blue the blue channel
|
||||||
|
@output alpha the alpha channel
|
||||||
|
}
|
||||||
|
Input {
|
||||||
|
vec4 color
|
||||||
|
}
|
||||||
|
Output {
|
||||||
|
float red
|
||||||
|
float green
|
||||||
|
float blue
|
||||||
|
float alpha
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
ShaderNodeDefinitions{
|
||||||
|
ShaderNodeDefinition ColorToGrey {
|
||||||
|
Type: Fragment
|
||||||
|
Shader GLSL100: Common/MatDefs/ShaderNodes/Basic/colorToGrey.frag
|
||||||
|
Documentation{
|
||||||
|
Retrives the individual color channels
|
||||||
|
@input color the color
|
||||||
|
@output greyness or lightness of the color
|
||||||
|
}
|
||||||
|
Input {
|
||||||
|
vec4 color
|
||||||
|
}
|
||||||
|
Output {
|
||||||
|
float grey
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
ShaderNodeDefinitions{
|
||||||
|
ShaderNodeDefinition ConstructColor {
|
||||||
|
Type: Fragment
|
||||||
|
Shader GLSL100: Common/MatDefs/ShaderNodes/Basic/constructColor.frag
|
||||||
|
Documentation{
|
||||||
|
Creates a new color out of 4 channels
|
||||||
|
@input red the red channel
|
||||||
|
@input green the green channel
|
||||||
|
@input blue the blue channel
|
||||||
|
@input alpha the alpha channel
|
||||||
|
@output outColor the resulting color
|
||||||
|
}
|
||||||
|
Input {
|
||||||
|
float red
|
||||||
|
float green
|
||||||
|
float blue
|
||||||
|
float alpha
|
||||||
|
}
|
||||||
|
Output {
|
||||||
|
vec4 outColor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,4 @@
|
|||||||
|
void main(){
|
||||||
|
outColor = color1 + color2;
|
||||||
|
clamp(outColor, 0.0, 1.0);
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
void main(){
|
||||||
|
red = color.r;
|
||||||
|
green = color.g;
|
||||||
|
blue = color.b;
|
||||||
|
alpha = color.a;
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
void main(){
|
||||||
|
grey = color.r + color.g + color.b;
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
void main(){
|
||||||
|
outColor = vec4(red, green, blue, alpha);
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
ShaderNodeDefinitions{
|
||||||
|
ShaderNodeDefinition AddVec2 {
|
||||||
|
Type: Fragment
|
||||||
|
Shader GLSL100: Common/MatDefs/ShaderNodes/Math/addVec2.frag
|
||||||
|
Documentation{
|
||||||
|
Add an incoming vec2 by another supplied vec2
|
||||||
|
@input coord1 the first vec2
|
||||||
|
@input coord2 the second vec2
|
||||||
|
@output outCoord the resulting coord
|
||||||
|
}
|
||||||
|
Input {
|
||||||
|
vec2 coord1
|
||||||
|
vec2 coord2
|
||||||
|
}
|
||||||
|
Output {
|
||||||
|
vec2 outCoord
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
ShaderNodeDefinitions{
|
||||||
|
ShaderNodeDefinition ConstructVec2 {
|
||||||
|
Type: Fragment
|
||||||
|
Shader GLSL100: Common/MatDefs/ShaderNodes/Math/constructVec2.frag
|
||||||
|
Documentation{
|
||||||
|
Combines 2 floats into a vec2
|
||||||
|
@input x the first float
|
||||||
|
@input y the second float
|
||||||
|
@output outVec the resulting vec2
|
||||||
|
}
|
||||||
|
Input {
|
||||||
|
float x
|
||||||
|
float y
|
||||||
|
}
|
||||||
|
Output {
|
||||||
|
vec2 outVec
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
ShaderNodeDefinitions{
|
||||||
|
ShaderNodeDefinition ConstructVec3 {
|
||||||
|
Type: Fragment
|
||||||
|
Shader GLSL100: Common/MatDefs/ShaderNodes/Math/constructVec3.frag
|
||||||
|
Documentation{
|
||||||
|
Combines 3 floats into a vec3
|
||||||
|
@input x the first float, x
|
||||||
|
@input y the second float, y
|
||||||
|
@input z the third float, z
|
||||||
|
@output outVec the resulting vec3
|
||||||
|
}
|
||||||
|
Input {
|
||||||
|
float x
|
||||||
|
float y
|
||||||
|
float z
|
||||||
|
}
|
||||||
|
Output {
|
||||||
|
vec3 outVec
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
ShaderNodeDefinitions{
|
||||||
|
ShaderNodeDefinition Mult {
|
||||||
|
Type: Fragment
|
||||||
|
Shader GLSL100: Common/MatDefs/ShaderNodes/Math/mult.frag
|
||||||
|
Documentation{
|
||||||
|
Multiplies two floats
|
||||||
|
@input float1 the first float
|
||||||
|
@input float2 the second float
|
||||||
|
@output outFloat the resulting coord
|
||||||
|
}
|
||||||
|
Input {
|
||||||
|
float float1
|
||||||
|
float float2
|
||||||
|
}
|
||||||
|
Output {
|
||||||
|
float outFloat
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
ShaderNodeDefinitions{
|
||||||
|
ShaderNodeDefinition MultVec2 {
|
||||||
|
Type: Fragment
|
||||||
|
Shader GLSL100: Common/MatDefs/ShaderNodes/Math/multVec2.frag
|
||||||
|
Documentation{
|
||||||
|
Multiplies an incoming vec2 by another supplied vec2
|
||||||
|
@input coord1 the first vec2
|
||||||
|
@input coord2 the second vec2
|
||||||
|
@output outCoord the resulting coord
|
||||||
|
}
|
||||||
|
Input {
|
||||||
|
vec2 coord1
|
||||||
|
vec2 coord2
|
||||||
|
}
|
||||||
|
Output {
|
||||||
|
vec2 outCoord
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
ShaderNodeDefinitions{
|
||||||
|
ShaderNodeDefinition MultVec3 {
|
||||||
|
Type: Fragment
|
||||||
|
Shader GLSL100: Common/MatDefs/ShaderNodes/Math/multVec3.frag
|
||||||
|
Documentation{
|
||||||
|
Multiplies a vec3 by another vec3
|
||||||
|
@input pos1 the first vec3
|
||||||
|
@input pos2 the second vec3
|
||||||
|
@output outPos the resulting position
|
||||||
|
}
|
||||||
|
Input {
|
||||||
|
vec2 pos1
|
||||||
|
vec2 pos2
|
||||||
|
}
|
||||||
|
Output {
|
||||||
|
vec2 outPos
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
ShaderNodeDefinitions{
|
||||||
|
ShaderNodeDefinition OneMinus {
|
||||||
|
Type: Fragment
|
||||||
|
Shader GLSL100: Common/MatDefs/ShaderNodes/Math/oneMinus.frag
|
||||||
|
Documentation{
|
||||||
|
return 1 - value
|
||||||
|
@input value a float
|
||||||
|
@output outFloat the resulting value
|
||||||
|
}
|
||||||
|
Input {
|
||||||
|
float value
|
||||||
|
}
|
||||||
|
Output {
|
||||||
|
float outFloat
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
ShaderNodeDefinitions{
|
||||||
|
ShaderNodeDefinition Pow {
|
||||||
|
Type: Fragment
|
||||||
|
Shader GLSL100: Common/MatDefs/ShaderNodes/Math/pow.frag
|
||||||
|
Documentation{
|
||||||
|
return power of value based on factor
|
||||||
|
@input value a float
|
||||||
|
@input factor a float
|
||||||
|
@output outFloat the resulting value
|
||||||
|
}
|
||||||
|
Input {
|
||||||
|
float value
|
||||||
|
float factor
|
||||||
|
}
|
||||||
|
Output {
|
||||||
|
float outFloat
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
void main(){
|
||||||
|
outCoord = coord1 + coord2;
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
void main(){
|
||||||
|
outVec = vec2(x, y);
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
void main(){
|
||||||
|
outVec = vec3(x, y, z);
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
void main(){
|
||||||
|
outFloat = float1 * float2;
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
void main(){
|
||||||
|
outCoord = coord1 * coord2;
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
void main(){
|
||||||
|
outPos = pos1 * pos2;
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
void main(){
|
||||||
|
outFloat = 1 - value;
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
void main(){
|
||||||
|
outFloat = pow(value, factor);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user