Gandi Posted August 29, 2010 Posted August 29, 2010 How can i get the direction of the first directional light in the editor?? Quote
Canardia Posted August 29, 2010 Posted August 29, 2010 PointEntity(pivot,sun); TVec3 direction=EntityRotation(pivot); Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■
Gandi Posted August 29, 2010 Author Posted August 29, 2010 the problem is, how do i get the sun in the editor?? Quote
Canardia Posted August 29, 2010 Posted August 29, 2010 I use GetFirstEntityByKey("name","sun"); after I have set the name of the directional light to "sun". This is a function in gamelib, which you can copy into your own library, or use gamelib as it is. Quote ■ Ryzen 9 ■ RX 6800M ■ 16GB ■ XF8 ■ Windows 11 ■ ■ Ultra ■ LE 2.5 ■ 3DWS 5.6 ■ Reaper ■ C/C++ ■ C# ■ Fortran 2008 ■ Story ■ ■ Homepage: https://canardia.com ■
Gandi Posted August 30, 2010 Author Posted August 30, 2010 another question... how can i pass a Vec3 to my shader from lua? SetShaderVec3 doesn't work, but SetShaderFloat does.. that's a bit strange.. Quote
L B Posted September 1, 2010 Posted September 1, 2010 another question... how can i pass a Vec3 to my shader from lua? SetShaderVec3 doesn't work, but SetShaderFloat does.. that's a bit strange.. Why don't you pass 3 floats and make the shader create a Vec3 from it? Quote
Paul Thomas Posted September 1, 2010 Posted September 1, 2010 GLSL: gl_LightSource[0].position lightDirection = normalize(vec3(gl_LightSource[0].position)); Honestly never tried it with LE but I wouldn't see why it wouldn't work. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.