/** * Get the identifier of the full (dual eye) texture. * * @return the identifier of the full (dual eye) texture. * @see #getLeftTexId() * @see #getRightTexId() */ private int getFullTexId() { return (int) dualEyeTex.getImage().getId(); }
/** * Get the identifier of the full (dual eye) texture. * @return the identifier of the full (dual eye) texture. * @see #getLeftTexId() * @see #getRightTexId() */ private int getFullTexId() { return (int)dualEyeTex.getImage().getId(); }
/** * Get the identifier of the right eye texture. * @return the identifier of the right eye texture. * @see #getLeftTexId() * @see #getFullTexId() */ protected int getRightTexId() { return (int)rightEyeTexture.getImage().getId(); }
/** * Get the identifier of the full (dual eye) texture. * @return the identifier of the full (dual eye) texture. * @see #getLeftTexId() * @see #getRightTexId() */ private int getFullTexId() { return (int)dualEyeTex.getImage().getId(); }
/** * Get the identifier of the left eye texture. * @return the identifier of the left eye texture. * @see #getRightTexId() * @see #getFullTexId() */ protected int getLeftTexId() { return (int)leftEyeTexture.getImage().getId(); }
@Override public void clearTextureAtlas(final int atlasId) { initialData.rewind(); getTextureAtlas(atlasId).getImage().setData(initialData); }
/** * Get the identifier of the left eye texture. * * @return the identifier of the left eye texture. * @see #getRightTexId() * @see #getFullTexId() */ protected int getLeftTexId() { return (int) getLeftTexture().getImage().getId(); }
/** * Get the identifier of the left eye texture. * @return the identifier of the left eye texture. * @see #getRightTexId() * @see #getFullTexId() */ protected int getLeftTexId() { return (int)getLeftTexture().getImage().getId(); }
/** * Get the identifier of the right eye texture. * * @return the identifier of the right eye texture. * @see #getLeftTexId() * @see #getFullTexId() */ protected int getRightTexId() { return (int) getRightTexture().getImage().getId(); }
/** * Get the identifier of the right eye texture. * @return the identifier of the right eye texture. * @see #getLeftTexId() * @see #getFullTexId() */ protected int getRightTexId() { return (int)getRightTexture().getImage().getId(); }
/** * Creates a new two-dimensional texture for the purpose of offscreen * rendering. * * @see com.jme3.texture.FrameBuffer * * @param width * @param height * @param format * @param numSamples */ public Texture2D(int width, int height, int numSamples, Image.Format format){ this(new Image(format, width, height, null, ColorSpace.Linear)); getImage().setMultiSamples(numSamples); }
/** * This method triangulates the given flat texture. The given texture is not * changed. * * @param texture2d * the texture to be triangulated * @param uvs * the UV coordinates for each face */ public TriangulatedTexture(Texture2D texture2d, List<Vector2f> uvs, BlenderContext blenderContext) { maxTextureSize = blenderContext.getBlenderKey().getMaxTextureSize(); faceTextures = new TreeSet<TriangleTextureElement>(new Comparator<TriangleTextureElement>() { public int compare(TriangleTextureElement o1, TriangleTextureElement o2) { return o1.faceIndex - o2.faceIndex; } }); int facesCount = uvs.size() / 3; for (int i = 0; i < facesCount; ++i) { faceTextures.add(new TriangleTextureElement(i, texture2d.getImage(), uvs, true, blenderContext)); } format = texture2d.getImage().getFormat(); }
/** * Add a color texture to use for this framebuffer. * If MRT is enabled, then each subsequently added texture can be * rendered to through a shader that writes to the array <code>gl_FragData</code>. * If MRT is not enabled, then the index set with {@link FrameBuffer#setTargetIndex(int) } * is rendered to by the shader. * * @param tex The texture to add. * @see #addColorBuffer(com.jme3.texture.Image.Format) */ public void addColorTexture(Texture2D tex) { if (id != -1) throw new UnsupportedOperationException("FrameBuffer already initialized."); Image img = tex.getImage(); checkSetTexture(tex, false); RenderBuffer colorBuf = new RenderBuffer(); colorBuf.slot = colorBufs.size(); colorBuf.tex = tex; colorBuf.format = img.getFormat(); colorBufs.add(colorBuf); }
/** * Set the depth texture to use for this framebuffer. * * @param tex The color texture to set. */ public void setDepthTexture(Texture2D tex){ if (id != -1) throw new UnsupportedOperationException("FrameBuffer already initialized."); Image img = tex.getImage(); checkSetTexture(tex, true); depthBuf = new RenderBuffer(); depthBuf.slot = img.getFormat().isDepthStencilFormat() ? SLOT_DEPTH_STENCIL : SLOT_DEPTH; depthBuf.tex = tex; depthBuf.format = img.getFormat(); } public void setDepthTexture(TextureArray tex, int layer){
@Override protected void initFilter(AssetManager manager, RenderManager rm, ViewPort vp, int w, int h) { this.renderManager = rm; this.viewPort = vp; material = new Material(manager, "Common/MatDefs/Post/Overlay.j3md"); material.setColor("Color", ColorRGBA.White); Texture2D tex = processor.getFilterTexture(); material.setTexture("Texture", tex); if (tex.getImage().getMultiSamples() > 1) { material.setInt("NumSamples", tex.getImage().getMultiSamples()); } else { material.clearParam("NumSamples"); } renderManager.setHandleTranslucentBucket(false); if (enabledSoftParticles && depthTexture != null) { initSoftParticles(vp, true); } }
@Override public Image loadImage(final String filename) { TextureKey key = new TextureKey(filename, false); key.setAnisotropy(0); key.setGenerateMips(false); Texture2D texture = (Texture2D) display.getAssetManager().loadTexture(key); return new ImageImpl(texture.getImage()); }
public void cleanup() { if (viewPort != null) { //reset the viewport camera viewport to its initial value viewPort.getCamera().resize(originalWidth, originalHeight, true); viewPort.getCamera().setViewPort(left, right, bottom, top); viewPort.setOutputFrameBuffer(outputBuffer); viewPort = null; if(renderFrameBuffer != null){ renderFrameBuffer.dispose(); } if(depthTexture!=null){ depthTexture.getImage().dispose(); } filterTexture.getImage().dispose(); if(renderFrameBufferMS != null){ renderFrameBufferMS.dispose(); } for (Filter filter : filters.getArray()) { filter.cleanup(renderer); } } }
public RenderImageJme(String filename, boolean linear, NiftyJmeDisplay display){ TextureKey key = new TextureKey(filename, true); key.setAnisotropy(0); key.setGenerateMips(false); texture = (Texture2D) display.getAssetManager().loadTexture(key); texture.setMagFilter(linear ? MagFilter.Bilinear : MagFilter.Nearest); texture.setMinFilter(linear ? MinFilter.BilinearNoMipMaps : MinFilter.NearestNoMipMaps); image = texture.getImage(); width = image.getWidth(); height = image.getHeight(); }