Author Topic: Only thing rendered is the SkyBox  (Read 574 times)

Offline AGP

  • quad
  • ******
  • Posts: 1524
    • View Profile
Re: Only thing rendered is the SkyBox
« Reply #15 on: June 19, 2017, 11:30:54 am »
In onDrawFrame at buffer.setRenderTarget(target1);

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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Only thing rendered is the SkyBox
« Reply #16 on: June 19, 2017, 01:02:09 pm »
That doesn't really help. I need the complete render sequence for all buffers and the final render to the screen.

Offline AGP

  • quad
  • ******
  • Posts: 1524
    • View Profile
Re: Only thing rendered is the SkyBox
« Reply #17 on: June 19, 2017, 10:31:37 pm »
It's just like yours:

Code: [Select]
    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();
     }

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Only thing rendered is the SkyBox
« Reply #18 on: June 19, 2017, 10:55:58 pm »
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...!?

Offline AGP

  • quad
  • ******
  • Posts: 1524
    • View Profile
Re: Only thing rendered is the SkyBox
« Reply #19 on: June 20, 2017, 12:03:26 am »
I did just now (I moved it below the blits and just before the actual renderScene and draw calls). Still crashes on setRenderTarget(target1).

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Only thing rendered is the SkyBox
« Reply #20 on: June 20, 2017, 08:13:18 am »
Still...no idea. Can you provide me with a compilable test case?

Offline AGP

  • quad
  • ******
  • Posts: 1524
    • View Profile
Re: Only thing rendered is the SkyBox
« Reply #21 on: June 22, 2017, 04:13:05 am »
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?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Only thing rendered is the SkyBox
« Reply #22 on: June 22, 2017, 10:54:14 am »
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.

Offline AGP

  • quad
  • ******
  • Posts: 1524
    • View Profile
Re: Only thing rendered is the SkyBox
« Reply #23 on: June 23, 2017, 07:41:41 pm »
Please do think about it.

Have you checked Skybox?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11769
    • View Profile
    • http://www.jpct.net
Re: Only thing rendered is the SkyBox
« Reply #24 on: June 24, 2017, 09:41:50 am »
No, sorry. I didn't have the time. I'll try during the weekend...

Offline AGP

  • quad
  • ******
  • Posts: 1524
    • View Profile
Re: Only thing rendered is the SkyBox
« Reply #25 on: June 25, 2017, 07:26:01 am »
Got the SkyBox working for the individual textures. ; )

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