use of com.gempukku.libgdx.graph.shader.field.ShaderFieldType in project gdx-graph by MarcinSc.
the class RadiansShaderNodeBuilder 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("// Radians node");
String name = "result_" + nodeId;
commonShaderBuilder.addMainLine(resultType.getShaderType() + " " + name + " = radians(" + 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 TanShaderNodeBuilder 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("// Tangent node");
String name = "result_" + nodeId;
commonShaderBuilder.addMainLine(resultType.getShaderType() + " " + name + " = tan(" + 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 PowerShaderNodeBuilder 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 aValue = inputs.get("a");
FieldOutput bValue = inputs.get("b");
ShaderFieldType resultType = aValue.getFieldType();
commonShaderBuilder.addMainLine("// Power node");
String name = "result_" + nodeId;
commonShaderBuilder.addMainLine(resultType.getShaderType() + " " + name + " = pow(" + aValue.getRepresentation() + ", " + bValue.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 ArctanShaderNodeBuilder 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("// Arctangent node");
String name = "result_" + nodeId;
commonShaderBuilder.addMainLine(resultType.getShaderType() + " " + name + " = atan(" + 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 SinShaderNodeBuilder 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("// Sine node");
String name = "result_" + nodeId;
commonShaderBuilder.addMainLine(resultType.getShaderType() + " " + name + " = sin(" + inputValue.getRepresentation() + ");");
return LibGDXCollections.singletonMap("output", new DefaultFieldOutput(resultType.getName(), name));
}
Aggregations