Imagination PowerVR SDK Blog

user defined clip plane


#1

hi all…

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!




#2

thank you… I’m sure that would be very helpful to someone living in Sacramento :>). 



#3

I’m not so sure that it would have been to be honest, but I’ve deleted the spam :slight_smile:



#4

Hi wrabbit,

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.




#5

Thanks Joe… this http://hacksoflife.blogspot.com/2008/12/every-now-and-then-i-come-across.html was also helpful.