All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gempukku.libgdx.graph.plugin.models.provided.InstanceIdShaderNodeBuilder Maven / Gradle / Ivy

The newest version!
package com.gempukku.libgdx.graph.plugin.models.provided;

import com.badlogic.gdx.utils.JsonValue;
import com.badlogic.gdx.utils.ObjectMap;
import com.badlogic.gdx.utils.ObjectSet;
import com.gempukku.libgdx.graph.plugin.models.config.provided.InstanceIdShaderNodeConfiguration;
import com.gempukku.libgdx.graph.shader.GraphShader;
import com.gempukku.libgdx.graph.shader.GraphShaderContext;
import com.gempukku.libgdx.graph.shader.ShaderFieldType;
import com.gempukku.libgdx.graph.shader.builder.CommonShaderBuilder;
import com.gempukku.libgdx.graph.shader.node.ConfigurationCommonShaderNodeBuilder;
import com.gempukku.libgdx.graph.shader.node.DefaultFieldOutput;
import com.gempukku.libgdx.graph.util.LibGDXCollections;

public class InstanceIdShaderNodeBuilder extends ConfigurationCommonShaderNodeBuilder {
    public InstanceIdShaderNodeBuilder() {
        super(new InstanceIdShaderNodeConfiguration());
    }

    @Override
    protected ObjectMap buildCommonNode(
            boolean designTime, String nodeId, JsonValue data, ObjectMap inputs, ObjectSet producedOutputs,
            CommonShaderBuilder commonShaderBuilder, GraphShaderContext graphShaderContext, GraphShader graphShader) {
        return LibGDXCollections.singletonMap("id", new DefaultFieldOutput(ShaderFieldType.Float, "float(gl_InstanceID)"));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy