values for glPolygonOffset

Posts: 40
Joined: 2009.05
Post: #1
Hi All,

I'm using GL_POLYGON_OFFSET_FILL to get an effect in my game. I'm drawing lines on top of polygons and want the lines to show up properly.

It seems that this behaves differently on various devices...

On the iPhone devices 3GS and 4.0 and some Android devices using


Works fine.

On Palm and the Motorola droid using



Are there any OpengGL attributes I can query that will give me a hint as to what numbers to use in the glPolygonOffset call?

I've checked the values coming back from GL_DEPTH_RANGE and they are always 0,1.

Is there anything else I can check? Is glPolygonOffset a device specific thing?

Looks like as a workaround I can use this:

#define EDGE_OFFSET 0.00001

glDepthRange(EDGE_OFFSET, 1.0);
/* draw all non-edge geometry */

glDepthRange(0.0, 1.0 - EDGE_OFFSET);
/* draw all edges */
Quote this message in a reply
Posts: 1,482
Joined: 2002.09
Post: #2
I seem to remember polygon offsets are one of those features that people tend to shy away from because the values are implementation defined.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  binding handmade texture with alpha values kampfgnu 4 2,723 Mar 21, 2009 02:16 PM
Last Post: kampfgnu