Mailing Lists: Apple Mailing Lists

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

Points and GLSL



I'm getting some very bizarre behavior with glTexenvi(GL_POINT_SPRITE,
GL_COORD_REPLACE, GL_TRUE).  I've found nothing in the shader specs of
the point parameter specs that would indicate a lack of support for
varying parameters passed from vertex to fragment program with the
above call.  My goal is to get access to the point sprite texture
coordinates and the point's actual position in world space into a
fragment shader for rendering pseudo 3D forms procedurally.

The issue I'm coming across is that if I pass say:

varying vec3 P; //world space position

to my fragment shader and try to use it in the fragment program, I
lose the texture coordinate variation across the point sprite.  Say
it's something like:

varying vec2 texcoord0;
varying vec3 P;
uniform vec3 eyePos;

void main(void)
{
   vec3 V = P-eyePos;
 gl_FragColor = vec4(texcoord0.xy, 0., 1.);
}

This will give me a green sprite.


varying vec2 texcoord0; varying vec3 P; uniform vec3 eyePos;

void main(void)
{
 //  vec3 V = P-eyePos;
 gl_FragColor = vec4(texcoord0.xy, 0., 1.);
}

this will give me a sprite that varies from black to yellow as
expected.  Any ideas or pointers to parts of the spec that I'm
overlooking?

thanks,
wes
_______________________________________________
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.