簡體   English   中英

libgdx中3d場景背后的繪制階段

[英]Drawing Stage behind 3d scene in libgdx

我試圖在libgdx的3d場景(作為背景)的后面繪制一個舞台(具有視差效果)。 當我打電話stage.draw()之前screen.render()我只能看到3D場景。 當我在stage.draw() screen.render()之前調用stage.draw()我只能看到背景。 有沒有辦法使屏幕以某種方式看穿?

我正在打電話:

stage.act();
stage.draw();
screen.render(delta);

我在屏幕上的render()操作如下所示:

Gdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
modelBatch.begin(mainCamera);
modelBatch.render(instances, environment);
modelBatch.end();

好的,我知道了:
而不是在stage.draw()之前調用stage.act()stage.draw() screen.render()

我只是在之后的render()操作中簡單地調用stage.act()stage.draw()

Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM