Examples of Texture


Examples of com.jme.image.Texture

                        TextureState.RS_TEXTURE);
                if (ts == null) {
                    return true;
                }

                Texture t = ts.getTexture();
                if (t != null) {
                    String tFile = t.getImageLocation();
                    if (textureSet.add(tFile)) {
                        model.addRow(new Object[]{new String(tFile),
                                    "not implemented",
                                    "not implemented"});
                    }
View Full Code Here

Examples of com.jme.image.Texture

            final URL westURL = AssetUtils.getAssetURL(westURI);
            final URL downURL = AssetUtils.getAssetURL(downURI);
            final URL upURL = AssetUtils.getAssetURL(upURI);
           
            LOGGER.fine("URLs acquired. Building textures.");
            Texture north = TextureManager.loadTexture(northURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);
            Texture south = TextureManager.loadTexture(southURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);
            Texture east = TextureManager.loadTexture(eastURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);
            Texture west = TextureManager.loadTexture(westURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);
            Texture up = TextureManager.loadTexture(upURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);
            Texture down = TextureManager.loadTexture(downURL, Texture.MinificationFilter.BilinearNearestMipMap, Texture.MagnificationFilter.Bilinear);                       
        
            LOGGER.fine("Textures built. Setting fields.");
            skybox.setTexture(Skybox.Face.North, north);
            skybox.setTexture(Skybox.Face.West, west);
            skybox.setTexture(Skybox.Face.South, south);
View Full Code Here

Examples of com.jme3.texture.Texture

    */
    Geometry g = new Geometry("Bubble", b);
    g.rotate(FastMath.HALF_PI, 0, FastMath.HALF_PI);
    //g.scale(1, 1, -1);
    Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
    Texture tex = assetManager.loadTexture("Textures/test3.png");
    mat.setTexture("ColorMap", tex);
    //mat.setColor("Color", ColorRGBA.Blue);
    //mat.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);
    g.setMaterial(mat);
   
View Full Code Here

Examples of com.jogamp.opengl.util.texture.Texture

    this.gl = gl;
  }
 
  public Texture getTextureForFile(File file) {
   
    Texture result = availableTextures.get(file);
   
    if (result == null) {
     
      synchronized (this) {
       
View Full Code Here

Examples of com.jogamp.opengl.util.texture.Texture

          gl.glDisable(GL_ALPHA_TEST);
        }
       
        TextureData textureData = material.getTextureDataList().get(i);
       
        Texture texture = textureManager.getTextureForFile(textureData.file);
            texture.enable(gl); //TODO: should this be called every time?
            texture.bind(gl);
           
        /* enable anisotropic filtering (note: this could be a
         * per-texture setting, but currently isn't) */
       
            if (gl.isExtensionAvailable("GL_EXT_texture_filter_anisotropic")) {
View Full Code Here

Examples of com.jogamp.opengl.util.texture.Texture

    gl.glEnable(GL_TEXTURE_2D);
    gl.glActiveTexture(GL_TEXTURE0);
   
    gl.glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
   
    Texture backgroundTexture =
        textureManager.getTextureForFile(backgroundImage);

    backgroundTexture.enable(gl);
    backgroundTexture.bind(gl);
   
    gl.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
    gl.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
   
    int texWidth = backgroundTexture.getImageWidth();
    int texHeight = backgroundTexture.getImageHeight();
   
    /* draw quad */
       
    gl.glBegin( GL_QUADS ); {
      gl.glTexCoord2f(
View Full Code Here

Examples of com.sun.opengl.util.texture.Texture

        gl.glActiveTexture(GL.GL_TEXTURE0);
        gl.glClientActiveTexture(GL.GL_TEXTURE0);

        /* Texture */
        try {
          Texture texture = core.getTextureID(gl);
          if (texture != null) {
            gl.glBindTexture(GL.GL_TEXTURE_2D, texture.getTextureObject());
          }
        } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
       
//        bindTexture(core);

//        if (Global.RELATIVETRANSFORM) {
//        /* Transform */
//        gl.glPushMatrix();
//        gl.glTranslatef(hcore.vertexorigin.x, hcore.vertexorigin.y, hcore.vertexorigin.z);
//        gl.glScalef(hcore.vertexscale, hcore.vertexscale, hcore.vertexscale);
//        }

        Point3D vertexarray[] = hcore.vertexarray;
        Point2D texcoordarray[] = hcore.texcoordarray;

        float heightblendvalue = node.getInterpolationCounter();
        Point3D vertex[] = hcore.getInterpolationVertexArray(heightblendvalue); // vertexarray;
        int vertex_i = 0;
        Point2D texcoord[] = texcoordarray;
        int texcoord_i = 0;

        /* Initialize texture units */
        gl.glActiveTexture(GL.GL_TEXTURE0);
        gl.glClientActiveTexture(GL.GL_TEXTURE0);
        gl.glEnableClientState(GL.GL_VERTEX_ARRAY);
        gl.glEnableClientState(GL.GL_NORMAL_ARRAY);
        gl.glEnableClientState(GL.GL_TEXTURE_COORD_ARRAY);
        gl.glTexEnvi(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE);
        gl.glEnable(GL.GL_COLOR_MATERIAL);
        gl.glColor4f(1.f, 1.f, 1.f, 1.f);

        /* Set second texture only if the user wants multitexturing */
        if (Global.cacheUseMultiTexturing) {
          gl.glActiveTexture(GL.GL_TEXTURE1);
          gl.glClientActiveTexture(GL.GL_TEXTURE1);
          gl.glEnable(GL.GL_TEXTURE_2D);
          gl.glEnableClientState(GL.GL_TEXTURE_COORD_ARRAY);

          Texture interpolationtextureID = null;
          try {
            interpolationtextureID = core.getInterpolationTextureID(gl);
          } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          }
          if (interpolationtextureID == null) {
            blendvalue = 0;
          }
          else {
            gl.glColor4f(blendvalue, blendvalue, blendvalue, 1.f);
            gl.glEnable(GL.GL_TEXTURE_2D);
            interpolationtextureID.bind();
          }
        }
        else {
          blendvalue = 0;
        }
View Full Code Here

Examples of com.sun.opengl.util.texture.Texture

            int cleanLayer = shift == 1 ? 0 : 2;

            for (String str : _texsActive[cleanLayer].keySet()) {
                _texProc.freeTexture(str);
                Texture t = _texsActive[cleanLayer].get(str);
                if (isLoaded(t)) {
                    t.bind();
                    t.dispose();
                }
            }
            _texsActive[cleanLayer].clear();
            System.gc();

            if (shift == 1) {
                _texsActive[0] = _texsActive[1];
                _texsActive[1] = _texsActive[2];
                _texsActive[2] = new HashMap<String, Texture>();
                preload(_cacheRect, lvl + 1);
            } else if (shift == -1) {
                _texsActive[2] = _texsActive[1];
                _texsActive[1] = _texsActive[0];
                _texsActive[0] = new HashMap<String, Texture>();
                preload(_cacheRect, _lvl - 1);
            } else {
                System.out.println("RELOAD ALL CACHE!");
                for (int i = 0; i < 3; i++) {
                    for (String str : _texsActive[i].keySet()) {
                        _texProc.freeTexture(str);
                        Texture t = _texsActive[i].get(str);
                        if (isLoaded(t)) {
                            t.bind();
                            t.dispose();
                        }
                    }
                    _texsActive[i].clear();
                    System.gc();
                    preload(_cacheRect, _lvl - 1 + i);
View Full Code Here

Examples of com.sun.opengl.util.texture.Texture

        texStore = new TexturesStorage();
    }

    public Texture getMapTexture(String gpath) throws Exception {
        if(texStore==null)return null;
        Texture tex = null;
        HashMap<String, Texture> lay = null;

        for (HashMap<String, Texture> hm : _texsActive) {
            if (tex == null) {
                tex = hm.get(gpath);
View Full Code Here

Examples of com.sun.opengl.util.texture.Texture

        }
    }

    private void drawCell(GL gl, MapGridCellView cell) {
        try {
            Texture t = getTexture(cell);
            t.enable();
            t.bind();
            TextureCoords tc = t.getImageTexCoords();
            gl.glBegin(GL.GL_QUADS);
            gl.glTexCoord2d(tc.left(), tc.top());
            gl.glVertex3d(cell.getX(), cell.getY(), 0);

            gl.glTexCoord2d(tc.right(), tc.top());
            gl.glVertex3d(cell.getX() + cell.getWidth(), cell.getY(), 0);

            gl.glTexCoord2d(tc.right(), tc.bottom());
            gl.glVertex3d(cell.getX() + cell.getWidth(),
                    cell.getY() + cell.getHeight(), 0);

            gl.glTexCoord2d(tc.left(), tc.bottom());
            gl.glVertex3d(cell.getX(), cell.getY() + cell.getHeight(), 0);
            gl.glEnd();
            t.disable();
        } catch (Exception e) {
            e.printStackTrace();
            gl.glDisable(GL.GL_TEXTURE);
        }
        boolean drawRects = false;
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.