Author Topic: Software Renderer Precision  (Read 2397 times)

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Software Renderer Precision
« on: May 19, 2014, 10:18:01 am »
I assume, without having tried it, that this problem wouldn't happen with the OpenGL renderer (it doesn't in Unity). Is there a way to increase the software renderer's precision when rendering these field lines (that obviously aren't textured, but modeled).


Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Software Renderer Precision
« Reply #1 on: May 19, 2014, 01:46:50 pm »
No, there isn't. The software renderer is actually pretty accurate but it has to rely on linear interpolation between subspans where the hardware can work per pixel. That makes the hardware more accurate...in most cases. But if the software renderer shows these artifacts, it's most likely that some gpu out there will have similar problems too.. Either move the lines away from the terrain until it works fine or, and maybe better, separate the terrain and the lines into two world instances and render with clearing the depth buffer in between.

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Software Renderer Precision
« Reply #2 on: May 19, 2014, 09:11:05 pm »
Is the second World (technically third, since I have a Skybox) going to cost memory and/or processing?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Software Renderer Precision
« Reply #3 on: May 19, 2014, 10:01:21 pm »
No, it's cheap. Apart from the additional depth buffer clear, there's no real overhead.

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Software Renderer Precision
« Reply #4 on: May 19, 2014, 10:06:24 pm »
Cool, thanks a lot.

Offline AGP

  • quad
  • ******
  • Posts: 1726
    • View Profile
Re: Software Renderer Precision
« Reply #5 on: May 19, 2014, 11:06:20 pm »
Is this what you mean?

Code: [Select]
     buffer.clear(Color.red);
     skybox.render(theWorld, buffer);
     theWorld.renderScene(buffer);
     buffer.clearZBufferOnly();
     fieldLinesWorld.renderScene(buffer);
     theWorld.draw(buffer);
     buffer.display(this.getGraphics());

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Software Renderer Precision
« Reply #6 on: May 19, 2014, 11:22:25 pm »
Depends on the rest of the scene. I would rather move the around into a world and players and lines into the other. Otherwise, the lines will override the player objects.