Mailing Lists: Apple Mailing Lists

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

shaders and projected depth maps



I'm currently attempting to create a shader that takes an image and a depth map. The depth map is being projected from the light's point of view using projective texture mapping. If I access only one of the textures it works fine, but as soon as I attempt to use multitexturing within the shader I get inconsistent and incorrect results. Here's an example of a simple shader that isn't working for me:

//BEGIN SHADER
uniform sampler2DRect image;
uniform sampler2DRectShadow depthMap;
void main (void)
{
	vec4 img = texture2DRect(image, gl_FragCoord.st);
	gl_FragColor = img * shadow2DRectProj(depthMap, gl_TexCoord[1]);
}
//END SHADER

If I access the texture independently it works as expected for that shader. Has anyone else gotten multi texturing and projective depth maps working? I have tried this on both intel and Power PC to no avail. It seems to be something with the projective textures but I haven't been able to track it down. Any help or hints would be greatly appreciated.
Thanks
Greg Keech


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