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: Scale texture coordinates



> is there a way to scale texture coordinates (for texture lookups
> inside a shader) to some range other than 0.0 to 1.0. Say from -100 to
> 100? Couldn't find this on the books I have.

Several options, from generally cheapest:

1) Just pass them not in 0..1 range, but in -100..100 range. Texture
coordinate can be pretty much any number, nowhere it is required to
use 0..1 range.
2) Use texture matrix to scale them (if you're using fixed function
vertex processing), or scale them how you like in vertex shader /
vertex program.
3) Scale them before doing texture lookup in the fragment shader /
fragment program.


-- 
Aras Pranckevicius
work: http://unity3d.com
home: http://aras-p.info
 _______________________________________________
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: 
 >Scale texture coordinates (From: Mark <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.