A bunch of basic ShaderNodes

experimental
neph1 10 years ago
parent 0c27026978
commit 2c38efe051
  1. 19
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Basic/ColorAdd.j3sn
  2. 23
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Basic/ColorSplitter.j3sn
  3. 17
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Basic/ColorToGrey.j3sn
  4. 23
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Basic/ConstructColor.j3sn
  5. 4
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Basic/colorAdd.frag
  6. 6
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Basic/colorSplitter.frag
  7. 3
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Basic/colorToGrey.frag
  8. 3
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Basic/constructColor.frag
  9. 19
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Math/AddVec2.j3sn
  10. 19
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Math/ConstructVec2.j3sn
  11. 21
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Math/ConstructVec3.j3sn
  12. 19
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Math/Mult.j3sn
  13. 19
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Math/MultVec2.j3sn
  14. 19
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Math/MultVec3.j3sn
  15. 17
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Math/OneMinus.j3sn
  16. 19
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Math/Pow.j3sn
  17. 3
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Math/addVec2.frag
  18. 3
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Math/constructVec2.frag
  19. 3
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Math/constructVec3.frag
  20. 3
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Math/mult.frag
  21. 3
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Math/multVec2.frag
  22. 3
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Math/multVec3.frag
  23. 3
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Math/oneMinus.frag
  24. 3
      jme3-core/src/main/resources/Common/MatDefs/ShaderNodes/Math/pow.frag

@ -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(){
outFloat = float1 * float2;
}

@ -0,0 +1,3 @@
void main(){
outFloat = pow(value, factor);
}
Loading…
Cancel
Save