Author Topic: Software & Hardware  (Read 2073 times)

Offline nailian

  • byte
  • *
  • Posts: 5
    • View Profile
Software & Hardware
« on: January 19, 2010, 11:56:41 am »
Is it possible to do 2 renderings at the same time?

Drawing 2 different Framebuffers. One with Hardware and one with software rendering?
« Last Edit: January 19, 2010, 01:11:25 pm by nailian »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Software & Hardware
« Reply #1 on: January 19, 2010, 04:56:02 pm »
Yes, you can either draw the world multiple times into different frame buffers or enable the OpenGL renderer without disabling the software one. That way, the scene should be rendered using both renderers and because the target is different (image buffer for software, a native window or a canvas for OpenGL), this can be done with one buffer....in theory. In practice, i've never tried this in the last few years. However, support for doing it should still be in.
Anyway, you have to consider some things when using either way: The performance of the OpenGL renderer will suffer, because it will be limited by software renderer's performance. And you may run into problems when using compile() on objects that should be rendered with the software renderer.
May i ask what the purpose is?

Offline nailian

  • byte
  • *
  • Posts: 5
    • View Profile
Re: Software & Hardware
« Reply #2 on: January 20, 2010, 10:53:43 am »
I needed to draw 2 worlds at the same time. And that did not work, so i assumend it would work if i used hardware and software rendering at the same time.

Java console gave me a facepalm...  >:(

I solved it somehow by drawing one world at a time using both hardware rendering.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Software & Hardware
« Reply #3 on: January 20, 2010, 11:15:54 am »
I'm not sure, if i got this right: Two worlds into ONE buffer or two worlds into TWO buffers?

Offline nailian

  • byte
  • *
  • Posts: 5
    • View Profile
Re: Software & Hardware
« Reply #4 on: January 20, 2010, 03:18:06 pm »
Two worlds into two buffers.

Now im getting this if i rotate the camera:




And im clearing my buffer.

Thnx in advance  :)




Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Software & Hardware
« Reply #5 on: January 20, 2010, 04:31:51 pm »
It shouldn't be a problem to do this. Worlds and buffers should be independent from each each and their counterparts. Can you post the part of your code that does the clearing/rendering?

Offline nailian

  • byte
  • *
  • Posts: 5
    • View Profile
Re: Software & Hardware
« Reply #6 on: January 20, 2010, 04:57:16 pm »
Just found the cause of my rendering problem.

I narrowed it done by disabeling the config settings one by one.
And it seems that setting the indoor property to true was causing this for me.


Code: [Select]
private void doConfig()
{

Config.maxPolysVisible = 64000;
Config.saveMemory = true;
Config.collideOffset = 500;
Config.glTrilinear = true;
Config.farPlane = 10000;
//Config.isIndoor = true; <---------------------------
Config.glVertexArrays = true;
Config.tuneForIndoor();
Config.zTrick = true;
Config.glShadowZBias = 0.8f;
Config.lightMul = 1;

}

Thnx for your replys!  :)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Software & Hardware
« Reply #7 on: January 20, 2010, 05:25:44 pm »
Yes. That's why the docs say: "Enables some optimizations for indoor scenes (like not clearing the framebuffer for every frame). Should be enabled if indoor rendering is performed.".. ;)

Offline nailian

  • byte
  • *
  • Posts: 5
    • View Profile
Re: Software & Hardware
« Reply #8 on: January 20, 2010, 08:42:52 pm »
I am new to this learning every day. thnx for your fast replys !!