Mailing Lists: Apple Mailing Lists

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

float pbuffer question



I have performed the following experiment on a Radeon 9600 running on a
powerbook G4. (I cannot get kCGLPFAColorFloat to give me a floating pbuffer.
However, kCGLPFAColorSize 128 should give me fixed point format. So
I wrote the value "x=3" into the pbuffer, and then read it into the frame buffer
through the routine "rewireExp". The experiments indicate that by the time I computed
"acc" in rewireExp, the value had been clamped to 1, which should not have happened
if the value was truly stored in fixed point format. I expected the value read into "acc"
to equal 3, so that when I divided by "3", "rewireExp" would return 1. In actuality
the return value is 1/3. What is happening?


The expertise regarding floating point buffers is extremely sparse, and there are no demonstration
programs using AGL out on the web. Thanks.


   Gordon



float4 initExp(float2 tc : TEXCOORD0)     // [N,N] on nvidia
           : COLOR
{
    float x = 3.0;
    float4 color = float4(x,x,x,1.0);
    return color;
}
//----------------------------------------------------------------------
float4 rewireExp(float2 tc : TEXCOORD0,
             uniform sampler2D   acc_noise) : COLOR
{
    float4 acc   = tex2D(acc_noise, tc); // orig
    float3 color = acc.xyz / 3.0;
    return float4(color,1.);
}

-----------------

Some of the buffer characteristics:

   int i=0;
   attrib[i++] = kCGLPFAColorSize;
   // works with 96 and 128, but only if kCGLPFAColorFloat is disabled
   attrib[i++] = 128;

   //attrib[i++] = kCGLPFAColorFloat;  //Creates problems

----------
_______________________________________________
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


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.