Re: Image size

New Message Reply Date view Thread view Subject view Author view

Angus Dorbie (dorbie++at++sgi.com)
Mon, 12 Jul 1999 14:29:09 -0700


Looks like there's some kind of bug in the resize, the data has lost a
pixel in width before download and OpenGL is assuming that the data is 1
pixel larger than the packed array holds so each line moves right a
pixel. Exactly where this happens is difficult to say but you have the
classic symptom of this.

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/


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Jul 12 1999 - 14:29:13 PDT

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