parent
aa067ef60d
commit
667afa9ef3
@ -0,0 +1,23 @@ |
||||
ShaderNodeDefinitions{ |
||||
ShaderNodeDefinition Dashed { |
||||
Type: Fragment |
||||
|
||||
Shader GLSL100: com/jme3/gde/scenecomposer/gizmo/light/mat/dashed/Dashed100.frag |
||||
|
||||
Documentation{ |
||||
Renders dashed lines |
||||
@input vec2 texCoord The texture coordinates |
||||
@input float size the size of the dashes |
||||
@input vec4 inColor the color of the fragment so far |
||||
@outColor vec4 color the output color |
||||
} |
||||
Input { |
||||
vec2 texCoord |
||||
vec4 inColor |
||||
float size |
||||
} |
||||
Output { |
||||
vec4 outColor |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,11 @@ |
||||
|
||||
void main(){ |
||||
//@input vec2 texCoord The texture coordinates |
||||
//@input float size the size of the dashes |
||||
//@output vec4 color the output color |
||||
|
||||
//insert glsl code here |
||||
outColor = inColor; |
||||
outColor.a = step(1.0 - size, texCoord.x); |
||||
|
||||
} |
@ -0,0 +1,37 @@ |
||||
MaterialDef Simple { |
||||
MaterialParameters { |
||||
Float DashSize |
||||
} |
||||
Technique { |
||||
WorldParameters { |
||||
WorldViewProjectionMatrix |
||||
} |
||||
VertexShaderNodes { |
||||
ShaderNode CommonVert { |
||||
Definition : CommonVert : Common/MatDefs/ShaderNodes/Common/CommonVert.j3sn |
||||
InputMappings { |
||||
worldViewProjectionMatrix = WorldParam.WorldViewProjectionMatrix |
||||
modelPosition = Global.position.xyz |
||||
texCoord1 = Attr.inTexCoord |
||||
vertColor = Attr.inColor |
||||
} |
||||
OutputMappings { |
||||
Global.position = projPosition |
||||
} |
||||
} |
||||
} |
||||
FragmentShaderNodes { |
||||
ShaderNode Dashed { |
||||
Definition : Dashed : com/jme3/gde/scenecomposer/gizmo/light/mat/dashed/Dashed.j3sn |
||||
InputMappings { |
||||
texCoord = CommonVert.texCoord1 |
||||
inColor = CommonVert.vertColor |
||||
size = MatParam.DashSize |
||||
} |
||||
OutputMappings { |
||||
Global.color = outColor |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue