Package org.terasology.rendering.assets.shader

Examples of org.terasology.rendering.assets.shader.Shader


    @Override
    public MaterialData load(Module module, InputStream stream, List<URL> urls, List<URL> deltas) throws IOException {
        MaterialMetadata metadata = gson.fromJson(new InputStreamReader(stream, Charsets.UTF_8), MaterialMetadata.class);

        Shader shader = Assets.get(new AssetUri(AssetType.SHADER, metadata.shader), Shader.class);
        if (shader == null) {
            return null;
        }

        MaterialData data = new MaterialData(shader);
View Full Code Here


        activeMaterial = null;
    }

    private GLSLMaterial prepareAndStoreShaderProgramInstance(String title, ShaderParameters params) {
        String uri = "engine:" + title;
        Shader shader = Assets.getShader(uri);
        checkNotNull(shader, "Failed to resolve %s", uri);
        shader.recompile();
        GLSLMaterial material = Assets.generateAsset(new AssetUri(AssetType.MATERIAL, "engine:prog." + title), new MaterialData(shader), GLSLMaterial.class);
        material.setShaderParameters(params);

        return material;
    }
View Full Code Here

TOP

Related Classes of org.terasology.rendering.assets.shader.Shader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.