www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: ErDetEnAnd? on May 08, 2008, 06:55:19 pm

Title: Renderer feature
Post by: ErDetEnAnd? on May 08, 2008, 06:55:19 pm
Hello.

I need to solve a problem where two objects have (partial) identical plane coordinates. Imagine two boxes with same size and position but different textures. This causes flicker once transforming the objects together. Before I go to dramatic changes I'd like to know if jPCT is capable of prior the rendering of one object, by defining which object to appear.

Regards
Ducky
Title: Re: Renderer feature
Post by: Melssj5 on May 08, 2008, 07:12:32 pm
No, that is called Z fight or something like that. The 2 objects has a face on the same plane so jpct will try to render both. what you can do is moving ons of the a little back or something.
Title: Re: Renderer feature
Post by: ErDetEnAnd? on May 08, 2008, 07:37:46 pm
Thx for your answer. It led me to "polygon offset":

Quote
Polygon offset was an extension to OpenGL 1.0, and is now incorporated into OpenGL 1.1. It allows an application to define a depth offset, which can apply to filled primitives, and under OpenGL 1.1, it can be separately enabled or disabled depending on whether the primitives are rendered in fill, line, or point mode. Thus, an application can render coplanar primitives by first rendering one primitive, then by applying an offset and rendering the second primitive.

Whole article:
http://www.opengl.org/resources/faq/technical/polygonoffset.htm (http://www.opengl.org/resources/faq/technical/polygonoffset.htm)

Is this feature supported by jPCT in any software renderer? - I guess its available using its OpenGL renderer?
Title: Re: Renderer feature
Post by: EgonOlsen on May 08, 2008, 07:51:24 pm
Neither of the renderers support this. While it's a feature of OpenGL 1.1 and higher, support for it on current hardware isn't satisfying. I tried using it in the shadow mapping process, but it caused the pipeline to fall back to emulation mode on some cards...it was too slow to be usable. It's better to offset the models in world space instead of faking the offset afterwards.