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: implementing Cg





Cut and paste the following in a shell window:



cat <<EOF >fragmentProgram.cg

void main(
    out     float4          color   :   COLOR,
    in      float2          tc0     :   TEXCOORD0,
    uniform samplerRECT     tex0    :   TEXUNIT0,
    uniform float4          gamma   :   C0
)
{
    float4 t0 = texRECT(tex0, tc0);
    color = pow(t0, gamma);
}

EOF

/usr/bin/cgc -profile arbfp1 fragmentProgram.cg


This will produce an ARB fragment program that you can
feed directly to glProgramStringARB

    - Emmanuel



On May 13, 2005, at 8:37 AM, Peter Zukowski wrote:

To everyone and anyone on the list,

I'm a newbie to OpenGl and want to learn how to
program.

I downloaded the Cg toolkit for Mac from NVidia's Web
site. I also have the book "The Cg Tutorial" by
Fernando and Kilgard published by NVidia.

I may seem completely ignorant, but I can't figure out
how to use the toolkit. NVidia's Web site tells which
folder from the download contains the compiler, but
there's only a UNIX window in that folder.

I would guess that I can use the toolkit in XCode but
I don't know how to set it up. Perhaps I need to learn
a little more about C or C++.

Is there anyone that can help? Any ideas would be
greatly appreciated.

Thanks for your help.

Peter
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


 _______________________________________________
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: 
 >implementing Cg (From: Peter Zukowski <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.