values for glPolygonOffset
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
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1,1);
Works fine.
On Palm and the Motorola droid using
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(-0.1,0);
Works.
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?
Thanks
Chris.
Looks like as a workaround I can use this:
http://blog.thedailyanvil.com/?p=335
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
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1,1);
Works fine.
On Palm and the Motorola droid using
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(-0.1,0);
Works.
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?
Thanks
Chris.
Looks like as a workaround I can use this:
http://blog.thedailyanvil.com/?p=335
Code:
#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 */
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.
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| binding handmade texture with alpha values | kampfgnu | 4 | 2,246 |
Mar 21, 2009 02:16 PM Last Post: kampfgnu |
|

