Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

#ActualJoey P

Posted 01 July 2012 - 06:19 PM

First I would suggest writing these in a normal text editor and reading the shader in instead of how you have it. That is pretty ghetto.

Yes, I was going to be getting to that eventually. This is still  just a test app / for learning.

Second:
v_Color[0] = a_Color[0] * diffuse;  \n"
+ "   v_Color[1] = a_Color[1] * diffuse;  \n"
+ "   v_Color[2] = a_Color[2] * diffuse;  \n"
+ "   v_Color[3] = a_Color[3];
  
v_Color = a_Color*diffuse; //write this instead!

But I don't want the alpha channel attenuated.  If I did it that way I'd be able to see through the meshes.

Third, If you are passing in the sun vector, is it changing? Try:
vec3 nSunVector = normalize(vec3(1,1,1));

The sun vector changes very slowly over time but at the moment I'm just passing in constants for testing so it isn't that...

My problem is, I'm lighting the surfaces in world space before doing the rotations and transforming them, I know what I'm doing wrong, I just can't figure out how to do it right...

#2Joey P

Posted 01 July 2012 - 06:12 PM

First I would suggest writing these in a normal text editor and reading the shader in instead of how you have it. That is pretty ghetto.

Yes, I was going to be getting to that eventually. This is still  just a test app / for learning.

Second:
v_Color[0] = a_Color[0] * diffuse;  \n"
+ "   v_Color[1] = a_Color[1] * diffuse;  \n"
+ "   v_Color[2] = a_Color[2] * diffuse;  \n"
+ "   v_Color[3] = a_Color[3];
  
v_Color = a_Color*diffuse; //write this instead!

But I don't want the alpha channel attenuated.  If I did it that way I'd be able to see through the meshes.

Third, If you are passing in the sun vector, is it changing? Try:
vec3 nSunVector = normalize(vec3(1,1,1));

The sun vector changes very slowly over time but at the moment I'm just passing in constants for testing so it isn't that...

#1Joey P

Posted 01 July 2012 - 06:12 PM

First I would suggest writing these in a normal text editor and reading the shader in instead of how you have it. That is pretty ghetto.

Yes, I was going to be getting to that eventually.

Second:
v_Color[0] = a_Color[0] * diffuse;  \n"
+ "   v_Color[1] = a_Color[1] * diffuse;  \n"
+ "   v_Color[2] = a_Color[2] * diffuse;  \n"
+ "   v_Color[3] = a_Color[3];
  
v_Color = a_Color*diffuse; //write this instead!

But I don't want the alpha channel attenuated.  If I did it that way I'd be able to see through the meshes.

Third, If you are passing in the sun vector, is it changing? Try:
vec3 nSunVector = normalize(vec3(1,1,1));

The sun vector changes very slowly over time but at the moment I'm just passing in constants for testing so it isn't that...

PARTNERS