PDA

View Full Version : How to Draw Pixel with XOR OR AND...



Suvcon
01-13-2002, 10:31 PM
Yes,I mean that..draw a pixel to the buffer and do some xor,or,and operations with the same position pixel in the buffer.

I have a pixel Color3f(1.0f,0.5f,0.0f) to draw into(mybe should speak as "onto",or "at"?God damn,my first language isn't english, http://www.opengl.org/discussion_boards/ubb/smile.gif..)position Vertex2f(0.0f,0.0f).and the pixel in the buffer which is at Vertex2f(0.0f,0.0f) is unknow,I do not want read it and use it,i just need use the new pixel do some bit-operation,XOR,AND,OR...

maybe i can use glReadPixel(),but read from buffer is a slow slow slow job,even slow than read form system memory,How can I crazy to do this on the 4X APG graphy card,just as i install a russian truck engine into my BlueBird ?!!!

any body have any idea about this?(mean to the programme,not the car engine http://www.opengl.org/discussion_boards/ubb/smile.gif))

dorbie
01-13-2002, 11:12 PM
How about this:
http://www.opengl.org/developers/documen...ic+op#first_hit (http://www.opengl.org/developers/documentation/Version1.2/EXTspecs/blend_logic_op.txt?blend+logic+op#first_hit)

I don't see it in the blend equation specs for one vendor I checked though, but at least you know what to look for though.

blendxor.c here will be of interest to you:
http://web.mit.edu/afs/athena/system/sgi_53/os/usr/share/src/OpenGL/samples/EXT/

mcraighead
01-15-2002, 03:36 AM
COLOR_LOGIC_OP is a core GL 1.1 feature.

- Matt

NitroGL
01-15-2002, 08:06 AM
Originally posted by mcraighead:
COLOR_LOGIC_OP is a core GL 1.1 feature.

- Matt

...But is only accelerated on only a handful of cards.

mcraighead
01-15-2002, 09:25 PM
Well, I didn't say anything about acceleration and/or performance, did I. http://www.opengl.org/discussion_boards/ubb/smile.gif (It _is_ accelerated, however, on Quadro2 and GF3.)

dorbie was referring to the old OGL 1.0 extension mechanism for color logic op, which is pretty much ancient history now...

To be honest, I don't know why it was changed. I think the BlendEquation way of doing it is a bit cleaner; it expresses more directly the fact that color logic op and blending are mutually exclusive. But it is what it is, and it's ancient history, so it might as well stay how it is.

- Matt