Re: [Pipmak-Users] Patch rotation proposal
Status: Alpha
Brought to you by:
cwalther
From: Christian W. <cwa...@gm...> - 2007-05-20 14:52:08
|
Andrea Viarengo wrote: > Yes, you are on right about patch rotation that isn't very simple > to use... OK, how about this: - We introduce another pair of parameters, "anchorx" and "anchory", that specify, in patch pixels, a point on the patch. By default, they will be set to (0, 0), i.e. the top left corner of the image. This anchor point will be placed at (x, y) or (nx, ny, nz) and will be the center of rotation. - nw specifies the visible width of the patch, which is one pixel smaller than its image width (w) due to the half pixel cut off each side for interpolation. Likewise for nh. So, to make a patch coincide with a cube face (assuming it has the same image size), you would specify anchorx = anchory = 0.5 and nw = nh = 2. To rotate a patch around its center, set anchorx and anchory to half its width and height. Everything should also work on slides and panels if we specify that normalized coordinates are equal to pixel coordinates there (that's actually what happens internally, as of revision 152). > About patches, > I've notice that if you place a patch across two faces, or better, > you place a patch that goes beyond the edge of the face > (i.e. face is 640x640, and you put a patch 100x100 at x=600) > the part of the patch that fall in another face is cut in a > randomly way, and it varies based on the azimuth angle of the view. > > Is this an intentional behavior? In a way, yes. You weren't supposed to make patches that extend beyond their face up to now. What happens is that parts of the patch fall behind the camera's far clipping plane, which lies just outside of the cube. This will change, because for arbitrary patch placement, this plane needs to be moved farther away anyway. > Or it would not be better crop the part of the patch > that it exceeds the edge of the face? That wouldn't work too well with the arbitrary placement stuff we're discussing, would it? Being able to place patches outside of the cube is basically the whole point... > If I put a lot of patches (beyond 800), I've notice, in slower computer, > that the rotation around the azimuth angle, sometime it goes in jerks. > > You think that I could reduce jerks if I reduce the dimensions (in bytes) > of the patches? Or 800 patches is really too-many patches? There are certainly some things that could be optimized in Pipmak in this regard - I just never did it because for normal cases the performance always seemed good enough to me. Honestly, at this time 800 patches is not what I see as the primary use case of Pipmak that I'd spend a lot of optimization effort on. Unless your 800 patches all use different images, so that you fill up video memory and the OpenGL renderer starts paging them out to main memory, I wouldn't expect reducing the size to make a difference. Of course, it's hard to tell where the performance bottleneck is without doing any actual profiling. -Christian |