Gandi Posted August 29, 2010 Share Posted August 29, 2010 How can i get the direction of the first directional light in the editor?? Quote Link to comment Share on other sites More sharing options...
Canardia Posted August 29, 2010 Share 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 ■ Link to comment Share on other sites More sharing options...
Gandi Posted August 29, 2010 Author Share Posted August 29, 2010 the problem is, how do i get the sun in the editor?? Quote Link to comment Share on other sites More sharing options...
Canardia Posted August 29, 2010 Share 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 ■ Link to comment Share on other sites More sharing options...
Gandi Posted August 30, 2010 Author Share 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 Link to comment Share on other sites More sharing options...
L B Posted September 1, 2010 Share 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 Link to comment Share on other sites More sharing options...
Paul Thomas Posted September 1, 2010 Share 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 Link to comment Share on other sites More sharing options...
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.