本文整理汇总了Java中com.jme3.renderer.queue.RenderQueue.isQueueEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java RenderQueue.isQueueEmpty方法的具体用法?Java RenderQueue.isQueueEmpty怎么用?Java RenderQueue.isQueueEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.renderer.queue.RenderQueue
的用法示例。
在下文中一共展示了RenderQueue.isQueueEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderViewPortQueues
import com.jme3.renderer.queue.RenderQueue; //导入方法依赖的package包/类
/**
* Render the given viewport queues.
* <p>
* Changes the {@link Renderer#setDepthRange(float, float) depth range}
* appropriately as expected by each queue and then calls
* {@link RenderQueue#renderQueue(com.jme3.renderer.queue.RenderQueue.Bucket, com.jme3.renderer.RenderManager, com.jme3.renderer.Camera, boolean) }
* on the queue. Makes sure to restore the depth range to [0, 1]
* at the end of the call.
* Note that the {@link Bucket#Translucent translucent bucket} is NOT
* rendered by this method. Instead the user should call
* {@link #renderTranslucentQueue(com.jme3.renderer.ViewPort) }
* after this call.
*
* @param vp the viewport of which queue should be rendered
* @param flush If true, the queues will be cleared after
* rendering.
*
* @see RenderQueue
* @see #renderTranslucentQueue(com.jme3.renderer.ViewPort)
*/
public void renderViewPortQueues(ViewPort vp, boolean flush) {
RenderQueue rq = vp.getQueue();
Camera cam = vp.getCamera();
boolean depthRangeChanged = false;
// render opaque objects with default depth range
// opaque objects are sorted front-to-back, reducing overdraw
rq.renderQueue(Bucket.Opaque, this, cam, flush);
// render the sky, with depth range set to the farthest
if (!rq.isQueueEmpty(Bucket.Sky)) {
renderer.setDepthRange(1, 1);
rq.renderQueue(Bucket.Sky, this, cam, flush);
depthRangeChanged = true;
}
// transparent objects are last because they require blending with the
// rest of the scene's objects. Consequently, they are sorted
// back-to-front.
if (!rq.isQueueEmpty(Bucket.Transparent)) {
if (depthRangeChanged) {
renderer.setDepthRange(0, 1);
depthRangeChanged = false;
}
rq.renderQueue(Bucket.Transparent, this, cam, flush);
}
if (!rq.isQueueEmpty(Bucket.Gui)) {
renderer.setDepthRange(0, 0);
setCamera(cam, true);
rq.renderQueue(Bucket.Gui, this, cam, flush);
setCamera(cam, false);
depthRangeChanged = true;
}
// restore range to default
if (depthRangeChanged) {
renderer.setDepthRange(0, 1);
}
}
示例2: renderTranslucentQueue
import com.jme3.renderer.queue.RenderQueue; //导入方法依赖的package包/类
/**
* Renders the {@link Bucket#Translucent translucent queue} on the viewPort.
* <p>
* This call does nothing unless {@link #setHandleTranslucentBucket(boolean) }
* is set to true. This method clears the translucent queue after rendering
* it.
*
* @param vp The viewport of which the translucent queue should be rendered.
*
* @see #renderViewPortQueues(com.jme3.renderer.ViewPort, boolean)
* @see #setHandleTranslucentBucket(boolean)
*/
public void renderTranslucentQueue(ViewPort vp) {
RenderQueue rq = vp.getQueue();
if (!rq.isQueueEmpty(Bucket.Translucent) && handleTranlucentBucket) {
rq.renderQueue(Bucket.Translucent, this, vp.getCamera(), true);
}
}