Only thing rendered is the SkyBox

Started by AGP, June 11, 2017, 02:11:43 AM

Previous topic - Next topic

AGP

In onDrawFrame at buffer.setRenderTarget(target1);

Everything is initialized properly (and it's not a NullPointerException).

EgonOlsen

That doesn't really help. I need the complete render sequence for all buffers and the final render to the screen.

AGP

It's just like yours:


    public void onDrawFrame(GL10 gl) {
        activity.loopIteration();
        if (this.hasToCreateBuffer) {
            hasToCreateBuffer = false;
            activity.buffer = new FrameBuffer(w, h);
        }
        activity.buffer.clear(Color.BLUE);
        skyBox.render(activity.theWorld, activity.buffer);

        // Render into first target
        activity.buffer.setRenderTarget(activity.target1);
        activity.buffer.clear(RGBColor.BLUE);
        activity.theWorld.getCamera().moveCamera(Camera.CAMERA_MOVERIGHT, -5);
        activity.theWorld.renderScene(activity.buffer);
        activity.theWorld.draw(activity.buffer);
        activity.buffer.display();
        activity.theWorld.getCamera().moveCamera(Camera.CAMERA_MOVERIGHT, 5);
        activity.buffer.removeRenderTarget();
        // Render into second target
        activity.buffer.setRenderTarget(activity.target2);
        activity.buffer.clear(RGBColor.BLUE);
        activity.theWorld.getCamera().moveCamera(Camera.CAMERA_MOVERIGHT, 5);
        activity.theWorld.renderScene(activity.buffer);
        activity.theWorld.draw(activity.buffer);
        activity.buffer.display();
        activity.theWorld.getCamera().moveCamera(Camera.CAMERA_MOVERIGHT, -5);
        activity.buffer.removeRenderTarget();

        activity.theWorld.renderScene(activity.buffer);
        activity.theWorld.draw(activity.buffer);
        activity.buffer.blit(activity.target1, 0, 0, 0, activity.buffer.getHeight(), activity.target1.getWidth(), activity.target1.getHeight(), activity.buffer.getWidth() / 2, -activity.buffer.getHeight(), -1, false);
        activity.buffer.blit(activity.target2, 0, 0, activity.buffer.getWidth() / 2, activity.buffer.getHeight(), activity.target1.getWidth(), activity.target1.getHeight(), activity.buffer.getWidth() / 2, -activity.buffer.getHeight(), -1, false);
        activity.buffer.display();
     }

EgonOlsen

Have you tried to remove the skybox render call? It doesn't do anything useful at this stage, because you'll blit over it anyway...!?

AGP

I did just now (I moved it below the blits and just before the actual renderScene and draw calls). Still crashes on setRenderTarget(target1).

EgonOlsen

Still...no idea. Can you provide me with a compilable test case?

AGP

I can't because I have the world's first self-healing code. I'm getting the two views now. But the SkyBox doesn't work. Any chance you could have a look at it  for me? Just add a SkyBox to your example and see it not appear at all. Also, any chance for a FrameBuffer3D for simplifying this?

EgonOlsen

I'll try. In any case, you have to do the skybox for both views. I don't think that I'll do a FrameBuffer3D, but I'll think about it.

AGP

Please do think about it.

Have you checked Skybox?

EgonOlsen

No, sorry. I didn't have the time. I'll try during the weekend...

AGP

Got the SkyBox working for the individual textures. ; )

Still think a FrameBuffer3D is pertinent (clean and safe, and all-too-useful).