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: Cg Vertex program output color clamped



I don't have a great answer, but here's my guess: the vertex program clamps color output by default because it doesn't know if there's a custom fragment program being run. If there's not, then by default the color would need to be clamped at each fragment, which would be a slower default behavior than clamping at the vertex stage and assuming interpolated values didn't need to be clamped. Though skimming through the Cg Tutorial it doesn't look like it talks about this issue.

Keenan

On Mar 28, 2005, at 9:06 AM, Joshua 'Schwa' Gargus wrote:

Hi,

By trial and error, I determined that the COLOR output of
my vertex program was being clamped to the range [0,1].
I would have expected that the clamping would occur only
on the output of the fragment program.  I worked around
this by storing the value in TEXCOORD0 instead.

Where is this information documented?  I couldn't find it
in the Cg Toolkit User's Manual.

I don't like this behavior, it seems too much like magic.
I understand why the fragment color output needs to be
clamped, but it doesn't seem necessary for the vertex
color output.

I think I read once that it is possible to create your own
custom semantics, but again I couldn't find this in the
User's Manual (maybe I read it in the Cg Tutorial book,
which I don't currently have access to).  Is this true? If
I am imagining this, the rest of the paragraph does not
apply.  Is it possible to create a custom semantic that
clamps the value passed from the vertex to the fragment
program?  If not, this is an example of what I mean by magic:
an un-/poorly-documented exception to the core model of
the language/runtime that can only be achieved by hacking
the framework itself (not just by using the framework).

Maybe I'm missing something obvious about why this clamping
behavior is intuitive and/or necessary.  If so, please
enlighten me.

Thank you,
Josh


_______________________________________________ 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


_______________________________________________ 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: 
 >Cg Vertex program output color clamped (From: "Joshua 'Schwa' Gargus" <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.