In Galaxy S, when a depth texture is attached to GL_DEPTH_ATTACHMENT of framebuffer object, and a polygon was drawn to the frame buffer, polygon offset given in glPolygonOffset does not seem to be reflected to the depth texture.
Output by “adb shell cat /proc/pvr/version” is as follows.
Version 18.104.22.16847 (release) smdkc110_android
System Version String: SGX540 S5PC110
This problem may be equal to the following topic.
I checked this phenomenon in the following procedures.
- Specify polygon offset using glPolygonOffset
- Draw the polygon that is screen coordinate Z=0.0 using glDrawArrays
- Confirm a pixel value in depth texture
1.0, 2.0, 4.0, 8.0, …, 1.70141e38 were passed to units argument of glPolygonOffset, and a result for each offset was confirmed. However, all the pixel value obtained from the depth buffer were 0 in Galaxy S.
I made the test application that those values were displayed to a screen after these values were converted into a screen z-coordinate.
In this image, the left upper number is a z-coordinate corresponding to units=1.0, and a number of the lower right is a z-coordinate corresponding to units=1.70141e38. Because all z-coordinates are 0.0, in GalaxyS, it is thought that polygon offset is not reflected at all.
The result with a certain Adreno 205 device was as follows.
In this device, it can be understood that a z-coordinate rises to the place corresponding to units=1024.0.
The source codes of this test application are as follows.
The package which have been built of this application are as follows.