Software Renderer Precision

Started by AGP, May 19, 2014, 10:18:01 AM

Previous topic - Next topic

AGP

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).


EgonOlsen

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.

AGP

Is the second World (technically third, since I have a Skybox) going to cost memory and/or processing?

EgonOlsen

No, it's cheap. Apart from the additional depth buffer clear, there's no real overhead.

AGP


AGP

Is this what you mean?


     buffer.clear(Color.red);
     skybox.render(theWorld, buffer);
     theWorld.renderScene(buffer);
     buffer.clearZBufferOnly();
     fieldLinesWorld.renderScene(buffer);
     theWorld.draw(buffer);
     buffer.display(this.getGraphics());

EgonOlsen

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.