use of com.gempukku.libgdx.graph.shader.field.ShaderFieldType in project gdx-graph by MarcinSc.
the class ExponentialShaderNodeBuilder method buildCommonNode.
@Override
protected ObjectMap<String, ? extends FieldOutput> buildCommonNode(boolean designTime, String nodeId, JsonValue data, ObjectMap<String, FieldOutput> inputs, ObjectSet<String> producedOutputs, CommonShaderBuilder commonShaderBuilder, GraphShaderContext graphShaderContext, GraphShader graphShader) {
FieldOutput inputValue = inputs.get("input");
ShaderFieldType resultType = inputValue.getFieldType();
commonShaderBuilder.addMainLine("// Exponential node");
String name = "result_" + nodeId;
commonShaderBuilder.addMainLine(resultType.getShaderType() + " " + name + " = exp(" + inputValue.getRepresentation() + ");");
return LibGDXCollections.singletonMap("output", new DefaultFieldOutput(ShaderFieldType.Float, name));
}
use of com.gempukku.libgdx.graph.shader.field.ShaderFieldType in project gdx-graph by MarcinSc.
the class SquareRootShaderNodeBuilder method buildCommonNode.
@Override
protected ObjectMap<String, ? extends FieldOutput> buildCommonNode(boolean designTime, String nodeId, JsonValue data, ObjectMap<String, FieldOutput> inputs, ObjectSet<String> producedOutputs, CommonShaderBuilder commonShaderBuilder, GraphShaderContext graphShaderContext, GraphShader graphShader) {
FieldOutput inputValue = inputs.get("input");
ShaderFieldType resultType = inputValue.getFieldType();
commonShaderBuilder.addMainLine("// Square root node");
String name = "result_" + nodeId;
commonShaderBuilder.addMainLine(resultType.getShaderType() + " " + name + " = sqrt(" + inputValue.getRepresentation() + ");");
return LibGDXCollections.singletonMap("output", new DefaultFieldOutput(ShaderFieldType.Float, name));
}
use of com.gempukku.libgdx.graph.shader.field.ShaderFieldType in project gdx-graph by MarcinSc.
the class ArccosShaderNodeBuilder method buildCommonNode.
@Override
protected ObjectMap<String, ? extends FieldOutput> buildCommonNode(boolean designTime, String nodeId, JsonValue data, ObjectMap<String, FieldOutput> inputs, ObjectSet<String> producedOutputs, CommonShaderBuilder commonShaderBuilder, GraphShaderContext graphShaderContext, GraphShader graphShader) {
FieldOutput inputValue = inputs.get("input");
ShaderFieldType resultType = inputValue.getFieldType();
commonShaderBuilder.addMainLine("// Arccosine node");
String name = "result_" + nodeId;
commonShaderBuilder.addMainLine(resultType.getShaderType() + " " + name + " = acos(" + inputValue.getRepresentation() + ");");
return LibGDXCollections.singletonMap("output", new DefaultFieldOutput(resultType, name));
}
use of com.gempukku.libgdx.graph.shader.field.ShaderFieldType in project gdx-graph by MarcinSc.
the class Arctan2ShaderNodeBuilder method buildCommonNode.
@Override
protected ObjectMap<String, ? extends FieldOutput> buildCommonNode(boolean designTime, String nodeId, JsonValue data, ObjectMap<String, FieldOutput> inputs, ObjectSet<String> producedOutputs, CommonShaderBuilder commonShaderBuilder, GraphShaderContext graphShaderContext, GraphShader graphShader) {
FieldOutput inputValue = inputs.get("input");
ShaderFieldType resultType = new FloatFieldType();
commonShaderBuilder.addMainLine("// Arctangent2 node");
String name = "result_" + nodeId;
commonShaderBuilder.addMainLine(resultType.getShaderType() + " " + name + " = atan(" + inputValue.getRepresentation() + ".y, " + inputValue.getRepresentation() + ".x);");
return LibGDXCollections.singletonMap("output", new DefaultFieldOutput(resultType, name));
}
use of com.gempukku.libgdx.graph.shader.field.ShaderFieldType in project gdx-graph by MarcinSc.
the class CosShaderNodeBuilder method buildCommonNode.
@Override
protected ObjectMap<String, ? extends FieldOutput> buildCommonNode(boolean designTime, String nodeId, JsonValue data, ObjectMap<String, FieldOutput> inputs, ObjectSet<String> producedOutputs, CommonShaderBuilder commonShaderBuilder, GraphShaderContext graphShaderContext, GraphShader graphShader) {
FieldOutput inputValue = inputs.get("input");
ShaderFieldType resultType = inputValue.getFieldType();
commonShaderBuilder.addMainLine("// Cosine node");
String name = "result_" + nodeId;
commonShaderBuilder.addMainLine(resultType.getShaderType() + " " + name + " = cos(" + inputValue.getRepresentation() + ");");
return LibGDXCollections.singletonMap("output", new DefaultFieldOutput(resultType, name));
}
Aggregations