Package com.ardor3d.renderer.state

Examples of com.ardor3d.renderer.state.GLSLShaderObjectsState


        final ContextCapabilities caps = ContextManager.getCurrentContext().getCapabilities();
        if (caps.isGLSLSupported()) {
            try {
                for (int i = 0; i<NUM_OF_BLOCK_LEVELS; i++) {
                   
                    voxelTerrainShaderState[i] = new GLSLShaderObjectsState();
                    URL vertexShader = ResourceLocatorTool.getClassPathResource(VoxelWorld.class,
                        "shaders/voxelTerrain.vert");
                    URL pixelShader = ResourceLocatorTool.getClassPathResource(VoxelWorld.class,
                        "shaders/voxelTerrain.frag");
View Full Code Here


    public Texture getTexture() {
        return textureClipmap;
    }

    public void reloadShader() {
        textureClipmapShader = new GLSLShaderObjectsState();
        try {
            textureClipmapShader.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream(TextureClipmap.class,
                    "com/ardor3d/extension/terrain/textureClipmapShader.vert"));
            textureClipmapShader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream(
                    TextureClipmap.class, "com/ardor3d/extension/terrain/textureClipmapShader.frag"));
View Full Code Here

    }

    public void reloadShader() {
        final ContextCapabilities caps = ContextManager.getCurrentContext().getCapabilities();
        if (caps.isGLSLSupported()) {
            _geometryClipmapShader = new GLSLShaderObjectsState();
            try {
                _geometryClipmapShader.setVertexShader(vertexShader.getInput());
                _geometryClipmapShader.setFragmentShader(pixelShader.getInput());
            } catch (final IOException ex) {
                Terrain.logger
View Full Code Here

    }

    public void render(final Renderer renderer, final MeshData meshData) {
        // Set up MeshData in GLSLShaderObjectsState if necessary
        // XXX: considered a hack until we settle on our shader model.
        final GLSLShaderObjectsState glsl = (GLSLShaderObjectsState) renderer.getProperRenderState(
                RenderState.StateType.GLSLShader, _states.get(RenderState.StateType.GLSLShader));

        if (glsl != null && glsl.getShaderDataLogic() != null) {
            glsl.setMesh(this);
            glsl.setNeedsRefresh(true);
        }

        final InstancingManager instancing = glsl != null ? meshData.getInstancingManager() : null;

        final RenderContext context = ContextManager.getCurrentContext();
View Full Code Here

        final MaterialState ms = new MaterialState();
        ms.setColorMaterial(ColorMaterial.Diffuse);
        _root.setRenderState(ms);

        _shader = new GLSLShaderObjectsState();
        try {
            _shader.setVertexShader(ResourceLocatorTool.getClassPathResourceAsStream(GLSLRibbonExample.class,
                    "com/ardor3d/example/media/shaders/geometryBasic.vert.glsl"));
            _shader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream(GLSLRibbonExample.class,
                    "com/ardor3d/example/media/shaders/geometryBasic.frag.glsl"));
View Full Code Here

        _exampleInfo[2].setText("[3] Toggle Blur");
        _exampleInfo[3].setText("[4] Toggle Scale");
    }

    private void buildShader() {
        _pointCubeShaderState = new GLSLShaderObjectsState();
        _pointCubeShaderState.setVertexShader(s_vert);
        _pointCubeShaderState.setGeometryShader(s_geom);
        _pointCubeShaderState.setFragmentShader(s_frag);
        _pointCubeShaderState.setUniform("texture", 0);
        _pointCubeShaderState.setUniform("scale", _boxScale);
View Full Code Here

        buildPointSprites();
    }

    private void buildShader() {
        _pointSpriteShaderState = new GLSLShaderObjectsState();
        _pointSpriteShaderState.setVertexShader(s_vert_pointsprite);
        _pointSpriteShaderState.setFragmentShader(s_frag_pointsprite);
        _pointSpriteShaderState.setUniform("texture", 0);
        _pointSpriteShaderState.setUniform("time", 0f);
    }
View Full Code Here

        quad.setTranslation(new Vector3(10, 0, 0));
        quad.setModelBound(new BoundingBox());
        quad.getSceneHints().setLightCombineMode(LightCombineMode.Off);
        _root.attachChild(quad);

        final GLSLShaderObjectsState shader = new GLSLShaderObjectsState();
        shader.setFragmentShader("void main() { gl_FragColor = vec4(1,0,0,1); }");

        sphere.setRenderState(shader);
    }
View Full Code Here

    private void buildShader() {
        final Vector2 scale = new Vector2(_canvas.getCanvasRenderer().getCamera().getWidth(), _canvas
                .getCanvasRenderer().getCamera().getHeight());

        _wireframeShaderState = new GLSLShaderObjectsState();
        _wireframeShaderState.setVertexShader(s_vert_passthru_120);
        _wireframeShaderState.setGeometryShader(s_geom_wireframe_150);
        _wireframeShaderState.setFragmentShader(s_frag_wireframe_120);
        _wireframeShaderState.setUniform("wireColor", new ColorRGBA(0, 0, 0, 1));
        _wireframeShaderState.setUniform("faceColor", new ColorRGBA(1, 1, 1, 1));
View Full Code Here

    @Override
    protected void initExample() {
        _canvas.setTitle("'To The Road Of Ribbon' by TX95 - rendered in Ardor3D");
        final Camera cam = _canvas.getCanvasRenderer().getCamera();

        _shader = new GLSLShaderObjectsState();
        try {
            _shader.setFragmentShader(ResourceLocatorTool.getClassPathResourceAsStream(GLSLRibbonExample.class,
                    "com/ardor3d/example/media/shaders/road_ribbon.frag"));
            _shader.setUniform("time", 0f);
            _shader.setUniform("resolution", new Vector2(cam.getWidth(), cam.getHeight()));
View Full Code Here

TOP

Related Classes of com.ardor3d.renderer.state.GLSLShaderObjectsState

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.