Jump to content
  • Advertisement
Sign in to follow this  

GLSL error

This topic is 4411 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I can't figure out why I'm getting the following error and having my app crashing: Shader Linking Error: Vertex info ----------- (8) : warning C7011: implicit cast from "int" to "float" (28) : warning C7011: implicit cast from "int" to "float" (28) : warning C7011: implicit cast from "int" to "float" (18) : warning C7011: implicit cast from "float" to "int" (18) : error C5025: lvalue in assignment too complex Here's the part of the shader
mat4 newMatrix = mat4(vec4(gl_MultiTexCoord1.xyz, 0.0),
			      0.0, 1.0, 0.0, 0.0,
                              0.0, 0.0, 1.0, 0.0,
                              0.0, 0.0, 0.0, 1.0);

If I replace the vec4(gl_MultiTexCoord1.xyz, 0.0) with simply 1.0, 0.0, 0.0, 0.0 the app runs just fine.

Share this post


Link to post
Share on other sites
Advertisement
I got a fealing maybe putting "f" on the end might solve some problems, I don't know though. GLSL is very odd...

EDIT:

Hmmm, actually...


vec4 temp = vec4(gl_MultiTexCoord1.xyz,0.0f);
mat4 newMatrix = mat4(temp.x,temp.y,temp.z,temp.a,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0);



Simple because if the conversion is too much for the compiler to do, you should do it yourself.

Share this post


Link to post
Share on other sites
Well I got it to work by putting each component of the texture coord in the matrix, but does this cause it to be slower? I just thought that perhaps the gpu can assign a vector into the row of the matrix faster than individual values, or does it not matter?

Share this post


Link to post
Share on other sites
I'm not sure but possibly you can't construct from a vector as well as scalars. For example: I think this might be allowed:

mat4 newmat = mat4(vec4, vec4, vec4, vec4);
or
mat4 newmat = mat4(float, float, ...(16 floats));

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!