本文整理了Java中com.jme3.texture.FrameBuffer.addColorTexture()
方法的一些代码示例,展示了FrameBuffer.addColorTexture()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FrameBuffer.addColorTexture()
方法的具体详情如下:
包路径:com.jme3.texture.FrameBuffer
类名称:FrameBuffer
方法名:addColorTexture
[英]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 gl_FragData
. If MRT is not enabled, then the index set with FrameBuffer#setTargetIndex(int)is rendered to by the shader.
[中]添加用于此帧缓冲区的颜色纹理。如果启用MRT,则可以通过写入阵列gl_FragData
的着色器渲染随后添加的每个纹理。如果未启用MRT,则着色器将渲染具有帧缓冲区#setTargetIndex(int)的索引集。
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
/**
* Set the color texture to use for this framebuffer.
* This automatically clears all existing textures added previously
* with {@link FrameBuffer#addColorTexture } and adds this texture as the
* only target.
*
* @param tex The cube-map texture to set.
* @param face The face of the cube-map to render to.
*/
public void setColorTexture(TextureCubeMap tex, TextureCubeMap.Face face) {
clearColorTargets();
addColorTexture(tex, face);
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
/**
* Set the color texture to use for this framebuffer.
* This automatically clears all existing textures added previously
* with {@link FrameBuffer#addColorTexture } and adds this texture as the
* only target.
*
* @param tex The color texture to set.
*/
public void setColorTexture(Texture2D tex){
clearColorTargets();
addColorTexture(tex);
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
/**
* Set the color texture array to use for this framebuffer.
* This automatically clears all existing textures added previously
* with {@link FrameBuffer#addColorTexture } and adds this texture as the
* only target.
*
* @param tex The color texture array to set.
*/
public void setColorTexture(TextureArray tex, int layer){
clearColorTargets();
addColorTexture(tex, layer);
}
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
offBuffer.addColorTexture(offTex, TextureCubeMap.Face.NegativeX);
offBuffer.addColorTexture(offTex, TextureCubeMap.Face.PositiveX);
offBuffer.addColorTexture(offTex, TextureCubeMap.Face.NegativeY);
offBuffer.addColorTexture(offTex, TextureCubeMap.Face.PositiveY);
offBuffer.addColorTexture(offTex, TextureCubeMap.Face.NegativeZ);
offBuffer.addColorTexture(offTex, TextureCubeMap.Face.PositiveZ);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
fb.addColorTexture(diffuseData);
fb.addColorTexture(normalData);
fb.addColorTexture(specularData);
fb.setMultiTarget(true);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
public void simpleInitApp() {
this.flyCam.setMoveSpeed(10);
cam.setLocation(new Vector3f(0.028406568f, 2.015769f, 7.386517f));
cam.setRotation(new Quaternion(-1.0729783E-5f, 0.9999721f, -0.0073241726f, -0.0014647911f));
makeScene();
//Creating the main view port post processor
FilterPostProcessor fpp = new FilterPostProcessor(assetManager);
fpp.addFilter(new ColorOverlayFilter(ColorRGBA.Blue));
viewPort.addProcessor(fpp);
//creating a frame buffer for the mainviewport
FrameBuffer mainVPFrameBuffer = new FrameBuffer(cam.getWidth(), cam.getHeight(), 1);
Texture2D mainVPTexture = new Texture2D(cam.getWidth(), cam.getHeight(), Image.Format.RGBA8);
mainVPFrameBuffer.addColorTexture(mainVPTexture);
mainVPFrameBuffer.setDepthBuffer(Image.Format.Depth);
viewPort.setOutputFrameBuffer(mainVPFrameBuffer);
//creating the post processor for the gui viewport
final FilterPostProcessor guifpp = new FilterPostProcessor(assetManager);
guifpp.setFrameBufferFormat(Image.Format.RGBA8);
guifpp.addFilter(new ColorOverlayFilter(ColorRGBA.Red));
//this will compose the main viewport texture with the guiviewport back buffer.
//Note that you can switch the order of the filters so that guiviewport filters are applied or not to the main viewport texture
guifpp.addFilter(new ComposeFilter(mainVPTexture));
guiViewPort.addProcessor(guifpp);
//compositing is done by mixing texture depending on the alpha channel,
//it's important that the guiviewport clear color alpha value is set to 0
guiViewPort.setBackgroundColor(ColorRGBA.BlackNoAlpha);
guiViewPort.setClearColor(true);
}
代码示例来源:origin: info.projectkyoto/mms-engine
/**
* Set the color texture to use for this framebuffer.
* This automatically clears all existing textures added previously
* with {@link FrameBuffer#addColorTexture(com.jme3.texture.Texture2D) }
* and adds this texture as the only target.
*
* @param tex The color texture to set.
*/
public void setColorTexture(Texture2D tex){
clearColorTargets();
addColorTexture(tex);
}
代码示例来源:origin: org.jmonkeyengine/jme3-core
/**
* Set the color texture to use for this framebuffer.
* This automatically clears all existing textures added previously
* with {@link FrameBuffer#addColorTexture } and adds this texture as the
* only target.
*
* @param tex The color texture to set.
*/
public void setColorTexture(Texture2D tex){
clearColorTargets();
addColorTexture(tex);
}
代码示例来源:origin: org.jmonkeyengine/jme3-core
/**
* Set the color texture to use for this framebuffer.
* This automatically clears all existing textures added previously
* with {@link FrameBuffer#addColorTexture } and adds this texture as the
* only target.
*
* @param tex The cube-map texture to set.
* @param face The face of the cube-map to render to.
*/
public void setColorTexture(TextureCubeMap tex, TextureCubeMap.Face face) {
clearColorTargets();
addColorTexture(tex, face);
}
代码示例来源:origin: org.jmonkeyengine/jme3-core
/**
* Set the color texture array to use for this framebuffer.
* This automatically clears all existing textures added previously
* with {@link FrameBuffer#addColorTexture } and adds this texture as the
* only target.
*
* @param tex The color texture array to set.
*/
public void setColorTexture(TextureArray tex, int layer){
clearColorTargets();
addColorTexture(tex, layer);
}
内容来源于网络,如有侵权,请联系作者删除!