Examples of GLSLMaterial


Examples of org.terasology.rendering.opengl.GLSLMaterial

    }

    public static float evaluateOceanHeightAtPosition(Vector3f position, float days) {
        float height = 0.0f;

        GLSLMaterial chunkMaterial = (GLSLMaterial) Assets.getMaterial("engine:prog.chunk");
        ShaderParametersChunk chunkParameters = (ShaderParametersChunk) chunkMaterial.getShaderParameters();

        float size = chunkParameters.waveSize;
        float intens = chunkParameters.waveIntens;
        float timeFactor = chunkParameters.waveSpeed;
View Full Code Here

Examples of org.terasology.rendering.opengl.GLSLMaterial

    }

    @Override
    public void setActiveMaterial(Material material) {
        // TODO: is this the best way to convert the material to the lwjgl version?  Do we need more checks?
        GLSLMaterial glslMaterial = (GLSLMaterial) material;
        if (!glslMaterial.equals(activeMaterial)) {
            activeMaterial = glslMaterial;
        }
    }
View Full Code Here

Examples of org.terasology.rendering.opengl.GLSLMaterial

    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

Examples of org.terasology.rendering.opengl.GLSLMaterial

            }
        });
        assetManager.setAssetFactory(AssetType.MATERIAL, new AssetFactory<MaterialData, Material>() {
            @Override
            public Material buildAsset(AssetUri uri, MaterialData data) {
                return new GLSLMaterial(uri, data);
            }
        });
        assetManager.setAssetFactory(AssetType.MESH, new AssetFactory<MeshData, Mesh>() {
            @Override
            public Mesh buildAsset(AssetUri uri, MeshData data) {
View Full Code Here

Examples of org.terasology.rendering.opengl.GLSLMaterial

    public void onStateChange() {
        shaderPropertyMenuEntries.clear();
        shaderPropertiesMenu.removeAll();
        for (GLSLMaterial material : CoreRegistry.get(AssetManager.class).listLoadedAssets(AssetType.MATERIAL, GLSLMaterial.class)) {
            if (material.getShaderParameters() != null) {
                GLSLMaterial finalMat = material;
                final PropertyProvider provider = new ReflectionProvider(finalMat.getShaderParameters());
                if (!provider.getProperties().isEmpty()) {
                    final String programName = material.getURI().toString();
                    JMenuItem menuItem = new JMenuItem(programName);
                    menuItem.addActionListener(new ActionListener() {
                        @Override
View Full Code Here

Examples of org.terasology.rendering.opengl.GLSLMaterial

            }
        });
        assetManager.setAssetFactory(AssetType.MATERIAL, new AssetFactory<MaterialData, Material>() {
            @Override
            public Material buildAsset(AssetUri uri, MaterialData data) {
                return new GLSLMaterial(uri, data);
            }
        });
        assetManager.setAssetFactory(AssetType.MESH, new AssetFactory<MeshData, Mesh>() {
            @Override
            public Mesh buildAsset(AssetUri uri, MeshData data) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.