- December 10, 2011 at 3:34 am #30707
Apologies if this is a FAQ, but i would like to know the fastest way to implement a user-defined clip plane for the PowerVR SGX. The Water demo (https://www.imgtec.com/powervr/insider/docs/POWERVR.Shader%20Based%20Water%20Effects.1.11f.OGLES2External.pdf section 3.1) uses a technique which appears to be the same as one documented by Eric Lengyel (http://www.terathon.com/lengyel/Lengyel-Oblique.pdf), but the OpenGL ES 2 spec recommends:
User clip planes can be emulated by calculating the dot product of the user clip plane with the vertex position in eye space in the vertex shader
The second method seems simpler, and more likely to be portable. Is the Water demo mechanism significantly faster? I’ll be digging into this shortly, but just wondered if anyone had experience with this.
thanks!December 12, 2011 at 8:04 am #35302
thank you.. I’m sure that would be very helpful to someone living in Sacramento :>).December 12, 2011 at 8:42 am #35303
I’m not so sure that it would have been to be honest, but I’ve deleted the spam 🙂December 12, 2011 at 9:59 am #35304
The Water demo is implemented in that way because it only requires a single matrix calculation that can be applied to all objects in the render pass. Doing a per-vertex calculation would increase the number of cycles each vertex shader would take to execute, and it would also mean you would have to update each and every vertex shader in your application with this change.
Both techniques are equally portable.December 13, 2011 at 6:06 pm #35305
Thanks Joe.. this http://hacksoflife.blogspot.com/2008/12/every-now-and-then-i-come-across.html was also helpful.