Angus Dorbie (dorbie++at++sgi.com)
Mon, 12 Jul 1999 14:34:12 -0700
Cheers,Angus.
Prakash Mahesh wrote:
>
>
> We are using IFL to load an image into Performer, for
> texture mapping
> onto objects... Because Performer requires all textures to
> have
> dimensions that are powers of 2, I'm trying to scale the
> image using the
> gluScaleImage() call...
>
> However, we are having trouble because sometimes the image
> ends up
> distorted (see example at
> http://www.openworlds.com/scaling.rgb )... In
> this example, we are texture mapping the following images:
>
> toosmall.rgb (upper left - color and texel distortion):
> orig. dimensions: 230x220 (3 components)
> new dimensions: 256x256 (3 components)
>
> os_headside.rgb (upper right - looks correct):
> orig. dimensions: 256x256 (3 components)
> new dimensions: 256x256 (3 components)
>
> toobig.rgb (lower left - looks correct):
> orig. dimensions: 300x280 (3 components)
> new dimensions: 256x256 (3 components)
>
> os_headside.jpg (lower right - texel distortion):
> orig. dimensions: 235x256 (3 components)
> new dimensions: 256x256 (3 components)
>
> We think that the problem may be because Performer expects
> texel rows to
> be aligned on long word boundaries, so I also added calls
> to
> glPixelStore right before the image gets scaled:
>
>
> glPixelStorei(GL_PACK_ALIGNMENT, 8);
> glPixelStorei(GL_PACK_ROW_LENGTH, newwidth);
> gluScaleImage(format, width, height, GL_UNSIGNED_BYTE,
> image_buffer,
> newwidth, newheight, GL_UNSIGNED_BYTE,
> scaled_buffer);
>
>
> Please let me know what we are doing wrong... Thanks!
>
> --
> Prakash Mahesh
> prakash++at++drawcomp.com
> --or--
> prakash++at++openworlds.com
>
>
-- For years now, whenever NT has been proven to have some debilitating weakness we've heard from MS advocates that NT would catch up, there was just an incredible faith in this OS and Microsoft's ability to somehow get there. With the recent results of the Linux vs NT serving benchmark that same attitude can be seen in the Linux community. The Linux folks aren't too worried, "Sure the single threaded IP stack was slow but it'll be fixed in the next release.", it's eerily familiar but I have confidence in the Linux community's ability to remedy problems and I don't groan in pain as I used to when Microsoft made similar claims.For advanced 3D graphics Performer + OpenGL based examples and tutors: http://www.dorbie.com/
This archive was generated by hypermail 2.0b2 on Mon Jul 12 1999 - 14:34:15 PDT