Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!rosie!pgraff From: pgraff@next.com (Peter Graffagnino) Newsgroups: comp.graphics Subject: Re: Ray-tracing Message-ID: <1085@rosie.NeXT.COM> Date: 28 Jun 91 21:57:11 GMT References: <1991Jun26.021102.9027@amc.com> Sender: news@NeXT.COM Distribution: na Organization: Next Computer, Inc. Lines: 75 Nntp-Posting-Host: fyn.next.com In article <1991Jun26.021102.9027@amc.com> kenb@polaris.amc.com () writes: >In article <84569@bu.edu> krazykid@bass.bu.edu (Ernest Kim) writes: >>In article <382@bibsyst.UUCP> ingar@bibsyst.UUCP (ingar) writes: >>> >>> I have tried to program a ray tracing program, but now when >>>i almost have finished I have discovered that my lines isn't lines, >>>they are curves! Can anybody help me?? >>>If you have some source I would be glad. >> >>I am not sure of this, but someone told me that gamma correction is used to >>compensate for the curve of a monitor, so maybe your gamma correction is off >>for your monitor. Someone please correct me if I am wrong. >> >>Ernie >>krazykid@bu-pub.bu.edu > >This is reason #374 why we need a moderator. > >The question lacks enough information to even guess at, and Ernies answer >is totally wrong. Would whoever is in charge of the moderator vote >please post where we should send our votes? I've been watching >news.announce.newsgroups, news.groups and comp.graphics for the last >month and I've apparently missed the posting. I saw the posting on >the number of votes received so far (very few) but there was no mention >of where to vote. > >Gamma correction has to do with adjusting for non-linearities in >the monitor's brightness. In simple terms this is how to fix the problem >of colors set to half intensity appearing much less than half as bright as >the same colors set to full intensity. Most any graphics book will discuss >this in detail. Look under computer graphics in your local libraries card >catalog for books on the subject. Addresses of Libraries can be found in your >local phone book. If you don't have a phone book, call 1-555-1212 and ask the >operator for help in finding a library near you. > >[Note for the humor impaired: the previous paragraph ended with a slight >undercurrent of sarcasm but was not intended as a personal attack.] > >-- Well actually, Ken, gamma correction has nothing at all to do with appearance or `perceived' brightness. What gamma correction does is correct for the non-linear relationship between the voltages generated by a video DAC and the actual intensity of the light energy coming off of the display. A gamma corrected frame buffer allows the values stored in VRAM to be intensity-linear. This technique is used on workstation displays (including NeXT's) because a wide variety of computer graphics algorithms (such as compositing, dithering, and anti-aliasing) rely on the linear mixing of light energy and, as such, require intensity linear pixels. However, if a human looks at a ramp of, say, 16 intensity-linear gray levels, the step between the first two will be *perceptually* larger than the step between the last two. This is because the human visual system does not perceive in an intensity-linear fashion. Of course it's difficult to exactly quantify the perceptual response of the visual system as a function of energy, but many have suggested a logarithmic relationship or as in the CIE LAB colorspace a cube-root of energy. In fact, although non gamma-corrected frame buffers (in which the frame buffer values are directly proportional to voltage) are usually scoffed at, they do offer a more perceptually efficient quantization of the color-space. This is because the gamma exponent of 2.2 is counter balanced by the exponent of 1/3 in the L* equation. Of course, in such a frame buffer dithering, compositing, and anti-aliasing calculations become more complex. So, in summary, voltage-linearity, intensity-linearity and perceptual-linearity are three very different beasts, and gamma correction attempts to relate only the first two. For a good article on some of this stuff, check out Bruce Lindbloom's article in the '89 siggraph proceedings entitled "Accurate Color Reproduction for Computer Graphics Applications" Peter Graffagnino Graphics Software NeXT Computer, Inc.