Re: pfTexture::subload

New Message Reply Date view Thread view Subject view Author view

From: Angus Dorbie (dorbie++at++sgi.com)
Date: 08/31/2000 14:14:19


OK, just stick with the subload call
xsrc = 0
ysrc = 0
srcwid = 760
xdst = 0
ydst = 0
xsize = 760
ysize = 486

Satheesh Ganapathi Subramanian wrote:
>
> Hi Angus,
>
> Thanks for your detailed explanation. But I've been having some problems
> trying to get the
>
> I tried doing a subload with this understanding. My destination texture
> has a dummy data filled with all blue (1024x512). My subload is dummy data
> with all white (760x486). When I do a subload, what I expected was that
> the portion of the texture that was subloaded would be white and the rest
> of it would be blue. What I got instead was that the portion of the
> texture that was subloaded was white but the rest of the texture was
> having corrupt data. I couldn't figure out why that was happening.
>
> Also, I've another question. What is the difference between using
> pfTexture::subload() and using pfTexture::setLoadImage() inconjunction
> with setLoadOrigin() and setLoadSize() with the texture format enabled for
> PFTEX_SUBLOAD_FORMAT and PFTEX_BASE_AUTO_SUBLOAD. I tried both the
> approaches and the result was exactly the same as described above.
>
> Again, if there is some sample code that can illustrate the use of
> pfTexture::subload() it would be of great help.
>
> Thanks
> Satheesh
>
> >The key thing to note here is that the source image may be a different
> >size form the destination image. In addition the image being subloaded
> >may not occupy the full width of the source image and may not be
> >positioned at the origin of the source image.
> >
> >If you consider this problem it becomes clear that you need to specify
> >the location of the subload in the destination image, the overall width
> >of the source image and the width and height of the subload from the
> >source image, and the position of the origin of the subload in the
> >source image.
> >
> >The height of the source image isn't needed because the image is stored
> >column minor, row major in OpenGL, but in order to properly address
> >height you need to know the image width for the stored source image
> >unless you are subloading a full width image in which case xsize is all
> >you need.
> >
> >So, srcwid is needed to support source images of widths which do not
> >match the width of the image in texture memory, xsrc and ysrc is the
> >origin of the download in the source image (which doesn't have to be the
> >same as the origin in the destination image).
> >
> >There is a degree of redundancy because an application could simply
> >adjust the pointer to address the appropriate pixel of the source image
> >and zero the xsrc and ysrc values, but that's more tricky for the
> >application to code for I suppose.
> >
> >Strictly speaking the manual description is wrong w.r.t. srcwidth.
> >
> >Cheers,Angus.
> >
> >Satheesh Ganapathi Subramanian wrote:
> >>
> >> Hi Performers,
> >>
> >> I'm trying to use pfTexture::subload or pfSubLoadTex and I'm not able to
> >> understand the meaning of - srcwidth, xsrc, ysrc - in the list of
> >> paramenters to that function. I'm creating an image buffer (unsigned
> >> int*), the data in which keeps changing every frame. I would like to load
> >> this into texture memory using pfTexture::subload. It would be great if
> >> someone can tell me what each parameter of the function call means. I'm
> >> not able to get much out of the man pages.
> >>
> >> If anyone has some sample code that they can share, explaining how to use
> >> this function, it would be of immense use.
> >>
> >> Thanks
> >> Satheesh
> >>
> >> -----------------------------------------------------------------------
> >> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> >> Submissions: info-performer++at++sgi.com
> >> Admin. requests: info-performer-request++at++sgi.com
> >
> >--
> >For Performer+OpenGL tutorials http://www.dorbie.com/
> >
> >"In the middle of difficulty lies opportunity."
> > --Albert Einstein
> >
>
> ===================== members.xoom.com/malargal ========================
>
> Satheesh GanapathiSubramanian
> gsat++at++evl.uic.edu
> Work: Home:
> Research Assistant 901, S.Ashland Av, Apt# 107-A
> The Electronic Visualization Laboratory Chicago, IL-60607
> 851, S.Morgan St., Room# 1120 SEO
> University of Illinois at Chicago Ph: 312-492-8164
> Chicago,IL-60607
> Ph: 312-996-3002
> Fax: 312-413-7585
> =========================================================================
>
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com

-- 
For Performer+OpenGL tutorials http://www.dorbie.com/

"In the middle of difficulty lies opportunity." --Albert Einstein


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Thu Aug 31 2000 - 14:14:38 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.