GLSL gl_position issue

I'm writing an android app, that uses native code via jni and also opengl. So here is my issue:

When I pass to my vertex shader, vector and matrix:

vector

0.0, 0.0, -6000000.0, 1

matrix

02.1632595, 0.36784014, -0.35174096, -0.35174096, 
-1.0708126, 0.78774315, -0.6832114, -0.6832114, 
-0.045811795, -1.0432191, -0.6399224, -0.6399224,
-136795.03, -6609499.0, 2286235.0, 2286235.3

And in the vertex shader I do:

gl_Position = matrix * vector;

Then the point is rendered correctly on the screen!!! :) This is OK.

BUT

If I do the calculation (matrix * vector) on the java side or in the C and then I send the result vector directly to the vertex shade:

vector

2110445.408259, 4099267.716789, 3839533.760078, -13717407713764.699000

In this case in the shader I have:

gl_Position = vector;

Then I can not see the point on the screen, where is the issue? :(

Tagged:

Answers

Sign In or Register to comment.