当前位置: 首页>>代码示例>>Java>>正文


Java WrapAxis类代码示例

本文整理汇总了Java中com.jme3.texture.Texture.WrapAxis的典型用法代码示例。如果您正苦于以下问题:Java WrapAxis类的具体用法?Java WrapAxis怎么用?Java WrapAxis使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


WrapAxis类属于com.jme3.texture.Texture包,在下文中一共展示了WrapAxis类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setupTextureParams

import com.jme3.texture.Texture.WrapAxis; //导入依赖的package包/类
private void setupTextureParams(Texture tex) {
        int target = convertTextureType(tex.getType());

        // filter things
        int minFilter = convertMinFilter(tex.getMinFilter());
        int magFilter = convertMagFilter(tex.getMagFilter());
        glTexParameteri(target, GL_TEXTURE_MIN_FILTER, minFilter);
        glTexParameteri(target, GL_TEXTURE_MAG_FILTER, magFilter);

        // repeat modes
        switch (tex.getType()) {
//            case ThreeDimensional:
//            case CubeMap:
//                glTexParameteri(target, GL_TEXTURE_WRAP_R, convertWrapMode(tex.getWrap(WrapAxis.R)));
            case TwoDimensional:
                glTexParameteri(target, GL_TEXTURE_WRAP_T, convertWrapMode(tex.getWrap(WrapAxis.T)));
                // fall down here is intentional..
//            case OneDimensional:
                glTexParameteri(target, GL_TEXTURE_WRAP_S, convertWrapMode(tex.getWrap(WrapAxis.S)));
                break;
            default:
                throw new UnsupportedOperationException("Unknown texture type: " + tex.getType());
        }
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:25,代码来源:LwjglGL1Renderer.java

示例2: setupTextureParams

import com.jme3.texture.Texture.WrapAxis; //导入依赖的package包/类
private void setupTextureParams(Texture tex) {
        int target = convertTextureType(tex.getType());

        // filter things
        int minFilter = convertMinFilter(tex.getMinFilter());
        int magFilter = convertMagFilter(tex.getMagFilter());
        gl.glTexParameteri(target, gl.GL_TEXTURE_MIN_FILTER, minFilter);
        gl.glTexParameteri(target, gl.GL_TEXTURE_MAG_FILTER, magFilter);

        // repeat modes
        switch (tex.getType()) {
            case ThreeDimensional:
            case CubeMap:
                gl.glTexParameteri(target, gl.GL_TEXTURE_WRAP_R, convertWrapMode(tex.getWrap(WrapAxis.R)));
            case TwoDimensional:
                gl.glTexParameteri(target, gl.GL_TEXTURE_WRAP_T, convertWrapMode(tex.getWrap(WrapAxis.T)));
                // fall down here is intentional..
//            case OneDimensional:
                gl.glTexParameteri(target, gl.GL_TEXTURE_WRAP_S, convertWrapMode(tex.getWrap(WrapAxis.S)));
                break;
            default:
                throw new UnsupportedOperationException("Unknown texture type: " + tex.getType());
        }

        // R to Texture compare mode
        if (tex.getShadowCompareMode() != Texture.ShadowCompareMode.Off) {
            gl.glTexParameteri(target, GL.GL_TEXTURE_COMPARE_MODE, GL.GL_COMPARE_R_TO_TEXTURE);
            gl.glTexParameteri(target, GL.GL_DEPTH_TEXTURE_MODE, GL.GL_INTENSITY);
            if (tex.getShadowCompareMode() == Texture.ShadowCompareMode.GreaterOrEqual) {
                gl.glTexParameteri(target, GL.GL_TEXTURE_COMPARE_FUNC, GL.GL_GEQUAL);
            } else {
                gl.glTexParameteri(target, GL.GL_TEXTURE_COMPARE_FUNC, GL.GL_LEQUAL);
            }
        }
    }
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:36,代码来源:JoglRenderer.java

示例3: setupTextureParams

import com.jme3.texture.Texture.WrapAxis; //导入依赖的package包/类
@SuppressWarnings("fallthrough")
    private void setupTextureParams(Texture tex) {
        Image image = tex.getImage();
        int target = convertTextureType(tex.getType(), image != null ? image.getMultiSamples() : 1);

        // filter things
        int minFilter = convertMinFilter(tex.getMinFilter());
        int magFilter = convertMagFilter(tex.getMagFilter());
        glTexParameteri(target, GL_TEXTURE_MIN_FILTER, minFilter);
        glTexParameteri(target, GL_TEXTURE_MAG_FILTER, magFilter);

        if (tex.getAnisotropicFilter() > 1) {
            if (GLContext.getCapabilities().GL_EXT_texture_filter_anisotropic) {
                glTexParameterf(target,
                        EXTTextureFilterAnisotropic.GL_TEXTURE_MAX_ANISOTROPY_EXT,
                        tex.getAnisotropicFilter());
            }
        }

        if (context.pointSprite) {
            return; // Attempt to fix glTexParameter crash for some ATI GPUs
        }
        // repeat modes
        switch (tex.getType()) {
            case ThreeDimensional:
            case CubeMap: // cubemaps use 3D coords
                glTexParameteri(target, GL_TEXTURE_WRAP_R, convertWrapMode(tex.getWrap(WrapAxis.R)));
            case TwoDimensional:
            case TwoDimensionalArray:
                glTexParameteri(target, GL_TEXTURE_WRAP_T, convertWrapMode(tex.getWrap(WrapAxis.T)));
                // fall down here is intentional..
//            case OneDimensional:
                glTexParameteri(target, GL_TEXTURE_WRAP_S, convertWrapMode(tex.getWrap(WrapAxis.S)));
                break;
            default:
                throw new UnsupportedOperationException("Unknown texture type: " + tex.getType());
        }

        // R to Texture compare mode
        if (tex.getShadowCompareMode() != Texture.ShadowCompareMode.Off) {
            glTexParameteri(target, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);
            glTexParameteri(target, GL_DEPTH_TEXTURE_MODE, GL_INTENSITY);
            if (tex.getShadowCompareMode() == Texture.ShadowCompareMode.GreaterOrEqual) {
                glTexParameteri(target, GL_TEXTURE_COMPARE_FUNC, GL_GEQUAL);
            } else {
                glTexParameteri(target, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
            }
        }
    }
 
开发者ID:mleoking,项目名称:PhET,代码行数:50,代码来源:LwjglRenderer.java

示例4: applyTexture

import com.jme3.texture.Texture.WrapAxis; //导入依赖的package包/类
protected void applyTexture(Texture texture) {
	if (containerOnly)
		throw new IllegalStateException("Element is a container.");
	if (texture == null) {
		if (geom != null) {
			geom.removeFromParent();
			geom = null;
		}
		createDefaultGeometry();
		defaultTex = null;
	} else {
		if (defaultTex == null && geom != null) {
			geom.removeFromParent();
			geom = null;
		}
		defaultTex = texture;
		if (geom == null) {
			geom = new Geometry(styleId + ":Geometry");
			geom.setCullHint(CullHint.Never);
			geom.setQueueBucket(Bucket.Gui);
			geom.setMaterial(mat);
		}

		defaultTex.setMinFilter(minFilter);
		defaultTex.setMagFilter(magFilter);

		switch (tileMode) {
		case NONE:
			defaultTex.setWrap(Texture.WrapMode.Clamp);
			break;
		case REPEAT:
		case REPEAT_X:
			defaultTex.setWrap(Texture.WrapMode.Repeat);
			break;
		case REPEAT_Y:
			defaultTex.setWrap(WrapAxis.T, Texture.WrapMode.Repeat);
			defaultTex.setWrap(WrapAxis.S, Texture.WrapMode.Clamp);
			break;
		}

		recreateElementQuadGrid();
		mat.setTexture("ColorMap", defaultTex);
		setElementMaterialColor(defaultColor);
		geom.setMaterial(mat);

		if (geom.getParent() == null)
			attachChild(geom);
	}

	dirtyLayout(false, LayoutType.boundsChange());
	updateNodeLocation();
}
 
开发者ID:rockfireredmoon,项目名称:icetone,代码行数:53,代码来源:BaseElement.java

示例5: setupTextureParams

import com.jme3.texture.Texture.WrapAxis; //导入依赖的package包/类
/**
     * <code>setupTextureParams</code> sets the OpenGL context texture parameters
     * @param tex the Texture to set the texture parameters from
     */
    private void setupTextureParams(Texture tex) {
        int target = convertTextureType(tex.getType());

        // filter things
        int minFilter = convertMinFilter(tex.getMinFilter());
        int magFilter = convertMagFilter(tex.getMagFilter());

        if (verboseLogging) {
            logger.info("GLES20.glTexParameteri(" + target + ", GLES20.GL_TEXTURE_MIN_FILTER, " + minFilter + ")");
        }

        Gdx.gl20.glTexParameteri(target, GL20.GL_TEXTURE_MIN_FILTER, minFilter);

        if (verboseLogging) {
            logger.info("GLES20.glTexParameteri(" + target + ", GLES20.GL_TEXTURE_MAG_FILTER, " + magFilter + ")");
        }

        Gdx.gl20.glTexParameteri(target, GL20.GL_TEXTURE_MAG_FILTER, magFilter);

        /*        
        if (tex.getAnisotropicFilter() > 1){
        
        if (GLContext.getCapabilities().GL_EXT_texture_filter_anisotropic){
        glTexParameterf(target,
        EXTTextureFilterAnisotropic.GL_TEXTURE_MAX_ANISOTROPY_EXT,
        tex.getAnisotropicFilter());
        }
        
        }
         */
        // repeat modes

        switch (tex.getType()) {
            case ThreeDimensional:
            case CubeMap: // cubemaps use 3D coords
                // GL_TEXTURE_WRAP_R is not available in api 8
                //GLES20.glTexParameteri(target, GLES20.GL_TEXTURE_WRAP_R, convertWrapMode(tex.getWrap(WrapAxis.R)));
            case TwoDimensional:
            case TwoDimensionalArray:

                if (verboseLogging) {
                    logger.info("GLES20.glTexParameteri(" + target + ", GLES20.GL_TEXTURE_WRAP_T, " + convertWrapMode(tex.getWrap(WrapAxis.T)));
                }

                Gdx.gl20.glTexParameteri(target, GL20.GL_TEXTURE_WRAP_T, convertWrapMode(tex.getWrap(WrapAxis.T)));

                // fall down here is intentional..
//          case OneDimensional:

                if (verboseLogging) {
                    logger.info("GLES20.glTexParameteri(" + target + ", GLES20.GL_TEXTURE_WRAP_S, " + convertWrapMode(tex.getWrap(WrapAxis.S)));
                }

                Gdx.gl20.glTexParameteri(target, GL20.GL_TEXTURE_WRAP_S, convertWrapMode(tex.getWrap(WrapAxis.S)));
                break;
            default:
                throw new UnsupportedOperationException("Unknown texture type: " + tex.getType());
        }

        // R to Texture compare mode
/*
        if (tex.getShadowCompareMode() != Texture.ShadowCompareMode.Off){
        GLES20.glTexParameteri(target, GLES20.GL_TEXTURE_COMPARE_MODE, GLES20.GL_COMPARE_R_TO_TEXTURE);
        GLES20.glTexParameteri(target, GLES20.GL_DEPTH_TEXTURE_MODE, GLES20.GL_INTENSITY);
        if (tex.getShadowCompareMode() == Texture.ShadowCompareMode.GreaterOrEqual){
        GLES20.glTexParameteri(target, GLES20.GL_TEXTURE_COMPARE_FUNC, GLES20.GL_GEQUAL);
        }else{
        GLES20.glTexParameteri(target, GLES20.GL_TEXTURE_COMPARE_FUNC, GLES20.GL_LEQUAL);
        }
        }
         */
    }
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:77,代码来源:GdxRenderer.java

示例6: setupTextureParams

import com.jme3.texture.Texture.WrapAxis; //导入依赖的package包/类
/**
     * <code>setupTextureParams</code> sets the OpenGL context texture parameters
     * @param tex the Texture to set the texture parameters from
     */
    private void setupTextureParams(Texture tex) {
        int target = convertTextureType(tex.getType());

        // filter things
        int minFilter = convertMinFilter(tex.getMinFilter());
        int magFilter = convertMagFilter(tex.getMagFilter());

        if (verboseLogging) {
            logger.info("GLES20.glTexParameteri(" + target + ", GLES20.GL_TEXTURE_MIN_FILTER, " + minFilter + ")");
        }

        GLES20.glTexParameteri(target, GLES20.GL_TEXTURE_MIN_FILTER, minFilter);

        if (verboseLogging) {
            logger.info("GLES20.glTexParameteri(" + target + ", GLES20.GL_TEXTURE_MAG_FILTER, " + magFilter + ")");
        }

        GLES20.glTexParameteri(target, GLES20.GL_TEXTURE_MAG_FILTER, magFilter);

        /*        
        if (tex.getAnisotropicFilter() > 1){
        
        if (GLContext.getCapabilities().GL_EXT_texture_filter_anisotropic){
        glTexParameterf(target,
        EXTTextureFilterAnisotropic.GL_TEXTURE_MAX_ANISOTROPY_EXT,
        tex.getAnisotropicFilter());
        }
        
        }
         */
        // repeat modes

        switch (tex.getType()) {
            case ThreeDimensional:
            case CubeMap: // cubemaps use 3D coords
            // GL_TEXTURE_WRAP_R is not available in api 8
            //GLES20.glTexParameteri(target, GLES20.GL_TEXTURE_WRAP_R, convertWrapMode(tex.getWrap(WrapAxis.R)));
            case TwoDimensional:
            case TwoDimensionalArray:

                if (verboseLogging) {
                    logger.info("GLES20.glTexParameteri(" + target + ", GLES20.GL_TEXTURE_WRAP_T, " + convertWrapMode(tex.getWrap(WrapAxis.T)));
                }

                GLES20.glTexParameteri(target, GLES20.GL_TEXTURE_WRAP_T, convertWrapMode(tex.getWrap(WrapAxis.T)));

                // fall down here is intentional..
//          case OneDimensional:

                if (verboseLogging) {
                    logger.info("GLES20.glTexParameteri(" + target + ", GLES20.GL_TEXTURE_WRAP_S, " + convertWrapMode(tex.getWrap(WrapAxis.S)));
                }

                GLES20.glTexParameteri(target, GLES20.GL_TEXTURE_WRAP_S, convertWrapMode(tex.getWrap(WrapAxis.S)));
                break;
            default:
                throw new UnsupportedOperationException("Unknown texture type: " + tex.getType());
        }

        // R to Texture compare mode
/*
        if (tex.getShadowCompareMode() != Texture.ShadowCompareMode.Off){
        GLES20.glTexParameteri(target, GLES20.GL_TEXTURE_COMPARE_MODE, GLES20.GL_COMPARE_R_TO_TEXTURE);
        GLES20.glTexParameteri(target, GLES20.GL_DEPTH_TEXTURE_MODE, GLES20.GL_INTENSITY);
        if (tex.getShadowCompareMode() == Texture.ShadowCompareMode.GreaterOrEqual){
        GLES20.glTexParameteri(target, GLES20.GL_TEXTURE_COMPARE_FUNC, GLES20.GL_GEQUAL);
        }else{
        GLES20.glTexParameteri(target, GLES20.GL_TEXTURE_COMPARE_FUNC, GLES20.GL_LEQUAL);
        }
        }
         */
    }
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:77,代码来源:OGLESShaderRenderer.java

示例7: updateTextureData

import com.jme3.texture.Texture.WrapAxis; //导入依赖的package包/类
public void updateTextureData(Texture tex) {
    int texId = tex.getId();
    GL gl = GLContext.getCurrentGL();
    if (texId == -1) {
        // create texture
        gl.glGenTextures(1, intBuf1);
        texId = intBuf1.get(0);
        tex.setId(texId);
        objManager.registerForCleanup(tex);
    }

    // bind texture
    int target = convertTextureType(tex.getType());
    if (context.boundTextures[0] != tex) {
        if (context.boundTextureUnit != 0) {
            setActiveTexture(GL.GL_TEXTURE0);
            context.boundTextureUnit = 0;
        }

        bindTexture(target, texId);
        context.boundTextures[0] = tex;
    }

    // filter things
    int minFilter = convertMinFilter(tex.getMinFilter());
    int magFilter = convertMagFilter(tex.getMagFilter());
    gl.glTexParameteri(target, GL.GL_TEXTURE_MIN_FILTER, minFilter);
    gl.glTexParameteri(target, GL.GL_TEXTURE_MAG_FILTER, magFilter);

    // repeat modes
    switch (tex.getType()) {
        case ThreeDimensional:
        case CubeMap:
            gl.glTexParameteri(target, GL2GL3.GL_TEXTURE_WRAP_R,
                    convertWrapMode(tex.getWrap(WrapAxis.R)));
        case TwoDimensional:
            gl.glTexParameteri(target, GL.GL_TEXTURE_WRAP_T,
                    convertWrapMode(tex.getWrap(WrapAxis.T)));
            // fall down here is intentional..
            // case OneDimensional:
            gl.glTexParameteri(target, GL.GL_TEXTURE_WRAP_S,
                    convertWrapMode(tex.getWrap(WrapAxis.S)));
            break;
        default:
            throw new UnsupportedOperationException("Unknown texture type: " + tex.getType());
    }

    Image img = tex.getImage();
    if (img != null) {
        boolean generateMips = false;
        if (!img.hasMipmaps() && tex.getMinFilter().usesMipMapLevels()) {
            // No pregenerated mips available,
            // generate from base level if required
            if (hardwareMips) {
                gl.glTexParameteri(target, GL2ES1.GL_GENERATE_MIPMAP, GL.GL_TRUE);
            }
            else {
                generateMips = true;
            }
        }

        TextureUtil.uploadTexture(gl, img, tex.getImageDataIndex(), generateMips, powerOf2);
    }

    tex.clearUpdateNeeded();
}
 
开发者ID:chototsu,项目名称:MikuMikuStudio,代码行数:67,代码来源:JoglRenderer.java


注:本文中的com.jme3.texture.Texture.WrapAxis类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。