Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: glTexSubImage2D, Leopard



CC'ed back to the list so if anybody else wants to comment they can.

On 30 May 2008, at 14:25, heimo.mueller wrote:
What format is your texture defined as (i.e. the internal format in the original glTexImage2D). Are they float textures or straight 8 bit components?

It is also definded as float. We use the float texture, as our buffer in main memory anyhow has to hold float values, as two images are blended by mask channel.


			glTexImage2D(GL_TEXTURE_2D,
						 0,
						 GL_ALPHA,
						 TILESIZE,
						 TILESIZE,
						 0,
						 GL_ALPHA,
						 GL_FLOAT,
						 tempbufferalpha);
		}

Ok, this specifies that the data you're passing in is a single alpha channel, and it's floats.


It doesn't say "make this a floating point texture". OpenGL will convert it to whatever the most convenient internal format will be. That's most likely 8-bits. I believe what you might be seeing is a bug in this float to byte conversion that OpenGL is doing for you.

Does the height parameter really make a difference? You description would suggest no, but your comments say yes.
Do you see the same on the left side if you change the offset?


if we use odd image height it works, only at some even values the effect apears. The artefact is always at the rigt side (end of teh line)

That's very odd and I don't understand it.

If you are using 8-bit textures, then I wonder if you might have more luck if your texture data was passed as 8-bit values rather than floats. If that works I think you've found a bug. (glTexSubImage updating 32-bit value based on input format rather than texture format)

You are using 8-bit textures, so I would suggest trying this. It probably means writing a little routine to take a buffer of floats and transform it into bytes, but that's simple enough.


It is also strange, that the same code works fne on Tiger and on Windows systems.

I think you've possibly found a bug, and so I'd report it <http://bugreporter.apple.com/ >, but my suggestions for supplying 8-bit data were meant as a possible work around. I've tried to reproduce the problem given your description, but I've been unable to. That's on my 2006 iMac with a ATIX1600. It is likely to be graphics hardware dependent.


Before you do report it, I think it's always worth running your application through OpenGL Profiler with 'Break On Error' selected in the breakpoints window. This should make sure you haven't got any silly bugs in your code that you've missed.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden


This email sent to email@hidden
References: 
 >glTexSubImage2D, Leopard (From: loMadi <email@hidden>)
 >Re: glTexSubImage2D, Leopard (From: Paul Sargent <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.