x


Weird GLSL behavior

Hello,

I have a simple GLSL program:

        varying highp vec3 normal;
        #ifdef VERTEX
        void main() {
            normal = gl_Vertex.xyz;
            gl_Position = ftransform();
        }
        #endif
        #ifdef FRAGMENT
        void main() {
            gl_FragColor = vec4(normalize(normal),1.0);
        }
        #endif

When used on an object, I can see flickering of the color change when moving and rotating the camera in the editor. What am I doing wrong?

Screen-1 Screen-2

Environment: OS X 10.6.6, MacMini 2010 model

Edit-1. Shader compiles and links correctly (at least Unity doesn't report errors/warnings).

more ▼

asked Mar 05 '11 at 11:36 PM

kvark gravatar image

kvark
1 1 1 1

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x56
x44
x31

asked: Mar 05 '11 at 11:36 PM

Seen: 558 times

Last Updated: Mar 05 '11 at 11:36 PM